scsi: esas2r: fix potential format string flaw
Subsystems (2)
PATCH RESEND 1/1 scsi: esas2r: fix potential format string flaw
This makes sure format strings cannot leak into the printk call via the constructed buffer.
--- drivers/scsi/esas2r/esas2r_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/esas2r/esas2r_log.c +1 -1
@@ -171,7 +171,7 @@ static int esas2r_log_master(const long level,if (strlen (event_buffer) < buflen)strcat (buffer,"\n" ); -printk (event_buffer); +printk ("%s" , event_buffer);spin_unlock_irqrestore (&event_buffer_lock, flags); }
Signature · 6 lines
1.7.9.5 -- Kees Cook Chrome OS Security
Quoted 7 lines · Kees Cook
This makes sure format strings cannot leak into the printk call via the constructed buffer.
Signed-off-by Kees Cook <[email protected]>--- drivers/scsi/esas2r/esas2r_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Why is this patch "To:" me? I'm not the author of this driver, or the maintainer of it or the subsystem, and there's not much, if anything I can do with it...
confused,
greg k-h
Quoted 4 lines · Greg Kroah-Hartman
Quoted 3 lines · Kees Cook
This makes sure format strings cannot leak into the printk call via the constructed buffer.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Kees Cook <[email protected]>--- drivers/scsi/esas2r/esas2r_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Why is this patch "To:" me? I'm not the author of this driver, or the maintainer of it or the subsystem, and there's not much, if anything I can do with it...
I've resent this before, and since it lived in "drivers", I figured you would be the next up the chain to take it (since it's been ignored).
-Kees
Signature · 2 lines
Kees Cook Chrome OS Security
Quoted 11 lines · Kees Cook
Quoted 9 lines · Greg Kroah-Hartman
Quoted 7 lines · Kees Cook
This makes sure format strings cannot leak into the printk call via the constructed buffer.
Signed-off-by Kees Cook <[email protected]>--- drivers/scsi/esas2r/esas2r_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Quoted 3 lines
Why is this patch "To:" me? I'm not the author of this driver, or the maintainer of it or the subsystem, and there's not much, if anything I can do with it...
I've resent this before, and since it lived in "drivers", I figured you would be the next up the chain to take it (since it's been ignored).
Heh, while I do seem to maintain a ton of the drivers/ tree, I don't take everything there. This needs to go through James's tree, he can handle it :)
thanks,
greg k-h
Quoted 22 lines · Kees Cook
This makes sure format strings cannot leak into the printk call via the constructed buffer.
Signed-off-by Kees Cook <[email protected]>--- drivers/scsi/esas2r/esas2r_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/esas2r/esas2r_log.c +1
-1@@ -171,7 +171,7 @@ static int esas2r_log_master(const long level,if (strlen (event_buffer) < buflen)strcat (buffer,"\n" ); -printk (event_buffer); +printk ("%s" , event_buffer);spin_unlock_irqrestore (&event_buffer_lock, flags); }
Quoted 2 lines · Kees Cook
This makes sure format strings cannot leak into the printk call via the constructed buffer.
[]
drivers/scsi/esas2r/esas2r_log.c
Quoted 1 line
drivers/scsi/esas2r/esas2r_log.c +0
-0
[]
drivers/scsi/esas2r/esas2r_log.c static int esas2r_log_master(const long level, · line 174
Quoted 6 lines
drivers/scsi/esas2r/esas2r_log.c +1
-1@@ -171,7 +171,7 @@ static int esas2r_log_master(const long level,if (strlen (event_buffer) < buflen)strcat (buffer,"\n" ); -printk (event_buffer); +printk ("%s" , event_buffer);
It's probably better to remove the
if (strlen(event_buffer) < buflen) strcat(buffer, "\n");
and use
printk("%s\n", event_buffer);so that the output is always newline terminated.
Quoted 15 lines · Joe Perches
Quoted 2 lines · Kees Cook
This makes sure format strings cannot leak into the printk call via the constructed buffer.
[]
drivers/scsi/esas2r/esas2r_log.c
Quoted 1 line
drivers/scsi/esas2r/esas2r_log.c +0
-0[]
drivers/scsi/esas2r/esas2r_log.c static int esas2r_log_master(const long level, · line 174
Quoted 6 lines
drivers/scsi/esas2r/esas2r_log.c +1
-1@@ -171,7 +171,7 @@ static int esas2r_log_master(const long level,if (strlen (event_buffer) < buflen)strcat (buffer,"\n" ); -printk (event_buffer); +printk ("%s" , event_buffer);It's probably better to remove the
Quoted 8 lines
if (
strlen(event_buffer)< buflen)
strcat(buffer, "\n");and use
printk("%s\n", event_buffer);so that the output is always newline terminated.
Ah! Yes, good call.
-Kees
Signature · 2 lines
Kees Cook Chrome OS Security