linux-stable/net/rds
Tetsuo Handa 2425007c09 net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks()
[ Upstream commit a91b750fd6 ]

syzbot is reporting lockdep warning at rds_tcp_reset_callbacks() [1], for
commit ac3615e7f3 ("RDS: TCP: Reduce code duplication in
rds_tcp_reset_callbacks()") added cancel_delayed_work_sync() into a section
protected by lock_sock() without realizing that rds_send_xmit() might call
lock_sock().

We don't need to protect cancel_delayed_work_sync() using lock_sock(), for
even if rds_{send,recv}_worker() re-queued this work while __flush_work()
 from cancel_delayed_work_sync() was waiting for this work to complete,
retried rds_{send,recv}_worker() is no-op due to the absence of RDS_CONN_UP
bit.

Link: https://syzkaller.appspot.com/bug?extid=78c55c7bc6f66e53dce2 [1]
Reported-by: syzbot <syzbot+78c55c7bc6f66e53dce2@syzkaller.appspotmail.com>
Co-developed-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: syzbot <syzbot+78c55c7bc6f66e53dce2@syzkaller.appspotmail.com>
Fixes: ac3615e7f3 ("RDS: TCP: Reduce code duplication in rds_tcp_reset_callbacks()")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:17:00 +02:00
..
Kconfig
Makefile
af_rds.c
bind.c rds: fix refcount bug in rds_sock_addref 2019-02-12 19:46:10 +01:00
cong.c
connection.c
ib.c net/rds: Fix error handling in rds_ib_add_one() 2019-10-07 18:55:20 +02:00
ib.h rds: rds_ib_recv_alloc_cache() should call alloc_percpu_gfp() instead 2018-10-13 09:27:29 +02:00
ib_cm.c rds: rds_ib_recv_alloc_cache() should call alloc_percpu_gfp() instead 2018-10-13 09:27:29 +02:00
ib_fmr.c net: rds: exchange of 8K and 1M pool 2019-05-02 09:40:33 +02:00
ib_frmr.c net/rds: dma_map_sg is entitled to merge entries 2021-09-03 09:56:26 +02:00
ib_mr.h
ib_rdma.c net: rds: fix memory leak in rds_ib_flush_mr_pool 2019-06-11 12:21:45 +02:00
ib_recv.c rds: add missing barrier to release_refill 2022-08-25 11:11:31 +02:00
ib_ring.c
ib_send.c
ib_stats.c net/rds: Fix 'ib_evt_handler_call' element in 'rds_ib_stat_names' 2020-01-27 14:46:47 +01:00
ib_sysctl.c
info.c
info.h
loop.c rds: avoid unenecessary cong_update in loop transport 2018-07-22 14:28:49 +02:00
loop.h
message.c
page.c
rdma.c
rdma_transport.c
rdma_transport.h
rds.h rds: avoid unenecessary cong_update in loop transport 2018-07-22 14:28:49 +02:00
rds_single_path.h
recv.c net: rds: fix memory leak in rds_recvmsg 2021-06-30 08:48:49 -04:00
send.c rds: MP-RDS may use an invalid c_path 2018-04-19 08:56:15 +02:00
stats.c net/rds: Add a few missing rds_stat_names entries 2020-01-27 14:46:42 +01:00
sysctl.c
tcp.c net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() 2022-10-26 13:17:00 +02:00
tcp.h
tcp_connect.c
tcp_listen.c rds: Incorrect reference counting in TCP socket creation 2018-05-30 07:52:10 +02:00
tcp_recv.c
tcp_send.c
tcp_stats.c
threads.c
transport.c