scsi: iscsi_tcp: restrict to TCP sockets
Subsystems (4)
PATCH 1/1 scsi: iscsi_tcp: restrict to TCP sockets
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.
--- drivers/scsi/iscsi_tcp.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/iscsi_tcp.c +4 -0
@@ -724,6 +724,10 @@ iscsi_sw_tcp_conn_bind(struct iscsi_cls_session *cls_session,return -EEXIST ; } + err = -EINVAL ; +if (!sk_is_tcp (sock->sk)) + goto free_socket; + err =iscsi_conn_bind (cls_session, cls_conn, is_leading);if (err) goto free_socket;
Signature · 1 line
2.42.0.459.ge4e396fd5e-goog
Quoted 5 lines · Eric Dumazet
Nothing prevents
iscsi_sw_tcp_conn_bind()to receive file descriptor pointing to non TCP socket (af_unixfor example).Return
-EINVALif this is attempted, instead of crashing the kernel.
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 15 lines · On Fri, 15 Sep 2023 17:11:11 +0000 you wrote:
Nothing prevents
iscsi_sw_tcp_conn_bind()to receive file descriptor pointing to non TCP socket (af_unixfor example).Return
-EINVALif this is attempted, instead of crashing the kernel.Fixes 7ba247138907 ("[SCSI] open-iscsi/linux-iscsi-5 Initiator: Initiator code")Signed-off-by Eric Dumazet <[email protected]>Cc Lee Duncan <[email protected]>Cc Chris Leech <[email protected]>Cc Mike Christie <[email protected]>Cc "James E.J. Bottomley" <[email protected]>Cc "Martin K. Petersen" <[email protected]>
Quoted 1 line
[...]
Here is the summary with links:
- scsi: iscsi_tcp: restrict to TCP sockets
https://git.kernel.org/netdev/net/c/f4f82c52a0ea
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html