[lkml]   [2001]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subjectproc_scsi_gen_write PAGE_SIZE

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.


--- 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
More majordomo info at
Please read the FAQ at

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