Eric Dumazet
937105d2b0
tcp: annotate data-races around tcp_rsk(req)->ts_recent
...
[ Upstream commit eba20811f32652bc1a52d5e7cc403859b86390d9 ]
TCP request sockets are lockless, tcp_rsk(req)->ts_recent
can change while being read by another cpu as syzbot noticed.
This is harmless, but we should annotate the known races.
Note that tcp_check_req() changes req->ts_recent a bit early,
we might change this in the future.
BUG: KCSAN: data-race in tcp_check_req / tcp_check_req
write to 0xffff88813c8afb84 of 4 bytes by interrupt on cpu 1:
tcp_check_req+0x694/0xc70 net/ipv4/tcp_minisocks.c:762
tcp_v4_rcv+0x12db/0x1b70 net/ipv4/tcp_ipv4.c:2071
ip_protocol_deliver_rcu+0x356/0x6d0 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x13c/0x1a0 net/ipv4/ip_input.c:233
NF_HOOK include/linux/netfilter.h:303 [inline]
ip_local_deliver+0xec/0x1c0 net/ipv4/ip_input.c:254
dst_input include/net/dst.h:468 [inline]
ip_rcv_finish net/ipv4/ip_input.c:449 [inline]
NF_HOOK include/linux/netfilter.h:303 [inline]
ip_rcv+0x197/0x270 net/ipv4/ip_input.c:569
__netif_receive_skb_one_core net/core/dev.c:5493 [inline]
__netif_receive_skb+0x90/0x1b0 net/core/dev.c:5607
process_backlog+0x21f/0x380 net/core/dev.c:5935
__napi_poll+0x60/0x3b0 net/core/dev.c:6498
napi_poll net/core/dev.c:6565 [inline]
net_rx_action+0x32b/0x750 net/core/dev.c:6698
__do_softirq+0xc1/0x265 kernel/softirq.c:571
do_softirq+0x7e/0xb0 kernel/softirq.c:472
__local_bh_enable_ip+0x64/0x70 kernel/softirq.c:396
local_bh_enable+0x1f/0x20 include/linux/bottom_half.h:33
rcu_read_unlock_bh include/linux/rcupdate.h:843 [inline]
__dev_queue_xmit+0xabb/0x1d10 net/core/dev.c:4271
dev_queue_xmit include/linux/netdevice.h:3088 [inline]
neigh_hh_output include/net/neighbour.h:528 [inline]
neigh_output include/net/neighbour.h:542 [inline]
ip_finish_output2+0x700/0x840 net/ipv4/ip_output.c:229
ip_finish_output+0xf4/0x240 net/ipv4/ip_output.c:317
NF_HOOK_COND include/linux/netfilter.h:292 [inline]
ip_output+0xe5/0x1b0 net/ipv4/ip_output.c:431
dst_output include/net/dst.h:458 [inline]
ip_local_out net/ipv4/ip_output.c:126 [inline]
__ip_queue_xmit+0xa4d/0xa70 net/ipv4/ip_output.c:533
ip_queue_xmit+0x38/0x40 net/ipv4/ip_output.c:547
__tcp_transmit_skb+0x1194/0x16e0 net/ipv4/tcp_output.c:1399
tcp_transmit_skb net/ipv4/tcp_output.c:1417 [inline]
tcp_write_xmit+0x13ff/0x2fd0 net/ipv4/tcp_output.c:2693
__tcp_push_pending_frames+0x6a/0x1a0 net/ipv4/tcp_output.c:2877
tcp_push_pending_frames include/net/tcp.h:1952 [inline]
__tcp_sock_set_cork net/ipv4/tcp.c:3336 [inline]
tcp_sock_set_cork+0xe8/0x100 net/ipv4/tcp.c:3343
rds_tcp_xmit_path_complete+0x3b/0x40 net/rds/tcp_send.c:52
rds_send_xmit+0xf8d/0x1420 net/rds/send.c:422
rds_send_worker+0x42/0x1d0 net/rds/threads.c:200
process_one_work+0x3e6/0x750 kernel/workqueue.c:2408
worker_thread+0x5f2/0xa10 kernel/workqueue.c:2555
kthread+0x1d7/0x210 kernel/kthread.c:379
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
read to 0xffff88813c8afb84 of 4 bytes by interrupt on cpu 0:
tcp_check_req+0x32a/0xc70 net/ipv4/tcp_minisocks.c:622
tcp_v4_rcv+0x12db/0x1b70 net/ipv4/tcp_ipv4.c:2071
ip_protocol_deliver_rcu+0x356/0x6d0 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x13c/0x1a0 net/ipv4/ip_input.c:233
NF_HOOK include/linux/netfilter.h:303 [inline]
ip_local_deliver+0xec/0x1c0 net/ipv4/ip_input.c:254
dst_input include/net/dst.h:468 [inline]
ip_rcv_finish net/ipv4/ip_input.c:449 [inline]
NF_HOOK include/linux/netfilter.h:303 [inline]
ip_rcv+0x197/0x270 net/ipv4/ip_input.c:569
__netif_receive_skb_one_core net/core/dev.c:5493 [inline]
__netif_receive_skb+0x90/0x1b0 net/core/dev.c:5607
process_backlog+0x21f/0x380 net/core/dev.c:5935
__napi_poll+0x60/0x3b0 net/core/dev.c:6498
napi_poll net/core/dev.c:6565 [inline]
net_rx_action+0x32b/0x750 net/core/dev.c:6698
__do_softirq+0xc1/0x265 kernel/softirq.c:571
run_ksoftirqd+0x17/0x20 kernel/softirq.c:939
smpboot_thread_fn+0x30a/0x4a0 kernel/smpboot.c:164
kthread+0x1d7/0x210 kernel/kthread.c:379
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
value changed: 0x1cd237f1 -> 0x1cd237f2
Fixes: 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230717144445.653164-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:44:40 +02:00
..
2020-08-10 12:06:44 -07:00
2023-03-17 08:45:11 +01:00
2023-06-09 10:30:05 +02:00
2021-04-14 08:42:05 +02:00
2022-04-13 21:00:57 +02:00
2020-09-25 13:58:01 -07:00
2022-07-21 21:20:08 +02:00
2022-10-30 09:41:19 +01:00
2022-09-28 11:10:35 +02:00
2023-06-28 10:28:11 +02:00
2022-04-27 13:53:48 +02:00
2023-03-22 13:30:00 +01:00
2021-12-08 09:03:26 +01:00
2023-02-01 08:23:25 +01:00
2022-12-02 17:40:01 +01:00
2020-10-02 19:11:11 -07:00
2021-01-12 20:18:12 +01:00
2020-08-03 15:29:44 -07:00
2023-04-20 12:10:21 +02:00
2022-08-03 12:00:46 +02:00
2023-06-09 10:30:05 +02:00
2021-12-22 09:30:53 +01:00
2022-01-27 10:54:33 +01:00
2023-03-11 16:39:50 +01:00
2023-02-01 08:23:15 +01:00
2022-07-21 21:20:07 +02:00
2022-07-29 17:19:12 +02:00
2022-01-27 10:54:33 +01:00
2023-04-05 11:23:35 +02:00
2022-12-02 17:39:58 +01:00
2020-08-25 06:28:02 -07:00
2023-05-30 12:57:52 +01:00
2023-06-05 09:07:04 +02:00
2022-07-07 17:52:19 +02:00
2023-03-22 13:29:58 +01:00
2021-03-17 17:06:12 +01:00
2020-07-09 12:55:37 +02:00
2021-06-18 10:00:05 +02:00
2020-06-30 12:29:39 -07:00
2022-02-16 12:54:25 +01:00
2022-12-02 17:40:05 +01:00
2020-07-10 13:54:00 -07:00
2023-02-01 08:23:24 +01:00
2020-10-30 12:57:39 +01:00
2022-11-03 23:57:54 +09:00
2022-06-09 10:21:09 +02:00
2021-11-18 14:04:08 +01:00
2023-06-05 09:07:04 +02:00
2022-07-29 17:19:12 +02:00
2023-01-14 10:16:51 +01:00
2023-06-14 11:09:59 +02:00
2021-08-18 08:59:13 +02:00
2023-05-30 12:57:46 +01:00
2022-11-25 17:45:55 +01:00
2021-05-14 09:50:46 +02:00
2021-12-01 09:19:06 +01:00
2022-07-29 17:19:18 +02:00
2020-07-06 13:23:03 -07:00
2020-07-06 13:23:03 -07:00
2023-07-27 08:44:09 +02:00
2023-07-27 08:44:40 +02:00
2022-08-03 12:00:45 +02:00
2023-07-27 08:44:40 +02:00
2021-08-12 13:22:05 +02:00
2023-07-27 08:44:40 +02:00
2022-05-09 09:05:03 +02:00
2022-07-29 17:19:21 +02:00
2020-08-24 17:31:20 -07:00
2022-07-29 17:19:21 +02:00
2023-01-24 07:20:01 +01:00
2020-10-13 17:11:52 -07:00
2020-07-06 13:23:03 -07:00
2023-07-27 08:43:37 +02:00
2020-07-09 12:51:36 +02:00
2021-07-28 14:35:37 +02:00
2020-07-24 15:41:54 -07:00
2021-08-12 13:22:05 +02:00
2023-01-14 10:15:43 +01:00
2022-03-02 11:42:51 +01:00
2020-07-10 13:54:00 -07:00
2023-04-26 11:27:41 +02:00
2023-05-30 12:57:57 +01:00
2023-06-28 10:28:10 +02:00
2022-06-14 18:32:40 +02:00
2020-10-09 12:29:48 +02:00