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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 21 Mar 2021 20:29:34 -0400
From:   Tong Zhang <ztong0001@...il.com>
To:     Hannes Reinecke <hare@...nel.org>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     ztong0001@...il.com
Subject: [PATCH 1/2] scsi: myrb: fix null-ptr-dereference in myrb_cleanup

cb->disable_intr may not be set yet when myrb_cleanup is called.
check before using this function pointer.

[    1.410913] BUG: kernel NULL pointer dereference, address: 0000000000000000
[    1.411273] #PF: supervisor instruction fetch in kernel mode
[    1.411566] #PF: error_code(0x0010) - not-present page
[    1.413138] RIP: 0010:0x0
[    1.417711]  myrb_cleanup+0x13f/0x1b0 [myrb]
[    1.417939]  myrb_probe.cold+0xc6/0x6fc [myrb]

Signed-off-by: Tong Zhang <ztong0001@...il.com>
---
 drivers/scsi/myrb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index 3d8e91c07dc7..ee33d97fb92c 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -1240,7 +1240,8 @@ static void myrb_cleanup(struct myrb_hba *cb)
 	myrb_unmap(cb);
 
 	if (cb->mmio_base) {
-		cb->disable_intr(cb->io_base);
+		if (cb->disable_intr)
+			cb->disable_intr(cb->io_base);
 		iounmap(cb->mmio_base);
 	}
 	if (cb->irq)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ