pNFS: Fix use after free issues in pnfs_do_read()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 25 Apr 2017 15:26:53 +0000 (11:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:00:15 +0000 (11:00 +0100)
commitb5e7b5ce7fa21d02b12d4383b003da22e79f91e1
tree549f906ad0294310cf6f70b883b420c9af63a791
parent81fa3239900f7fb378764318d200b5bb9c477cd6
pNFS: Fix use after free issues in pnfs_do_read()

[ Upstream commit 6aeafd05eca9bc8ab6b03d7e56d09ffd18190f44 ]

The assumption should be that if the caller returns PNFS_ATTEMPTED, then hdr
has been consumed, and so we should not be testing hdr->task.tk_status.
If the caller returns PNFS_TRY_AGAIN, then we need to recoalesce and
free hdr.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pnfs.c