s3: VFS: vfs_glusterfs. Protect vfs_gluster_pwrite_done() from accessing a freed...
authorJeremy Allison <jra@samba.org>
Fri, 28 Feb 2020 23:55:36 +0000 (15:55 -0800)
committerJeremy Allison <jra@samba.org>
Sun, 8 Mar 2020 18:07:44 +0000 (18:07 +0000)
commit67910c751c9f5ce8cdd1e57b34e51e5b7163838b
tree449c2010c3ec2c1ad3e27efa03b5e6aa8b631587
parent3357a77d0823eddc1b0db68cfa251a0d54058c88
s3: VFS: vfs_glusterfs. Protect vfs_gluster_pwrite_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_pwrite_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