From: Ralph Boehme Date: Sun, 28 Oct 2018 18:35:59 +0000 (+0100) Subject: s3:smbd: fix SMB2 aio cancelling X-Git-Tag: samba-4.8.8~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d365e6d9bb495773e263562e4e441a4ce8dfe852;p=thirdparty%2Fsamba.git s3:smbd: fix SMB2 aio cancelling As we currently don't attempt to cancel the internal aio request, we must ignore the SMB2 cancel request and continue to process the SMB2 request, cf MS-SM2 3.3.5.16: If the target request is not successfully canceled, processing of the target request MUST continue and no response is sent to the cancel request. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13667 Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke Reviewed-by: Jeremy Allison (cherry picked from commit 07eb805cde4db6ac74740e3cfbc56ab6f8e2118a) --- diff --git a/selftest/knownfail.d/samba3.smb2 b/selftest/knownfail.d/samba3.smb2 deleted file mode 100644 index f4e2ecf3da4..00000000000 --- a/selftest/knownfail.d/samba3.smb2 +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.aio_delay.aio_cancel\(nt4_dc\) diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c index 4fc1132be87..a7540ed7b91 100644 --- a/source3/smbd/aio.c +++ b/source3/smbd/aio.c @@ -645,12 +645,16 @@ bool cancel_smb2_aio(struct smb_request *smbreq) } /* - * We let the aio request run. Setting fsp to NULL has the - * effect that the _done routines don't send anything out. + * We let the aio request run and don't try to cancel it which means + * processing of the SMB2 request must continue as normal, cf MS-SMB2 + * 3.3.5.16: + * + * If the target request is not successfully canceled, processing of + * the target request MUST continue and no response is sent to the + * cancel request. */ - aio_ex->fsp = NULL; - return true; + return false; } static void aio_pread_smb2_done(struct tevent_req *req);