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:   Fri, 10 Sep 2021 13:10:47 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     Al Viro <viro@...iv.linux.org.uk>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     Pavel Begunkov <asml.silence@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [git pull] iov_iter fixes

On 9/10/21 12:48 PM, Al Viro wrote:
> On Fri, Sep 10, 2021 at 10:31:00AM -0700, Linus Torvalds wrote:
>> On Fri, Sep 10, 2021 at 10:26 AM Jens Axboe <axboe@...nel.dk> wrote:
>>>
>>> On 9/10/21 10:58 AM, Linus Torvalds wrote:
>>>> On Fri, Sep 10, 2021 at 9:56 AM Al Viro <viro@...iv.linux.org.uk> wrote:
>>>>>
>>>>> What's the point of all those contortions, anyway?  You only need it for
>>>>> iovec case; don't mix doing that and turning it into flavour-independent
>>>>> primitive.
>>>>
>>>> Good point, making it specific to iovec only gets rid of a lot of
>>>> special cases and worries.
>>>>
>>>> This is fairly specialized, no need to always cater to every possible case.
>>>
>>> Alright, split into three patches:
>>>
>>> https://git.kernel.dk/cgit/linux-block/log/?h=iov_iter
>>
>> That looks sane to me.
>>
>> Please add some comment about how that
>>
>>         i->iov -= state->nr_segs - i->nr_segs;
>>
>> actually is the right thing for all the three cases (iow how 'iov',
>> 'kvec' and 'bvec' all end up having a union member that acts the same
>> way).
>>
>> But yeah, I like how the io_uring.c code looks better this way too.
>>
>> Al, what do you think?
> 
> I think that sizeof(struct bio_vec) != sizeof(struct iovec):
> struct bio_vec {
>         struct page     *bv_page;
> 	unsigned int    bv_len;
> 	unsigned int    bv_offset;
> };
> takes 3 words on 32bit boxen.
> struct iovec
> {
>         void __user *iov_base;  /* BSD uses caddr_t (1003.1g requires void *) */
> 	__kernel_size_t iov_len; /* Must be size_t (1003.1g) */
> };
> takes 2 words on 32bit boxen.

Ouch yes. I guess we do have to special case BVEC for now, as I do actually
need that one internally. I'll add a BUILD_BUG_ON() for the other one while
at it.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ