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:   Sun, 6 Jun 2021 15:46:37 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Al Viro <viro@...iv.linux.org.uk>
Cc:     linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        David Sterba <dsterba@...e.com>,
        Miklos Szeredi <miklos@...redi.hu>,
        Anton Altaparmakov <anton@...era.com>,
        David Howells <dhowells@...hat.com>,
        Matthew Wilcox <willy@...radead.org>,
        Pavel Begunkov <asml.silence@...il.com>
Subject: Re: [RFC][PATCHSET] iov_iter work

On Sun, Jun 6, 2021 at 3:05 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> So I think iov_iter_init() would actually be better off just being
>
>         *i = (struct iov_iter) {
>                 .iter_type = uaccess_kernel() ? ITER_KVEC : ITER_IOVEC,
>                 .data_source = direction,
>                 .iov = iov,
>                 .nr_segs = nr_segs,
>                 .iov_offset = 0,
>                 .count = count
>         };
>
> with possibly a big comment about that ".opv = iov" thing being a
> union member assignment, and being either a iovec or a kvec.

I don't know what kind of mini-stroke I had, but ".opv" is obviously
supposed to be ".iov". Fingers just off by a small amount.

And yes, I realize that 'uaccess_kernel()' is hopefully always false
on any architectures we care about and so the compiler would just pick
one at compile time rather than actually having both those
initializers.

But I think that "the uaccess_kernel() KVEC case is legacy for
architectures that haven't converted to the new world order yet" thing
is just even more of an argument for not duplicating and writing the
code out in full on a source level (and making that normal case be
".iov = iov").

               Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ