[RFC PATCH 17/17] netfs: Combine prepare and issue ops and grab the buffers on request
Paulo Alcantara
pc at manguebit.org
Mon Mar 23 15:44:44 PDT 2026
ChenXiaoSong <chenxiaosong at chenxiaosong.com> 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.
More information about the linux-afs
mailing list