kernel-fxtec-pro1x/net/netfilter/ipvs
Eric Dumazet 50e31318b5 ipvs: move old_secure_tcp into struct netns_ipvs
[ Upstream commit c24b75e0f9239e78105f81c5f03a751641eb07ef ]

syzbot reported the following issue :

BUG: KCSAN: data-race in update_defense_level / update_defense_level

read to 0xffffffff861a6260 of 4 bytes by task 3006 on cpu 1:
 update_defense_level+0x621/0xb30 net/netfilter/ipvs/ip_vs_ctl.c:177
 defense_work_handler+0x3d/0xd0 net/netfilter/ipvs/ip_vs_ctl.c:225
 process_one_work+0x3d4/0x890 kernel/workqueue.c:2269
 worker_thread+0xa0/0x800 kernel/workqueue.c:2415
 kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352

write to 0xffffffff861a6260 of 4 bytes by task 7333 on cpu 0:
 update_defense_level+0xa62/0xb30 net/netfilter/ipvs/ip_vs_ctl.c:205
 defense_work_handler+0x3d/0xd0 net/netfilter/ipvs/ip_vs_ctl.c:225
 process_one_work+0x3d4/0x890 kernel/workqueue.c:2269
 worker_thread+0xa0/0x800 kernel/workqueue.c:2415
 kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 7333 Comm: kworker/0:5 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events defense_work_handler

Indeed, old_secure_tcp is currently a static variable, while it
needs to be a per netns variable.

Fixes: a0840e2e16 ("IPVS: netns, ip_vs_ctl local vars moved to ipvs struct.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-12 19:21:01 +01:00
..
ip_vs_app.c ipvs: don't ignore errors in case refcounting ip_vs module fails 2019-11-12 19:21:01 +01:00
ip_vs_conn.c
ip_vs_core.c ipvs: defer hook registration to avoid leaks 2019-07-26 09:14:10 +02:00
ip_vs_ctl.c ipvs: move old_secure_tcp into struct netns_ipvs 2019-11-12 19:21:01 +01:00
ip_vs_dh.c
ip_vs_est.c
ip_vs_fo.c
ip_vs_ftp.c
ip_vs_lblc.c
ip_vs_lblcr.c
ip_vs_lc.c
ip_vs_mh.c
ip_vs_nfct.c
ip_vs_nq.c
ip_vs_ovf.c
ip_vs_pe.c ipvs: don't ignore errors in case refcounting ip_vs module fails 2019-11-12 19:21:01 +01:00
ip_vs_pe_sip.c
ip_vs_proto.c
ip_vs_proto_ah_esp.c
ip_vs_proto_sctp.c
ip_vs_proto_tcp.c
ip_vs_proto_udp.c
ip_vs_rr.c
ip_vs_sched.c ipvs: don't ignore errors in case refcounting ip_vs module fails 2019-11-12 19:21:01 +01:00
ip_vs_sed.c
ip_vs_sh.c
ip_vs_sync.c ipvs: don't ignore errors in case refcounting ip_vs module fails 2019-11-12 19:21:01 +01:00
ip_vs_wlc.c
ip_vs_wrr.c
ip_vs_xmit.c
Kconfig
Makefile