]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: iscsi_tcp: restrict to TCP sockets
authorEric Dumazet <edumazet@google.com>
Fri, 15 Sep 2023 17:11:11 +0000 (17:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:38 +0000 (14:56 +0200)
commit5734d22c9ea0a9d394b5e668c8e163bb3eaa3b95
treed1fe612b02d0688f57c0a937c6867151c8e43703
parent2712545e535d7a2e4c53b9c9658a9c88c6055862
scsi: iscsi_tcp: restrict to TCP sockets

[ Upstream commit f4f82c52a0ead5ab363d207d06f81b967d09ffb8 ]

Nothing prevents iscsi_sw_tcp_conn_bind() to receive file descriptor
pointing to non TCP socket (af_unix for example).

Return -EINVAL if this is attempted, instead of crashing the kernel.

Fixes: 7ba247138907 ("[SCSI] open-iscsi/linux-iscsi-5 Initiator: Initiator code")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Lee Duncan <lduncan@suse.com>
Cc: Chris Leech <cleech@redhat.com>
Cc: Mike Christie <michael.christie@oracle.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: open-iscsi@googlegroups.com
Cc: linux-scsi@vger.kernel.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/iscsi_tcp.c