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: <CAK8P3a13NVbkJzzoZG_7HrDT9qGPR5ptbRUL=xH1oZ1a+5ksHw@mail.gmail.com>
Date:   Mon, 8 Apr 2019 15:58:44 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Christoph Hellwig <hch@....de>
Cc:     Jie Zhang <jie.zhang@...log.com>,
        Mike Frysinger <vapier@...too.org>,
        David Howells <dhowells@...hat.com>,
        linux-arch <linux-arch@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: CONFIG_* symbols in UAPI headers?

On Mon, Apr 8, 2019 at 2:46 PM Christoph Hellwig <hch@....de> wrote:
>
> I just stumbled over the MAP_UNINITIALIZED defintion, initially
> added by:
>
> commit ea637639591def87a54cea811cbac796980cb30d
> Author: Jie Zhang <jie.zhang@...log.com>
> Date:   Mon Dec 14 18:00:02 2009 -0800
>
>     nommu: fix malloc performance by adding uninitialized flag
>
> The defintion depends on CONFIG_MMAP_ALLOW_UNINITIALIZED, which
> will never be set by userspace.  How is this supposed to work?
>
> Shoudn't we define the symbol unconditionally and just turn it
> into a no-op in the implementation?

Right, good catch. That should work. It can probably be done
by adding another check before the conditional, like:

       /* clear anonymous mappings that don't ask for uninitialized data */
       if (!vma->vm_file &&
           !(IS_ENABLED(CONFIG_MMAP_ALLOW_UNINITIALIZED) &&
             (flags & MAP_UNINITIALIZED))
               memset((void *)region->vm_start, 0,
                      region->vm_end - region->vm_start);

> There are a few similar issues, like struct elf_prstatus having
> a different layout depending on CONFIG_BINFMT_ELF_FDPIC, or
> MAX_SHARED_LIBS defending on CONFIG_BINFMT_SHARED_FLAT.

I thought we had cleaned them out a long time ago, but it looks
like those have been there since the uapi headers got split out,
and are still wrong.

Why doesn't scripts/headers_check.pl find those?

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ