]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/rds: An rds_sock is added too early to the hash table
authorKa-Cheong Poon <ka-cheong.poon@oracle.com>
Wed, 11 Sep 2019 09:58:05 +0000 (02:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2019 07:01:45 +0000 (09:01 +0200)
commitfc5b59770306a0e6245e420951191c6322b673ac
tree44225c73900ac84777662d4a999920b945777ec0
parent719532b9b83211febd34a1a5b1aa28c5469a0697
net/rds: An rds_sock is added too early to the hash table

[ Upstream commit c5c1a030a7dbf8dd4e1fa4405ae9a89dc1d2a8db ]

In rds_bind(), an rds_sock is added to the RDS bind hash table before
rs_transport is set.  This means that the socket can be found by the
receive code path when rs_transport is NULL.  And the receive code
path de-references rs_transport for congestion update check.  This can
cause a panic.  An rds_sock should not be added to the bind hash table
before all the needed fields are set.

Reported-by: syzbot+4b4f8163c2e246df3c4c@syzkaller.appspotmail.com
Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/rds/bind.c