mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Vandrovec <vandrove@vc.cvut.cz>
To: Kenneth Michael Ashcraft <kash@stanford.edu>
Cc: linux-kernel@vger.kernel.org, mc@cs.stanford.edu
Subject: Re: [CHECKER] security errors for 2.4.9 and 2.4.9-ac7
Date: Tue, 4 Sep 2001 23:56:55 +0200	[thread overview]
Message-ID: <20010904235655.A12348@vana.vc.cvut.cz> (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>

On Tue, Sep 04, 2001 at 02:07:05PM -0700, Kenneth Michael Ashcraft wrote:
> /home/kash/linux/2.4.9/fs/ncpfs/ioctl.c:394:ncp_ioctl: ERROR:RANGE:387:394: Using user length "outl" as argument to "copy_to_user" [type=LOCAL] [state = need_lb] set by 'copy_from_user':387 [linkages -> 387:outl=object_name_len -> 387:user->object_name
> 
> 			if (copy_from_user(&user,
> 					   (struct ncp_objectname_ioctl*)arg,
> 					   sizeof(user))) return -EFAULT;
> 			user.auth_type = server->auth.auth_type;
> Start --->
> 			outl = user.object_name_len;
> 			user.object_name_len = server->auth.object_name_len;
> 			if (outl > user.object_name_len)
> 				outl = user.object_name_len;
> 			if (outl) {
> 				if (copy_to_user(user.object_name,
> 						 server->auth.object_name,
> Error --->
> 						 outl)) return -EFAULT;
> 			}
> 			if (copy_to_user((struct ncp_objectname_ioctl*)arg,
> 					 &user,
> ---------------------------------------------------------
> [BUG] make user.len large enough so that outl becomes negative.  outl will then be < server->priv.len and make it past the check (gem)
> /home/kash/linux/2.4.9/fs/ncpfs/ioctl.c:462:ncp_ioctl: ERROR:RANGE:456:462: Using user length "outl" as argument to "copy_to_user" [type=LOCAL] [state = need_lb] set by 'copy_from_user':456 [linkages -> 456:outl=len -> 456:user->len -> 456:user:start] 

Hi Kenneth,
  I'll fix these two - but fortunately they are no problem even now.
Although outl is defined as 'int', it is compared against
'user.object_name_len', which is 'size_t' (which is unsigned int),
so whole comparsion is done unsigned and not signed. Thanks
for spotting anyway, there is no reason why it should not be
size_t.
					Petr Vandrovec
					vandrove@vc.cvut.cz

P.S.: And report about drivers/video/matrox/matroxfb_crtc2:535
is completely innocent - it passes these three mentioned
ioctl types down to first head's ioctl handler (and it is
not sisfb_ioctl, definitely... usually it is matroxfb_ioctl
from matroxfb_base.c).


  reply	other threads:[~2001-09-04 21:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-04 21:07 Kenneth Michael Ashcraft
2001-09-04 21:56 ` Petr Vandrovec [this message]
2001-09-05  9:35 ` [CHECKER] security errors for 2.4.9 and 2.4.9-ac7 (FIX 1 of 112) Bob Dunlop
2001-09-07  6:51 ` [PATCH] Re: [CHECKER] security errors for 2.4.9 and 2.4.9-ac7 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=20010904235655.A12348@vana.vc.cvut.cz \
    --to=vandrove@vc.cvut.cz \
    --cc=kash@stanford.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@cs.stanford.edu \
    /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®