lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 25 Mar 2024 15:24:18 +0300
From: Alexandra Diupina <adiupina@...ralinux.ru>
To: "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>
Cc: Alexandra Diupina <adiupina@...ralinux.ru>,
	"Martin K. Petersen" <martin.petersen@...cle.com>,
	linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org
Subject: [PATCH] scsi: 53c700: call NCR_700_internal_bus_reset() unconditionally

It is necessary to include the SCp check inside the branch
and call NCR_700_internal_bus_reset() unconditionally.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 87fd912d3ba3 ("Add NULL check for SCp in process_script_interrupt()")
Signed-off-by: Alexandra Diupina <adiupina@...ralinux.ru>
---
The patch makes a change to commit 87fd912d3ba3, which I 
created earlier. It became clear that it is necessary to 
call NCR_700_internal_bus_reset() in this condition branch 
for any value of SCp. Sorry for the incorrect previous patch.
 drivers/scsi/53c700.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index e4fe7fc8dfcb..1a422264160d 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -1067,15 +1067,17 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
 			//}
 			NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]);
 		}
-	} else if ((dsps & 0xfffff0f0) == A_UNEXPECTED_PHASE && SCp) {
-		__u8 i = (dsps & 0xf00) >> 8;
-
-		scmd_printk(KERN_ERR, SCp, "UNEXPECTED PHASE %s (%s)\n",
-		       NCR_700_phase[i],
-		       sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
-		scmd_printk(KERN_ERR, SCp, "         len = %d, cmd =",
-			SCp->cmd_len);
-		scsi_print_command(SCp);
+	} else if ((dsps & 0xfffff0f0) == A_UNEXPECTED_PHASE) {
+		if (SCp) {
+			__u8 i = (dsps & 0xf00) >> 8;
+
+			scmd_printk(KERN_ERR, SCp, "UNEXPECTED PHASE %s (%s)\n",
+				NCR_700_phase[i],
+				sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
+			scmd_printk(KERN_ERR, SCp, "         len = %d, cmd =",
+				SCp->cmd_len);
+			scsi_print_command(SCp);
+		}
 
 		NCR_700_internal_bus_reset(host);
 	} else if((dsps & 0xfffff000) == A_FATAL) {
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ