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]
Date:   Mon, 28 Nov 2022 14:54:39 +0100
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Jason A . Donenfeld" <Jason@...c4.com>,
        "Thomas Gleixner" <tglx@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, patches@...ts.linux.dev,
        linux-crypto@...r.kernel.org, linux-api@...r.kernel.org,
        x86@...nel.org, "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        "Adhemerval Zanella Netto" <adhemerval.zanella@...aro.org>,
        "Carlos O'Donell" <carlos@...hat.com>,
        "Florian Weimer" <fweimer@...hat.com>,
        "Christian Brauner" <brauner@...nel.org>
Subject: Re: [PATCH v7 1/3] random: add vgetrandom_alloc() syscall

On Sun, Nov 27, 2022, at 21:18, Jason A. Donenfeld wrote:
>> 
>> config GENERIC_VDSO_RANDOM_WHATEVER
>>        bool
>>        select VGETRANDOM_ALLOC
>> 
>> This gives a clear Kconfig dependency instead of the random
>> ADVISE_SYSCALLS select.
>
> That's much better indeed. I was trying to straddle the two conventions
> of `#define __ARCH_...` for syscalls and a Kconfig for vDSO functions,
> but doing it all together as you've suggested is nicer.
>
> I'll try to figure this out, though so far futzing around suggests there
> might have to be both, because of unistd.h being a userspace header.
> That is, include/uapi/asm-generic/unistd.h typically needs a `#if
> __ARCH_WANT..., #define ...` in it. I'll give it a spin and you'll see
> for v8. At the very least it should get rid of the more awkward
> `select ADVISE_SYSCALLS if X86_64` part, and will better separate the
> arch code from non-arch code.

I think you should not need an __ARCH_WANT_SYS_* symbol for this,
the only place we actually need them for is the asm-generic/unistd.h
header which is still used on a couple of architectures (I have
an experimental series for replacing it with a generic syscall.tbl
file, but it's not ready for 6.2). In most cases, the __ARCH_WANT_SYS_*
symbols are only used for syscalls that are part of the table for
old architectures but get skipped on newer targets that always had
a replacement syscalls (e.g. getrlimit getting replaced by prlimit64)

I think we should just reserve the syscall number for all architectures
right away and #define the __NR_* macro. libc will generally need
a runtime check anyway, and defining it now avoids the problem of
the tables getting out of sync.

The Kconfig symbol is fine in this case.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ