~cascardo/ubuntu/+source/linux/+git/precise:cve-2016-9756

Last commit made on 2016-12-19
Get this branch:
git clone -b cve-2016-9756 https://git.launchpad.net/~cascardo/ubuntu/+source/linux/+git/precise
Only Thadeu Lima de Souza Cascardo can upload to this branch. If you are Thadeu Lima de Souza Cascardo please log in for upload directions.

Branch merges

Branch information

Name:
cve-2016-9756
Repository:
lp:~cascardo/ubuntu/+source/linux/+git/precise

Recent commits

dc29ae7... by =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= <email address hidden>

KVM: x86: drop error recovery in em_jmp_far and em_ret_far

em_jmp_far and em_ret_far assumed that setting IP can only fail in 64
bit mode, but syzkaller proved otherwise (and SDM agrees).
Code segment was restored upon failure, but it was left uninitialized
outside of long mode, which could lead to a leak of host kernel stack.
We could have fixed that by always saving and restoring the CS, but we
take a simpler approach and just break any guest that manages to fail
as the error recovery is error-prone and modern CPUs don't need emulator
for this.

Found by syzkaller:

  WARNING: CPU: 2 PID: 3668 at arch/x86/kvm/emulate.c:2217 em_ret_far+0x428/0x480
  Kernel panic - not syncing: panic_on_warn set ...

  CPU: 2 PID: 3668 Comm: syz-executor Not tainted 4.9.0-rc4+ #49
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
   [...]
  Call Trace:
   [...] __dump_stack lib/dump_stack.c:15
   [...] dump_stack+0xb3/0x118 lib/dump_stack.c:51
   [...] panic+0x1b7/0x3a3 kernel/panic.c:179
   [...] __warn+0x1c4/0x1e0 kernel/panic.c:542
   [...] warn_slowpath_null+0x2c/0x40 kernel/panic.c:585
   [...] em_ret_far+0x428/0x480 arch/x86/kvm/emulate.c:2217
   [...] em_ret_far_imm+0x17/0x70 arch/x86/kvm/emulate.c:2227
   [...] x86_emulate_insn+0x87a/0x3730 arch/x86/kvm/emulate.c:5294
   [...] x86_emulate_instruction+0x520/0x1ba0 arch/x86/kvm/x86.c:5545
   [...] emulate_instruction arch/x86/include/asm/kvm_host.h:1116
   [...] complete_emulated_io arch/x86/kvm/x86.c:6870
   [...] complete_emulated_mmio+0x4e9/0x710 arch/x86/kvm/x86.c:6934
   [...] kvm_arch_vcpu_ioctl_run+0x3b7a/0x5a90 arch/x86/kvm/x86.c:6978
   [...] kvm_vcpu_ioctl+0x61e/0xdd0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2557
   [...] vfs_ioctl fs/ioctl.c:43
   [...] do_vfs_ioctl+0x18c/0x1040 fs/ioctl.c:679
   [...] SYSC_ioctl fs/ioctl.c:694
   [...] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685
   [...] entry_SYSCALL_64_fastpath+0x1f/0xc2

Reported-by: Dmitry Vyukov <email address hidden>
Cc: <email address hidden>
Fixes: d1442d85cc30 ("KVM: x86: Handle errors when RIP is set during far jumps")
Signed-off-by: Radim Krčmář <email address hidden>
(backported from commit 2117d5398c81554fbf803f5fd1dc55eb78216c0c)
Signed-off-by: Thadeu Lima de Souza Cascardo <email address hidden>
CVE-2016-9756

6e89c69... by Brad Figg

UBUNTU: Ubuntu-3.2.0-118.161

Signed-off-by: Brad Figg <email address hidden>

e698df7... by Philip Pettersson <email address hidden>

packet: fix race condition in packet_set_ring

CVE-2016-8655

BugLink: http://bugs.launchpad.net/bugs/1646318

When packet_set_ring creates a ring buffer it will initialize a
struct timer_list if the packet version is TPACKET_V3. This value
can then be raced by a different thread calling setsockopt to
set the version to TPACKET_V1 before packet_set_ring has finished.

This leads to a use-after-free on a function pointer in the
struct timer_list when the socket is closed as the previously
initialized timer will not be deleted.

The bug is fixed by taking lock_sock(sk) in packet_setsockopt when
changing the packet version while also taking the lock at the start
of packet_set_ring.

Fixes: f6fb8f100b80 ("af-packet: TPACKET_V3 flexible buffer implementation.")
Signed-off-by: Philip Pettersson <email address hidden>
Signed-off-by: Eric Dumazet <email address hidden>
Signed-off-by: Brad Figg <email address hidden>
Acked-by: Stefan Bader <email address hidden>
Acked-by: Ben Romer <email address hidden>

22eef9f... by Brad Figg

UBUNTU: Start new release

Ignore: yes
Signed-off-by: Brad Figg <email address hidden>

a6ae365... by Luis Henriques

UBUNTU: Ubuntu-3.2.0-116.158

Signed-off-by: Luis Henriques <email address hidden>

82f600c... by Boris Ostrovsky

xen/balloon: Don't continue ballooning when BP_ECANCELED is encountered

BugLink: http://bugs.launchpad.net/bugs/1304001

Commit 3dcf63677d4e ("xen/balloon: cancel ballooning if adding new
memory failed") makes reserve_additional_memory() return BP_ECANCELED
when an error is encountered. This error, however, is ignored by the
caller (balloon_process()) since it is overwritten by subsequent call
to update_schedule(). This results in continuous attempts to add more
memory, all of which are likely to fail again.

We should stop trying to schedule next iteration of ballooning when
the current one has failed.

Signed-off-by: Boris Ostrovsky <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>
Signed-off-by: David Vrabel <email address hidden>
(cherry picked from commit fd8b79511349efd1f0decea920f61b93acb34a75)
Signed-off-by: Tim Gardner <email address hidden>
Acked-by: Seth Forshee <email address hidden>
Acked-by: Brad Figg <email address hidden>
Signed-off-by: Luis Henriques <email address hidden>

3fe7377... by David Vrabel

xen/balloon: cancel ballooning if adding new memory failed

BugLink: http://bugs.launchpad.net/bugs/1304001

If the balloon driver is adding additional memory regions to the
balloon and add_memory() fails it will likely continuously fail so
cancel the balloon operation.

Signed-off-by: David Vrabel <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>
(back ported from commit 3dcf63677d4eb7fdfc13290c8558c301d2588fe8)
Signed-off-by: Tim Gardner <email address hidden>

 Conflicts:
 drivers/xen/balloon.c
Acked-by: Seth Forshee <email address hidden>
Acked-by: Brad Figg <email address hidden>
Signed-off-by: Luis Henriques <email address hidden>

cb6eb9c... by Dan Carpenter <email address hidden>

scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer()

We need to put an upper bound on "user_len" so the memcpy() doesn't
overflow.

Cc: <email address hidden>
Reported-by: Marco Grassi <email address hidden>
Signed-off-by: Dan Carpenter <email address hidden>
Reviewed-by: Tomas Henzl <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
CVE-2016-7425
(backported from commit 7bc2b55a5c030685b399bb65b6baa9ccc3d1f167)
[ luis:
  - use '1032' instead of ARCMSR_API_DATA_BUFLEN
  - adjust context ]
Signed-off-by: Luis Henriques <email address hidden>
Signed-off-by: Tim Gardner <email address hidden>

5acf476... by Tim Gardner

UBUNTU: Start new release

Ignore: yes
Signed-off-by: Tim Gardner <email address hidden>

ff16cf2... by Seth Forshee

UBUNTU: Ubuntu-3.2.0-115.157

Signed-off-by: Seth Forshee <email address hidden>