linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sg negative size: 2.4.23-pre9
@ 2003-11-08 10:44 Douglas Gilbert
  0 siblings, 0 replies; only message in thread
From: Douglas Gilbert @ 2003-11-08 10:44 UTC (permalink / raw)
  To: marcelo.tosatti; +Cc: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

Marcelo,
Thanks to work by Pat LaVarre <p.lavarre@ieee.org> one
of sg's ioctls [SG_SET_RESERVED_SIZE] was found to allow
negative sizes. This causes the kernel pain. This
patch fixes that (, a similar patch was recently put
into lk 2.6.0-test8).

Doug Gilbert

[-- Attachment #2: sg_2423pre9.diff --]
[-- Type: text/plain, Size: 456 bytes --]

--- linux/drivers/scsi/sg.c	2003-06-14 13:49:51.000000000 +1000
+++ linux/drivers/scsi/sg.c2423pre9dpg	2003-11-08 19:11:00.000000000 +1000
@@ -871,6 +871,8 @@
     case SG_SET_RESERVED_SIZE:
         result = get_user(val, (int *)arg);
         if (result) return result;
+        if (val < 0)
+            return -EINVAL;
         if (val != sfp->reserve.bufflen) {
             if (sg_res_in_use(sfp) || sfp->mmap_called)
                 return -EBUSY;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-09  0:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-08 10:44 [PATCH] sg negative size: 2.4.23-pre9 Douglas Gilbert

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).