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: <CAK8P3a0Bfp+KOTgCRLGFMxh-yBu0H_wd-SvJzDbBVvg42QOgVg@mail.gmail.com>
Date:   Thu, 15 Mar 2018 21:54:19 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Dominik Brodowski <linux@...inikbrodowski.net>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Andy Lutomirski <luto@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux-MM <linux-mm@...ck.org>
Subject: Re: [PATCH v2 21/36] mm: add ksys_mmap_pgoff() helper; remove
 in-kernel calls to sys_mmap_pgoff()

On Thu, Mar 15, 2018 at 8:05 PM, Dominik Brodowski
<linux@...inikbrodowski.net> wrote:
> Using this helper allows us to avoid the in-kernel calls to the
> sys_mmap_pgoff() syscall.
>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: linux-mm@...ck.org
> Signed-off-by: Dominik Brodowski <linux@...inikbrodowski.net>

It might be a good idea to clean up the sys_mmap2()/sys_mmap_pgoff()
distinction as well: From what I understand (I'm sure Al will correct me
if this is wrong), all 32-bit architectures have a sys_mmap2() syscall
that has a fixed bit shift value, possibly always 12.
sys_mmap_pgoff() is defined to have a shift of PAGE_SHIFT, which
may or may not depend on the kernel configuration.

If we replace the

+SYSCALL_DEFINE6(mmap_pgoff, unsigned long, addr, unsigned long, len,
+               unsigned long, prot, unsigned long, flags,
+               unsigned long, fd, unsigned long, pgoff)
+{
+       return ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
+}

with a corresponding sys_mmap2() definition, it seems we can
simplify a number of architectures that today need to define
sys_mmap2() as a wrapper around sys_mmap_pgoff().

        Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ