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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 21 Sep 2020 15:14:56 +0100
From:   Christoph Hellwig <hch@...radead.org>
To:     David Laight <David.Laight@...lab.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "io-uring@...r.kernel.org" <io-uring@...r.kernel.org>,
        Jens Axboe <axboe@...nel.dk>,
        "David S. Miller" <davem@...emloft.net>,
        Al Viro <viro@...iv.linux.org.uk>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 4/9 next] fs/io_uring Don't use the return value from
 import_iovec().

On Tue, Sep 15, 2020 at 02:55:20PM +0000, David Laight wrote:
> 
> This is the only code that relies on import_iovec() returning
> iter.count on success.
> This allows a better interface to import_iovec().

This looks generall sane, but a comment below:

> @@ -3123,7 +3123,7 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
>  	if (ret < 0)
>  		return ret;
>  	iov_count = iov_iter_count(iter);
> -	io_size = ret;
> +	io_size = iov_count;
>  	req->result = io_size;
>  	ret = 0;
>  
> @@ -3246,7 +3246,7 @@ static int io_write(struct io_kiocb *req, bool force_nonblock,
>  	if (ret < 0)
>  		return ret;
>  	iov_count = iov_iter_count(iter);
> -	io_size = ret;
> +	io_size = iov_count;
>  	req->result = io_size;

I tink the local iov_count variable can go away in both functions,
as io_size only changes after the last use of iov_count (io_read) or
not at all (io_write).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ