Eric Dumazet
b1c17a9a35
flow_dissector: disable preemption around BPF calls
...
Various things in eBPF really require us to disable preemption
before running an eBPF program.
syzbot reported :
BUG: assuming atomic context at net/core/flow_dissector.c:737
in_atomic(): 0, irqs_disabled(): 0, pid: 24710, name: syz-executor.3
2 locks held by syz-executor.3/24710:
#0 : 00000000e81a4bf1 (&tfile->napi_mutex){+.+.}, at: tun_get_user+0x168e/0x3ff0 drivers/net/tun.c:1850
#1 : 00000000254afebd (rcu_read_lock){....}, at: __skb_flow_dissect+0x1e1/0x4bb0 net/core/flow_dissector.c:822
CPU: 1 PID: 24710 Comm: syz-executor.3 Not tainted 5.1.0+ #6
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x172/0x1f0 lib/dump_stack.c:113
__cant_sleep kernel/sched/core.c:6165 [inline]
__cant_sleep.cold+0xa3/0xbb kernel/sched/core.c:6142
bpf_flow_dissect+0xfe/0x390 net/core/flow_dissector.c:737
__skb_flow_dissect+0x362/0x4bb0 net/core/flow_dissector.c:853
skb_flow_dissect_flow_keys_basic include/linux/skbuff.h:1322 [inline]
skb_probe_transport_header include/linux/skbuff.h:2500 [inline]
skb_probe_transport_header include/linux/skbuff.h:2493 [inline]
tun_get_user+0x2cfe/0x3ff0 drivers/net/tun.c:1940
tun_chr_write_iter+0xbd/0x156 drivers/net/tun.c:2037
call_write_iter include/linux/fs.h:1872 [inline]
do_iter_readv_writev+0x5fd/0x900 fs/read_write.c:693
do_iter_write fs/read_write.c:970 [inline]
do_iter_write+0x184/0x610 fs/read_write.c:951
vfs_writev+0x1b3/0x2f0 fs/read_write.c:1015
do_writev+0x15b/0x330 fs/read_write.c:1058
__do_sys_writev fs/read_write.c:1131 [inline]
__se_sys_writev fs/read_write.c:1128 [inline]
__x64_sys_writev+0x75/0xb0 fs/read_write.c:1128
do_syscall_64+0x103/0x670 arch/x86/entry/common.c:298
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Fixes: d58e468b1112 ("flow_dissector: implements flow dissector BPF hook")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Petar Penkov <ppenkov@google.com>
Cc: Stanislav Fomichev <sdf@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-13 09:53:42 -07:00
..
2019-05-04 23:20:58 -07:00
2019-04-08 09:51:54 -07:00
2019-03-27 13:49:44 -07:00
2018-12-13 18:41:38 -08:00
2019-03-27 13:49:43 -07:00
2019-05-05 10:38:04 -07:00
2019-05-01 11:07:03 -04:00
2019-04-27 17:07:22 -04:00
2018-03-05 12:52:45 -05:00
2019-03-21 13:39:25 -07:00
2019-04-05 14:14:19 -07:00
2019-04-10 22:12:26 -07:00
2018-03-29 14:10:30 -04:00
2019-05-08 09:32:10 -07:00
2019-04-28 08:42:41 -04:00
2019-05-13 09:53:42 -07:00
2019-02-06 10:38:25 -08:00
2018-08-11 12:37:10 -07:00
2019-04-10 12:20:46 -07:00
2019-03-10 11:07:14 -07:00
2018-09-19 21:06:46 -07:00
2019-04-27 17:07:21 -04:00
2019-04-27 17:03:44 -04:00
2019-04-27 09:07:04 -07:00
2019-05-07 17:22:09 -07:00
2019-04-27 17:07:21 -04:00
2019-04-09 14:19:06 +02:00
2019-05-07 22:03:58 -07:00
2017-11-02 11:10:55 +01:00
2019-02-17 10:33:39 -08:00
2018-10-23 12:58:17 -07:00
2019-05-07 22:03:58 -07:00
2019-04-22 21:50:54 -07:00
2019-02-13 22:00:16 -08:00
2019-04-08 09:14:28 +02:00
2019-04-16 20:46:17 -07:00
2016-12-29 11:38:31 -05:00
2019-04-27 17:07:21 -04:00
2019-02-03 11:17:31 -08:00
2018-07-11 12:10:19 -06:00
2019-04-22 21:35:55 -07:00
2019-03-07 15:16:20 +01:00
2018-08-14 10:01:24 -07:00
2018-10-20 00:40:45 +02:00
2019-03-27 13:49:43 -07:00
2019-04-28 08:42:41 -04:00
2018-12-04 21:21:18 -08:00
2019-03-23 21:57:38 -04:00
2017-11-02 11:10:55 +01:00
2018-08-04 13:05:39 -07:00
2018-09-01 01:35:53 +02:00