* [PATCH] scsi_dh: avoid allowing dh_state to pass format specs when requesting a module
@ 2015-09-24 1:08 Sasha Levin
2015-09-24 7:49 ` Johannes Thumshirn
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2015-09-24 1:08 UTC (permalink / raw)
To: JBottomley; +Cc: linux-scsi, linux-kernel, 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 <sasha.levin@oracle.com>
---
drivers/scsi/scsi_dh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c
index edb044a..24be260 100644
--- a/drivers/scsi/scsi_dh.c
+++ b/drivers/scsi/scsi_dh.c
@@ -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);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi_dh: avoid allowing dh_state to pass format specs when requesting a module
2015-09-24 1:08 [PATCH] scsi_dh: avoid allowing dh_state to pass format specs when requesting a module Sasha Levin
@ 2015-09-24 7:49 ` Johannes Thumshirn
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Thumshirn @ 2015-09-24 7:49 UTC (permalink / raw)
To: Sasha Levin; +Cc: JBottomley, linux-scsi, linux-kernel
Sasha Levin <sasha.levin@oracle.com> writes:
> 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 <sasha.levin@oracle.com>
> ---
> drivers/scsi/scsi_dh.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c
> index edb044a..24be260 100644
> --- a/drivers/scsi/scsi_dh.c
> +++ b/drivers/scsi/scsi_dh.c
> @@ -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 <jthumshirn@suse.de>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-24 7:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24 1:08 [PATCH] scsi_dh: avoid allowing dh_state to pass format specs when requesting a module Sasha Levin
2015-09-24 7:49 ` Johannes Thumshirn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).