android_kernel_xiaomi_sm7250/net/rds
Tetsuo Handa e3cb25d3ad net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks()
[ Upstream commit a91b750fd6629354460282bbf5146c01b05c4859 ]

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:19:26 +02:00
..
af_rds.c net/rds: Check address length before reading address family 2019-05-02 09:58:57 +02:00
bind.c net/rds: Check laddr_check before calling it 2019-10-01 08:26:13 +02:00
cong.c rds: Changing IP address internal representation to struct in6_addr 2018-07-23 21:17:44 -07:00
connection.c rds: memory leak in __rds_conn_create() 2021-12-22 09:19:01 +01:00
ib_cm.c rds: Remove IPv6 dependency 2018-08-01 09:32:35 -07:00
ib_fmr.c net: rds: exchange of 8K and 1M pool 2019-05-02 09:59:00 +02:00
ib_frmr.c net/rds: dma_map_sg is entitled to merge entries 2021-09-03 09:58:02 +02:00
ib_mr.h Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-08-02 10:55:32 -07:00
ib_rdma.c net: rds: fix memory leak in rds_ib_flush_mr_pool 2019-06-11 12:20:49 +02:00
ib_recv.c rds: add missing barrier to release_refill 2022-08-25 11:15:34 +02:00
ib_ring.c RDS/IW+IB: Set recv ring low water mark to 1/2 full. 2009-04-09 17:21:14 -07:00
ib_send.c Merge branch 'linus/master' into rdma.git for-next 2018-08-16 14:21:29 -06:00
ib_stats.c net/rds: Fix 'ib_evt_handler_call' element in 'rds_ib_stat_names' 2020-01-27 14:51:13 +01:00
ib_sysctl.c net: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00
ib.c net/rds: Fix error handling in rds_ib_add_one() 2019-10-07 18:57:24 +02:00
ib.h rds: Fix build regression. 2018-09-23 12:25:15 -07:00
info.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
info.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig net/rds: RDS is not Radio Data System 2018-08-31 23:09:53 -07:00
loop.c rds: Changing IP address internal representation to struct in6_addr 2018-07-23 21:17:44 -07:00
loop.h rds: clean up loopback rds_connections on netns deletion 2018-06-27 10:11:03 +09:00
Makefile rds: remove trailing whitespace and blank lines 2018-07-24 14:10:42 -07:00
message.c rds: remove trailing whitespace and blank lines 2018-07-24 14:10:42 -07:00
page.c rds: remove dead code 2016-12-26 21:35:39 -05:00
rdma_transport.c rds: Remove IPv6 dependency 2018-08-01 09:32:35 -07:00
rdma_transport.h rds: Enable RDS IPv6 support 2018-07-23 21:17:44 -07:00
rdma.c net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS 2021-02-23 15:00:58 +01:00
rds_single_path.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rds.h net/rds: fix warn in rds_message_alloc_sgs 2019-04-20 09:16:03 +02:00
recv.c net: rds: fix memory leak in rds_recvmsg 2021-06-30 08:48:15 -04:00
send.c rds: Fix warning. 2019-07-10 09:53:46 +02:00
stats.c net/rds: Add a few missing rds_stat_names entries 2020-01-27 14:51:04 +01:00
sysctl.c net: rds: fix coding style issues 2016-06-18 21:34:09 -07:00
tcp_connect.c rds: Enable RDS IPv6 support 2018-07-23 21:17:44 -07:00
tcp_listen.c RDS tcp loopback connection can hang 2021-06-16 11:54:57 +02:00
tcp_recv.c rds: Changing IP address internal representation to struct in6_addr 2018-07-23 21:17:44 -07:00
tcp_send.c rds: Changing IP address internal representation to struct in6_addr 2018-07-23 21:17:44 -07:00
tcp_stats.c net: rds: fix const array syntax 2011-07-01 16:16:19 -07:00
tcp.c net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() 2022-10-26 13:19:26 +02:00
tcp.h RDS tcp loopback connection can hang 2021-06-16 11:54:57 +02:00
threads.c rds: Changing IP address internal representation to struct in6_addr 2018-07-23 21:17:44 -07:00
transport.c rds: remove trailing whitespace and blank lines 2018-07-24 14:10:42 -07:00