s3: VFS: vfs_glusterfs. Protect vfs_gluster_pread_done() from accessing a freed req...
authorJeremy Allison <jra@samba.org>
Fri, 28 Feb 2020 23:38:04 +0000 (15:38 -0800)
committerJeremy Allison <jra@samba.org>
Sun, 8 Mar 2020 18:07:44 +0000 (18:07 +0000)
commit99283871c5230e640a8102943ebed685459ed9af
treee986b04598b7b626777ef6d619440e5ff8d36eb5
parentc6c4e2de22cd3d84f45f5c21e6b09b09274f7f7b
s3: VFS: vfs_glusterfs. Protect vfs_gluster_pread_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_gluster_pread_done(), just throw away the result if
state->req == NULL.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/modules/vfs_glusterfs.c