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: <9b43b9f3a32642e5a6388f3b1c8b114d@AcuMS.aculab.com>
Date: Wed, 24 Jan 2024 12:07:55 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Jens Axboe' <axboe@...nel.dk>, LKML <linux-kernel@...r.kernel.org>
CC: Alexander Viro <viro@...iv.linux.org.uk>, Christian Brauner
	<brauner@...nel.org>
Subject: RE: [PATCH] iov_iter: streamline iovec/bvec alignment iteration

From: Jens Axboe
> Sent: 23 January 2024 19:49
> 
> Rewrite iov_iter_aligned_iovec() and iov_iter_aligned_bvec() to be both
> easier to read, and also significantly more compact in terms of
> generated code. This saves 178 bytes of text on x86-64 for me (with
> clang-18) and 136 bytes on arm64 (with gcc-13).
> 
...
> diff --git a/lib/iov_iter.c b/lib/iov_iter.c
> index e0aa6b440ca5..2fcc47d822e3 100644
> --- a/lib/iov_iter.c
> +++ b/lib/iov_iter.c
> @@ -714,12 +714,11 @@ EXPORT_SYMBOL(iov_iter_discard);
...
> -	for (k = 0; k < i->nr_segs; k++, skip = 0) {
> -		const struct iovec *iov = iter_iov(i) + k;
> +	do {
>  		size_t len = iov->iov_len - skip;

Is i->nr_segs allowed to be zero?
The old code (seemed to) check for zero.
The new version will go horribly wrong.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ