Skip to contentSkip to conversation

Patch "IB/srpt: Do not accept invalid initiator port names" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Nov 27, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

IB/srpt: Do not accept invalid initiator port names

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ib-srpt-do-not-accept-invalid-initiator-port-names.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From c70ca38960399a63d5c048b7b700612ea321d17e Mon Sep 17 00:00:00 2001

From: Bart Van Assche <[email protected]>
Date: Wed, 11 Oct 2017 10:27:22 -0700
Subject: IB/srpt: Do not accept invalid initiator port names

From: Bart Van Assche <[email protected]>

commit c70ca38960399a63d5c048b7b700612ea321d17e upstream.

Make srpt_parse_i_port_id() return a negative value if hex2bin() fails.

Fixes commit a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1")
---
 drivers/infiniband/ulp/srpt/ib_srpt.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +4 -5
@@ -2777,7 +2777,7 @@ static int srpt_parse_i_port_id(u8 i_por
 {
 	const char *p;
 	unsigned len, count, leading_zero_bytes;
-	int ret, rc;
+	int ret;
 
 	p = name;
 	if (strncasecmp(p, "0x", 2) == 0)
@@ -2789,10 +2789,9 @@ static int srpt_parse_i_port_id(u8 i_por
 	count = min(len / 2, 16U);
 	leading_zero_bytes = 16 - count;
 	memset(i_port_id, 0, leading_zero_bytes);
-	rc = hex2bin(i_port_id + leading_zero_bytes, p, count);
-	if (rc < 0)
-		pr_debug("hex2bin failed for srpt_parse_i_port_id: %d\n", rc);
-	ret = 0;
+	ret = hex2bin(i_port_id + leading_zero_bytes, p, count);
+	if (ret < 0)
+		pr_debug("hex2bin failed for srpt_parse_i_port_id: %d\n", ret);
 out:
 	return ret;
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/block-fix-a-race-between-blk_cleanup_queue-and-timeout-handling.patch queue-4.14/scsi-qla2xxx-suppress-a-kernel-complaint-in-qla_init_base_qpair.patch queue-4.14/ib-srp-avoid-that-a-cable-pull-can-trigger-a-kernel-crash.patch queue-4.14/ib-srpt-do-not-accept-invalid-initiator-port-names.patch