Skip to contentSkip to conversation

scsi_dh: avoid allowing dh_state to pass format specs when requesting a module

PATCH In review Sasha Levin 2 participants 2 messages Sep 24, 2015 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi_dh: avoid allowing dh_state to pass format specs when requesting a module

A malicious string passed from userspace might contain format specifiers which request_module() might try to handle, which is bad.

---
 drivers/scsi/scsi_dh.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_dh.c +1 -1
index edb044a..24be260 100644
@@ -111,7 +111,7 @@ static struct scsi_device_handler *scsi_dh_lookup(const char *name)
 
 	dh = __scsi_dh_lookup(name);
 	if (!dh) {
-		request_module(name);
+		request_module("%s", name);
 		dh = __scsi_dh_lookup(name);
 	}
 
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Sasha Levin

A malicious string passed from userspace might contain format specifiers which request_module() might try to handle, which is bad.

---
 drivers/scsi/scsi_dh.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_dh.c +0 -0
index edb044a..24be260 100644

drivers/scsi/scsi_dh.c static struct scsi_device_handler *scsi_dh_lookup(const char *name) · line 116

Quoted 7 lines
drivers/scsi/scsi_dh.c +1 -1
@@ -111,7 +111,7 @@ static struct scsi_device_handler *scsi_dh_lookup(const char *name)
 
 	dh = __scsi_dh_lookup(name);
 	if (!dh) {
-		request_module(name);
+		request_module("%s", name);
 		dh = __scsi_dh_lookup(name);
 	}

Good catch.

Signature · 6 lines
Johannes Thumshirn                                           Storage
[email protected]                                 +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600  D0D0 0393 969D 2D76 0850