lkml.org 
[lkml]   [2003]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 2.5.68 fix mismatched access_ok() checks in sg_io()

I've found this while doing bio_map_user() changes,
please forward to Linus.

--
Bartlomiej

--- linux-2.5.68/drivers/block/scsi_ioctl.c Sun Apr 20 04:51:16 2003
+++ linux/drivers/block/scsi_ioctl.c Thu Apr 24 17:36:15 2003
@@ -183,9 +183,11 @@
}

uaddr = (unsigned long) hdr.dxferp;
- if (writing && !access_ok(VERIFY_WRITE, uaddr, bytes))
+ /* writing to device -> reading from vm */
+ if (writing && !access_ok(VERIFY_READ, uaddr, bytes))
return -EFAULT;
- else if (reading && !access_ok(VERIFY_READ, uaddr, bytes))
+ /* reading from device -> writing to vm */
+ else if (reading && !access_ok(VERIFY_WRITE, uaddr, bytes))
return -EFAULT;

/*
-
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 13:34    [W:0.044 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site