Re: [RFC PATCH 17/17] netfs: Combine prepare and issue ops and grab the buffers on request

Paulo Alcantara <[email protected]>
Newsgroups dev.linux.lists.v9fs,dev.linux.lists.netfs,org.kernel.vger.ceph-devel,org.kernel.vger.linux-cifs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs
Message-ID <[email protected]>
ChenXiaoSong <[email protected]> writes:

> --- a/fs/netfs/direct_write.c
> +++ b/fs/netfs/direct_write.c
> @@ -161,8 +161,8 @@ static int netfs_unbuffered_write(struct 
> netfs_io_request *wreq)
>                                          break;
>                                  }
>                                  netfs_put_subrequest(subreq, 
> netfs_sreq_trace_put_failed);
> -                               subreq = NULL;
>                                  ret = subreq->error;
> +                               subreq = NULL;
>                                  goto failed;

Thanks for the review.  The above is still broken as it wolud cause an
UAF on @subreq as we're putting it with netfs_put_subrequest() and then
dereferencing it afterwards.

Besides, we could also get rid of 'subreq = NULL' as it is currently a
no-op -- including in other places.

Let's wait for next patchset from Dave, though.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.