NFSv4.2: Fix a potential double free with READ_PLUS
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 16 May 2023 15:19:25 +0000 (11:19 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:43:05 +0000 (09:43 +0200)
commit7795634751622709cab9ce4cad2bcd93f871fae3
tree6e94b1d92e049b0648f4c9c093dad0c465e3dad5
parentd9ece8c0269f4efe391bfa1022266bdb78d8cbad
NFSv4.2: Fix a potential double free with READ_PLUS

commit 43439d858bbae244a510de47f9a55f667ca4ed52 upstream.

kfree()-ing the scratch page isn't enough, we also need to set the pointer
back to NULL to avoid a double-free in the case of a resend.

Fixes: fbd2a05f29a9 (NFSv4.2: Rework scratch handling for READ_PLUS)
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c