mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bob Dunlop <Bob.Dunlop@farsite.co.uk>
To: Kenneth Michael Ashcraft <kash@stanford.edu>
Cc: linux-kernel@vger.kernel.org, mc@cs.stanford.edu, torvalds@transmeta.com
Subject: Re: [CHECKER] security errors for 2.4.9 and 2.4.9-ac7 (FIX 1 of 112)
Date: Wed, 5 Sep 2001 10:35:40 +0100	[thread overview]
Message-ID: <20010905103540.A30856@farsite.co.uk> (raw)
In-Reply-To: <Pine.GSO.4.31.0109041405210.15852-100000@saga18.Stanford.EDU>
In-Reply-To: <Pine.GSO.4.31.0109041405210.15852-100000@saga18.Stanford.EDU>; from kash@stanford.edu on Wed, Sep 05, 2001 at 07:27:53AM +0100

Hi,

On Wed, Sep  5,  Kenneth Michael Ashcraft wrote:
> Hi All,
> 
> I've extended the security checker (makes sure that user lengths are
> bounds checked) quite a bit since my last report on July 13.  The checker
> makes sure that bounds checks are present before a user length is:
...
> ---------------------------------------------------------
> [BUG] this one looks nasty.  not only copy a large amount but copy it wherever (gem)
> /home/kash/linux/2.4.9/drivers/net/wan/farsync.c:1214:fst_ioctl: ERROR:RANGE:1203:1214: Using user length "size" as argument to "copy_from_user" [type=LOCAL] [state = need_ub] set by 'copy_from_user':1203 [distance=12]

I'd agree it's nasty.  Don't you just love overflow math.

Fortunatly the fix is straight forward:


--- linux/drivers/net/wan/farsync.c.orig	Sun Aug 12 18:38:48 2001
+++ linux/drivers/net/wan/farsync.c	Wed Sep  5 09:52:33 2001
@@ -1200,7 +1200,8 @@
                 /* Sanity check the parameters. We don't support partial writes
                  * when going over the top
                  */
-                if ( wrthdr.size + wrthdr.offset > FST_MEMSIZE )
+                if ( wrthdr.size > FST_MEMSIZE || wrthdr.offset > FST_MEMSIZE
+                                || wrthdr.size + wrthdr.offset > FST_MEMSIZE )
                 {
                         return -ENXIO;
                 }



-- 
        Bob Dunlop
        FarSite Communications Ltd.
        http://www.farsite.co.uk/

  parent reply	other threads:[~2001-09-05  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-04 21:07 [CHECKER] security errors for 2.4.9 and 2.4.9-ac7 Kenneth Michael Ashcraft
2001-09-04 21:56 ` Petr Vandrovec
2001-09-05  9:35 ` Bob Dunlop [this message]
2001-09-07  6:51 ` [PATCH] " Philipp Matthias Hahn

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=20010905103540.A30856@farsite.co.uk \
    --to=bob.dunlop@farsite.co.uk \
    --cc=kash@stanford.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@cs.stanford.edu \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®