The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Sam Varshavchik" <mrsam@courier-mta.com>
To: "David S. Miller" <davem@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: two probable security holes
Date: Tue, 25 Sep 2001 01:02:35 GMT	[thread overview]
Message-ID: <courier.3BAFD7AB.0000609A@ny.email-scan.com> (raw)
In-Reply-To: <fa.k5o58rv.d7683s@ifi.uio.no> <fa.iu7m5ov.i6q3rt@ifi.uio.no>
In-Reply-To: <fa.iu7m5ov.i6q3rt@ifi.uio.no>

David S. Miller writes: 

>    From: Ken Ashcraft <kash@stanford.edu>
>    Date: Tue, 18 Sep 2001 14:29:57 -0700 (PDT) 
> 
>    Watch ifr.ifr_name.
>    
> Hi Ken, I believe there is some bug in your new checker algorithms for
> this case. 
> 
>                    struct ifreq ifr;
>                    int err;
>    Start--->
>                    if (copy_from_user(&ifr, (void *)arg, sizeof(ifr)))
>                            return -EFAULT;
>                    ifr.ifr_name[IFNAMSIZ-1] = '\0'; 
> 
> ifreq copied safely to kernel space, ifr.ifr_name[] is inside the
> struct and NOT a user pointer. 
> 
>                    err = tun_set_iff(file, &ifr); 
> 
> Pass address of kernel ifreq. 
> 
>                    if (*ifr->ifr_name)
>                            name = ifr->ifr_name;
>    
>                    if ((err = dev_alloc_name(&tun->dev, name)) < 0)
>                            goto failed; 
> 
> Perfectly fine still, name always points to kernel memory.
>    
>    int dev_alloc_name(struct net_device *dev, const char *name)
>    {
>  ... 
> 
>            for (i = 0; i < 100; i++) {
>    Error--->
>    	       sprintf(buf,name,i); 
> 
> Still fine, as stated "name" is pointing to kernel memory.

Ummm...  Is it possible for name to be, oh, something like 

"foo%s%s%s%s%s"? 

In that case, what would that sprintf do? 

> Perhaps your code is being confused by "ifreq->if_name" being
> an array.

-- 
Sam 


           reply	other threads:[~2001-09-25  1:02 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <fa.iu7m5ov.i6q3rt@ifi.uio.no>]

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=courier.3BAFD7AB.0000609A@ny.email-scan.com \
    --to=mrsam@courier-mta.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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