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] [day] [month] [year] [list]
Message-ID: <CAK8P3a0zHhEjfEjHYx7UJuxnG1BfMgOhBi2sWrQxV0WwwAvBWQ@mail.gmail.com>
Date:   Wed, 28 Apr 2021 15:48:29 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     Guo Ren <guoren@...nel.org>, Guenter Roeck <linux@...ck-us.net>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-csky@...r.kernel.org,
        linux-arch <linux-arch@...r.kernel.org>,
        Guo Ren <guoren@...ux.alibaba.com>
Subject: Re: [PATCH] csky: uaccess.h: Coding convention with asm generic

On Wed, Apr 28, 2021 at 2:49 PM Christoph Hellwig <hch@...radead.org> wrote:
> On Wed, Apr 28, 2021 at 11:25:29AM +0200, Arnd Bergmann wrote:
> > We might want to come up with a new version of asm-generic/uaccess.h
> > that actually makes it easier to have a sane per-architecture
> > implementation of the low-level accessors without set_fs().
> >
> > I've added Christoph to Cc here, he probably has some ideas
> > on where we should be heading.
>
> I think asm-generic/uaccess.h pretty much only makes sense for
> nommu.  For that case we can just kill the __{get,put}_user_fn
> indirection.  I actually have work for that in an old branch.
>
> Trying to use any of asm-generic/uaccess.h for MMU based kernel is
> just asking for trouble.

The one thing I'd like to see is a generic implementation of the outer
bit that implements handling the variable-length arguments, there are
so many ways that people have gotten that wrong in the past, and
it would be nice if architectures only had to implement a set of fixed-size
accessors that contain the architecture specific inline asm.

There is now a new version for x86 that based on asm-goto with
output, which should in theory provide a better implementation
for any architecture when using gcc-11/clang-11 or higher.

> > One noteworthy aspect is that almost nothing users the low-level
> > __get_user()/__put_user() helpers any more outside of architecture
> > specific code, so we may not need to have separate versions
> > for much longer.
>
> Al has been trying to kill them off entirely for a while, and I hope
> he'll eventually succeed.  That being said the difference should be
> that the __ versions just skip the access_ok, so having both is
> fairly trivial to implement.

That is the difference in the interface, but in some of architectures
there is another difference in that the __ version is completely
inlined while the normal version calls an external function.
I could never quite figure out the reason for this difference.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ