vfs_default: Protect vfs_getxattrat_done() from accessing a freed req pointer
authorRalph Boehme <slow@samba.org>
Mon, 9 Mar 2020 10:54:37 +0000 (11:54 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 9 Mar 2020 18:07:34 +0000 (18:07 +0000)
commit95cfcda13fe9a70b9955a7c44173d619eacb34c1
tree134fdadd7966a0f7f8cc1f8c846ca27940aead1b
parent0e894f3e48285415f72cf7a68e26f1802fe8045d
vfs_default: Protect vfs_getxattrat_done() from accessing a freed req pointer

If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the request is in
flight (share forced closed by smbcontrol), then we set state->req = NULL in the
state destructor.

The existing state destructor prevents the state memory from being freed, so
when the thread completes and calls vfs_getxattrat_done(), just throw away the result
if state->req == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_default.c