linux/include
Roman Gushchin 6899b32b5b bpf: disable and restore preemption in __BPF_PROG_RUN_ARRAY
Running bpf programs requires disabled preemption,
however at least some* of the BPF_PROG_RUN_ARRAY users
do not follow this rule.

To fix this bug, and also to make it not happen in the future,
let's add explicit preemption disabling/re-enabling
to the __BPF_PROG_RUN_ARRAY code.

* for example:
 [   17.624472] RIP: 0010:__cgroup_bpf_run_filter_sk+0x1c4/0x1d0
 ...
 [   17.640890]  inet6_create+0x3eb/0x520
 [   17.641405]  __sock_create+0x242/0x340
 [   17.641939]  __sys_socket+0x57/0xe0
 [   17.642370]  ? trace_hardirqs_off_thunk+0x1a/0x1c
 [   17.642944]  SyS_socket+0xa/0x10
 [   17.643357]  do_syscall_64+0x79/0x220
 [   17.643879]  entry_SYSCALL_64_after_hwframe+0x42/0xb7

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-04-23 23:20:11 +02:00
..
acpi xen: fixes for 4.17-rc1 2018-04-12 11:04:35 -07:00
asm-generic asm-generic fixes for v4.17-rc1 2018-04-12 09:15:48 -07:00
clocksource
crypto
drm
dt-bindings The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
keys
kvm
linux bpf: disable and restore preemption in __BPF_PROG_RUN_ARRAY 2018-04-23 23:20:11 +02:00
math-emu
media media updates for v4.17-rc1 2018-04-10 10:10:30 -07:00
memory
misc
net net: sched: ife: handle malformed tlv length 2018-04-22 21:12:00 -04:00
pcmcia
ras
rdma
scsi
soc
sound
target
trace NFS client updates for Linux 4.17 2018-04-12 12:55:50 -07:00
uapi Merge branch 'parisc-4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2018-04-12 17:07:04 -07:00
video
xen xen/sndif: Sync up with the canonical definition in Xen 2018-04-17 08:26:33 -04:00