All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: marcelo.tosatti@cyclades.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] sg negative size: 2.4.23-pre9
Date: Sat, 08 Nov 2003 20:44:15 +1000	[thread overview]
Message-ID: <3FACC8FF.2000705@torque.net> (raw)

[-- 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;

                 reply	other threads:[~2003-11-09  0:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FACC8FF.2000705@torque.net \
    --to=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.