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: <CAGnkfhxBafq4KeR8Jp5XBd7yWrMiofmEwqsCpb_7eL+ddgWagw@mail.gmail.com>
Date:   Wed, 3 Apr 2019 18:40:04 +0200
From:   Matteo Croce <mcroce@...hat.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Christian Brauner <christian@...uner.io>,
        linux-fsdevel@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        Luis Chamberlain <mcgrof@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Zev Weiss <zev@...ilderbeest.net>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] kernel/sysctl.c: fix out of bounds access in fs.file-max

On Wed, Apr 3, 2019 at 5:51 PM Matthew Wilcox <willy@...radead.org> wrote:
>
> On Wed, Apr 03, 2019 at 05:24:26PM +0200, Matteo Croce wrote:
> > On Wed, Apr 3, 2019 at 4:02 PM Christian Brauner <christian@...uner.io> wrote:
> > > Yeah, maybe but it still feels cleaner and more obvious to just add:
> > >
> > > static long long_zero;
> > >
> > > given that most callers actually seem to want an (unsigned) int.
> > >
> > > I don't have a strong opinion though so if others feel that it's just a
> > > waste of space consider it acked.
> > >
> >
> > Well, given that the value is zero, in this expectional case we could
> > avoid duplicating the symbol and save 4 bytes.
> > What the maintainers think?
>
> If we care about saving four bytes, we could just pass the address of
> ZERO_PAGE(0).

That would work, work too, maybe it's a bit overkill.
int zero is always there and it's static, so enlarging it to long
should be a straightforward fix.
Obviously we can't do it for other numbers, but we can alias it just
for the zero case..

Regards,

--
Matteo Croce
per aspera ad upstream

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ