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]
Message-ID: <dc7e5dde-9dc0-7d56-48de-777a2e50bca5@nvidia.com>
Date:   Sat, 29 Aug 2020 14:58:45 -0700
From:   John Hubbard <jhubbard@...dia.com>
To:     Christoph Hellwig <hch@...radead.org>
CC:     Andrew Morton <akpm@...ux-foundation.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Ilya Dryomov <idryomov@...il.com>,
        Jens Axboe <axboe@...nel.dk>, <linux-xfs@...r.kernel.org>,
        <linux-fsdevel@...r.kernel.org>, <linux-block@...r.kernel.org>,
        <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/3] iov_iter: introduce iov_iter_pin_user_pages*()
 routines

On 8/29/20 7:58 AM, Christoph Hellwig wrote:
> On Sat, Aug 29, 2020 at 01:08:52AM -0700, John Hubbard wrote:
...
>> @@ -1280,7 +1281,11 @@ static inline ssize_t __pipe_get_pages(struct iov_iter *i,
>>   	maxsize = n;
>>   	n += *start;
>>   	while (n > 0) {
>> -		get_page(*pages++ = pipe->bufs[iter_head & p_mask].page);
>> +		if (use_pup)
>> +			pin_user_page(*pages++ = pipe->bufs[iter_head & p_mask].page);
>> +		else
>> +			get_page(*pages++ = pipe->bufs[iter_head & p_mask].page);
> 
> Maybe this would become a little more readable with a local variable
> and a little more verbosity:
> 
> 		struct page *page = pipe->bufs[iter_head & p_mask].page;
> 
> 		if (use_pup)
> 			pin_user_page(page);
> 		else
> 			get_page(page);
> 
> 		*pages++ = page;
> 

Yes, that is cleaner, I'll change to that, thanks.

thanks,
-- 
John Hubbard
NVIDIA

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ