scsi_dh: avoid allowing dh_state to pass format specs when requesting a module
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.
Signed-off-by Sasha Levin <[email protected]>
--- drivers/scsi/scsi_dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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); }
Signature · 1 line
1.7.10.4
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.Signed-off-by Sasha Levin <[email protected]>--- drivers/scsi/scsi_dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/scsi_dh.c +0
-0
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.
Reviewed-by Johannes Thumshirn <[email protected]>
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