linux/net/rds
Tetsuo Handa 30bfa5aa72 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 12:34:49 +02:00
..
af_rds.c net: pass a sockptr_t into ->setsockopt 2020-07-24 15:41:54 -07:00
bind.c
cong.c net: rds: delete duplicated words 2020-09-18 14:12:43 -07:00
connection.c rds: memory leak in __rds_conn_create() 2021-12-22 09:32:42 +01:00
ib_cm.c rds: ib: Remove two ib_modify_qp() calls 2021-04-12 19:51:48 -03:00
ib_frmr.c net/rds: dma_map_sg is entitled to merge entries 2021-08-18 15:35:50 -07:00
ib_mr.h RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
ib_rdma.c RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
ib_recv.c rds: add missing barrier to release_refill 2022-08-25 11:39:54 +02:00
ib_ring.c rds: Fix spelling mistakes 2021-05-31 22:45:05 -07:00
ib_send.c rds: Remove redundant assignment to nr_sig 2021-04-27 14:14:33 -07:00
ib_stats.c
ib_sysctl.c
ib.c rds: stop using dmapool 2020-11-17 15:22:06 -04:00
ib.h rds: stop using dmapool 2020-11-17 15:22:06 -04:00
info.c rds: fix crash in rds_info_getsockopt() 2020-05-20 14:08:06 -07:00
info.h
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
loop.c
loop.h
Makefile RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
message.c Revert "net/rds: Avoid potential use after free in rds_send_remove_from_sock" 2021-04-24 09:32:35 -07:00
page.c
rdma_transport.c rds: ib: Remove two ib_modify_qp() calls 2021-04-12 19:51:48 -03:00
rdma_transport.h net: rds: rdma_transport.h: delete duplicated word 2020-07-19 18:14:51 -07:00
rdma.c net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS 2021-02-02 08:44:08 -08:00
rds_single_path.h
rds.h net: pass a sockptr_t into ->setsockopt 2020-07-24 15:41:54 -07:00
recv.c net: rds: fix memory leak in rds_recvmsg 2021-06-08 16:32:17 -07:00
send.c Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
stats.c
sysctl.c
tcp_connect.c rds: Fix fall-through warnings for Clang 2021-05-17 20:00:27 -05:00
tcp_listen.c RDS tcp loopback connection can hang 2021-05-21 14:46:59 -07:00
tcp_recv.c rds: Fix spelling mistakes 2021-05-31 22:45:05 -07:00
tcp_send.c tcp: add tcp_sock_set_cork 2020-05-28 11:11:45 -07:00
tcp_stats.c
tcp.c net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() 2022-10-26 12:34:49 +02:00
tcp.h RDS tcp loopback connection can hang 2021-05-21 14:46:59 -07:00
threads.c rds: Fix fall-through warnings for Clang 2021-05-17 20:00:27 -05:00
transport.c rds: transport module should be auto loaded when transport is set 2020-06-25 16:26:25 -07:00