net/rds: Check laddr_check before calling it
authorKa-Cheong Poon <ka-cheong.poon@oracle.com>
Tue, 24 Sep 2019 15:51:16 +0000 (08:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2019 06:26:13 +0000 (08:26 +0200)
commitfc3d296491f4ffd91fee6efbbba37832a59f9bf0
treea4748503481aece36ddf3d00eff94665d7c71c0c
parent3de749d6d7cee11bbbe00090f4a285b759a406ab
net/rds: Check laddr_check before calling it

[ Upstream commit 05733434ee9ae6548723a808647248583e347cca ]

In rds_bind(), laddr_check is called without checking if it is NULL or
not.  And rs_transport should be reset if rds_add_bound() fails.

Fixes: c5c1a030a7db ("net/rds: An rds_sock is added too early to the hash table")
Reported-by: syzbot+fae39afd2101a17ec624@syzkaller.appspotmail.com
Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/rds/bind.c