linux/include
Steven Rostedt (Red Hat) a5c09d4c03 ring-buffer: Check if buffer exists before polling
commit 8b8b36834d upstream.

The per_cpu buffers are created one per possible CPU. But these do
not mean that those CPUs are online, nor do they even exist.

With the addition of the ring buffer polling, it assumes that the
caller polls on an existing buffer. But this is not the case if
the user reads trace_pipe from a CPU that does not exist, and this
causes the kernel to crash.

Simple fix is to check the cpu against buffer bitmask against to see
if the buffer was allocated or not and return -ENODEV if it is
not.

More updates were done to pass the -ENODEV back up to userspace.

Link: http://lkml.kernel.org/r/5393DB61.6060707@oracle.com

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 16:21:06 -07:00
..
acpi
asm-generic mm: use paravirt friendly ops for NUMA hinting ptes 2014-05-31 13:20:30 -07:00
clocksource
crypto
drm Merge tag 'ttm-fixes-3.14-2014-02-18' of git://people.freedesktop.org/~thomash/linux into drm-fixes 2014-02-19 08:21:26 +10:00
dt-bindings dt: tegra: remove non-existent clock IDs 2014-05-06 07:59:38 -07:00
keys
kvm ARM: KVM: fix non-VGIC compilation 2014-03-06 09:47:42 +01:00
linux ring-buffer: Check if buffer exists before polling 2014-07-17 16:21:06 -07:00
math-emu
media
memory
misc
net net: fix inet_getid() and ipv6_select_ident() bugs 2014-06-26 15:15:39 -04:00
pcmcia
ras
rdma IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler 2014-05-06 07:59:28 -07:00
rxrpc
scsi scsi: fix our current target reap infrastructure 2014-05-31 13:20:27 -07:00
sound ALSA: control: Protect user controls against concurrent access 2014-06-26 15:15:43 -04:00
target target: Report correct response length for some commands 2014-06-30 20:12:00 -07:00
trace tracing: Fix syscall_*regfunc() vs copy_process() race 2014-07-06 18:57:29 -07:00
uapi usb: gadget: f_fs: resurect usb_functionfs_descs_head structure 2014-07-09 11:18:24 -07:00
video
xen Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2014-02-14 10:45:18 -08:00
Kbuild