Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1517066

Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS

From Russell King - ARM Linux <linux@armlinux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS
Date 2016-11-08 11:50 +0100
Message-ID <sBc8x-8ek-3@gated-at.bofh.it> (permalink)
References <syuOm-155-13@gated-at.bofh.it> <sz9eN-1Ud-31@gated-at.bofh.it> <szWpb-8rf-3@gated-at.bofh.it> <sBb2O-7xW-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 08, 2016 at 10:30:42AM +0100, Heiko Carstens wrote:
> Two architectures (arm, mips) have wired them up and thus allocated system
> call numbers, even though they don't have ARCH_HAS_PKEYS set. Which seems a
> bit pointless.

I don't think it's pointless at all.  First, read the LWN article for
the userspace side of the interface: https://lwn.net/Articles/689395/

From reading this, it seems (at least to me) that these pkey syscalls
are going to be the application level API - which means applications
are probably going to want to make these calls.

Sure, they'll have to go through glibc, and glibc can provide stubs,
but the problem with that is if we do get hardware pkey support (eg,
due to pressure to increase security) then we're going to end up
needing both kernel changes and glibc changes to add the calls.

Since one of the design goals of pkeys is to allow them to work when
there is no underlying hardware support, I see no reason not to wire
them up in architecture syscall tables today, so that we have a cross-
architecture kernel version where the pkey syscalls become available.
glibc (and other libcs) don't then have to mess around with per-
architecture recording of which kernel version the pkey syscalls were
added.

Not wiring up the syscalls doesn't really gain anything: the code
present when !ARCH_HAS_PKEYS will still be part of the kernel image,
it just won't be callable.

So, on balance, I've decided to wire them up on ARM, even though the
hardware doesn't support them, to avoid unnecessary pain in userspace
from the ARM side of things.

Obviously what other architectures do is their own business.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Mark Rutland <mark.rutland@arm.com> - 2016-11-01 01:10 +0100
  Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Dave Hansen <dave.hansen@linux.intel.com> - 2016-11-02 20:20 +0100
    Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Mark Rutland <mark.rutland@arm.com> - 2016-11-05 00:50 +0100
      Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-11-08 10:40 +0100
        Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-11-08 11:50 +0100
          Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-11-08 12:30 +0100
            Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Dave Hansen <dave.hansen@linux.intel.com> - 2016-11-08 19:40 +0100
        Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Arnd Bergmann <arnd@arndb.de> - 2016-11-08 12:50 +0100
          Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-11-08 13:10 +0100

csiph-web