Skip to contentSkip to conversation

scsi: aacraid: Fix an Oops in error handling

PATCH Applied Dan Carpenter 2 participants 2 messages May 13, 2020 – May 15, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: aacraid: Fix an Oops in error handling

If the memdup_user() function fails then it results in an Oops in the error handling code when we try to kfree() and error pointer.

Fixes 8d925b1f00e6 ("scsi: aacraid: Use memdup_user() as a cleanup")
---
 drivers/scsi/aacraid/commctrl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/aacraid/commctrl.c +1 -0
index 102658bdc15a..34e65dea992e 100644
@@ -516,6 +516,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
 	user_srbcmd = memdup_user(user_srb, fibsize);
 	if (IS_ERR(user_srbcmd)) {
 		rcode = PTR_ERR(user_srbcmd);
+		user_srbcmd = NULL;
 		goto cleanup;
 	}
 
Signature · 1 line
2.26.2
#1 lore raw
Quoted 2 lines · Dan Carpenter

If the memdup_user() function fails then it results in an Oops in the error handling code when we try to kfree() and error pointer.

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: aacraid: Fix an oops in error handling

      https://git.kernel.org/mkp/scsi/c/25c21d20bcfd
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering