]> git.itanic.dy.fi Git - linux-stable/commit
net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Wed, 28 Sep 2022 15:25:37 +0000 (00:25 +0900)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Oct 2022 06:56:02 +0000 (07:56 +0100)
commita91b750fd6629354460282bbf5146c01b05c4859
tree4f7407a3955bcc7abdfa71a8a7def8c3c51334ca
parentae3ed15da5889263de372ff9df2e83e16acca4cb
net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks()

syzbot is reporting lockdep warning at rds_tcp_reset_callbacks() [1], for
commit ac3615e7f3cffe2a ("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
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: ac3615e7f3cffe2a ("RDS: TCP: Reduce code duplication in rds_tcp_reset_callbacks()")
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/tcp.c