lkml.org 
[lkml]   [2001]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectproc_scsi_gen_write PAGE_SIZE
Al,

Forgive me if I guess wrongly, but patch-2.4.5.log says of -pre3:
- Al Viro: sanity-check user arguments, zero-terminated strings etc.
from which I assume you made the proc_scsi_gen_write() mod below.

I'm not sure what it ought to say instead, but I believe the "else"
case is wrong: buffer[length] is in that case buffer[PAGE_SIZE],
just beyond the end of the page we have allocated.

Hugh

--- v2.4.4/linux/drivers/scsi/scsi.c Wed Apr 25 16:18:54 2001
+++ linux/drivers/scsi/scsi.c Tue May 15 01:29:34 2001
@@ -1572,6 +1572,11 @@
copy_from_user(buffer, buf, length);

err = -EINVAL;
+ if (length < PAGE_SIZE)
+ buffer[length] ='\0';
+ else if (buffer[length])
+ goto out;
+
if (length < 11 || strncmp("scsi", buffer, 4))
goto out;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:57    [W:0.021 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site