lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d23cd44b1e2e1521cedb1c514d392263ed976dca.camel@decadent.org.uk>
Date:   Tue, 26 Jun 2018 18:43:10 +0100
From:   Ben Hutchings <ben@...adent.org.uk>
To:     Jann Horn <jannh@...gle.com>, Al Viro <viro@...iv.linux.org.uk>
Cc:     rth@...ddle.net, ink@...assic.park.msu.ru, mattst88@...il.com,
        "David S. Miller" <davem@...emloft.net>,
        kernel list <linux-kernel@...r.kernel.org>,
        "Eric W. Biederman" <ebiederm@...ssion.com>,
        linux-alpha@...r.kernel.org, sparclinux@...r.kernel.org,
        security@...nel.org, Christoph Hellwig <hch@...radead.org>,
        "Serge E. Hallyn" <serge@...lyn.com>
Subject: Re: [PATCH] sys: don't hold uts_sem while accessing userspace memory

On Mon, 2018-06-25 at 20:16 +0200, Jann Horn wrote:
> On Mon, Jun 25, 2018 at 6:41 PM Al Viro <viro@...iv.linux.org.uk> wrote:
> > 
> > On Mon, Jun 25, 2018 at 06:34:10PM +0200, Jann Horn wrote:
> > 
> > > +     char tmp[32];
> > > 
> > > -     if (namelen > 32)
> > > +     if (namelen < 0 || namelen > 32)
> > >               namelen = 32;
> > > 
> > >       down_read(&uts_sem);
> > >       kname = utsname()->domainname;
> > >       len = strnlen(kname, namelen);
> > > -     if (copy_to_user(name, kname, min(len + 1, namelen)))
> > > -             err = -EFAULT;
> > > +     len = min(len + 1, namelen);
> > > +     memcpy(tmp, kname, len);
> > >       up_read(&uts_sem);
> > > 
> > > -     return err;
> > > +     if (copy_to_user(name, tmp, len))
> > > +             return -EFAULT;
> > 
> > Infoleak, and similar in a lot of other places.
> 
> I don't see a problem. copy_to_user() copies "len" bytes from "tmp".
[...]
> Can you please explain why there is an infoleak here?

I think you're *fixing* information leaks in the Alpha syscalls,
because a negative value of namelen used to result in a huge length
argument to copy_to_user().

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ