]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: Ensure correct state of the socket in send path
authorGuvenc Gulce <guvenc@linux.ibm.com>
Fri, 25 Jun 2021 15:11:02 +0000 (17:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Jun 2021 18:53:51 +0000 (11:53 -0700)
commit60dbc575264726e4ae4bf7ad87a52180a6d60a69
treecbbad7d128615675594f5786c6fc745c2b72d30f
parent68a8b86af4d7e077a66f93a9c70760f3a201bcef
net/smc: Ensure correct state of the socket in send path

When smc_sendmsg() is called before the SMC socket initialization has
completed, smc_tx_sendmsg() will access un-initialized fields of the
SMC socket which results in a null-pointer dereference.
Fix this by checking the socket state first in smc_tx_sendmsg().

Fixes: 5b1f27f51049 ("net/smc: Add SMC statistics support")
Reported-by: syzbot+5dda108b672b54141857@syzkaller.appspotmail.com
Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Guvenc Gulce <guvenc@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_tx.c