The Samba-Bugzilla – Attachment 18177 Details for
Bug 15487
smbd crashes if asked to return full information on close of a stream handle with delete on close disposition set.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.19.next, 4.18.next.
0001-s3-smbd-Ignore-fstat-error-on-deleted-stream-in-fd_c.patch (text/plain), 2.13 KB, created by
Jeremy Allison
on 2023-10-27 00:48:20 UTC
(
hide
)
Description:
git-am fix for 4.19.next, 4.18.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2023-10-27 00:48:20 UTC
Size:
2.13 KB
patch
obsolete
>From 9378de69376d9379b88645466ef4863021ea7432 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Wed, 20 Sep 2023 14:21:44 -0700 >Subject: [PATCH] s3: smbd: Ignore fstat() error on deleted stream in > fd_close(). > >In the fd_close() fsp->fsp_flags.fstat_before_close code path. > >If this is a stream and delete-on-close was set, the >backing object (an xattr from streams_xattr) might >already be deleted so fstat() fails with >NT_STATUS_NOT_FOUND. So if fsp refers to a stream we >ignore the error and only bail for normal files where >an fstat() should still work. NB. We cannot use >fsp_is_alternate_stream(fsp) for this as the base_fsp >has already been closed at this point and so the value >fsp_is_alternate_stream() checks for is already NULL. > >Remove knownfail. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=15487 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Volker Lendecke <vl@samba.org> >Autobuild-Date(master): Tue Oct 10 09:39:27 UTC 2023 on atb-devel-224 > >(cherry picked from commit 633a3ee6894cc1d05b44dbe47a278202803d9b21) >--- > source3/smbd/open.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/source3/smbd/open.c b/source3/smbd/open.c >index 93c12e00eb0..3581c4b9173 100644 >--- a/source3/smbd/open.c >+++ b/source3/smbd/open.c >@@ -997,7 +997,20 @@ NTSTATUS fd_close(files_struct *fsp) > if (fsp->fsp_flags.fstat_before_close) { > status = vfs_stat_fsp(fsp); > if (!NT_STATUS_IS_OK(status)) { >- return status; >+ /* >+ * If this is a stream and delete-on-close was set, the >+ * backing object (an xattr from streams_xattr) might >+ * already be deleted so fstat() fails with >+ * NT_STATUS_NOT_FOUND. So if fsp refers to a stream we >+ * ignore the error and only bail for normal files where >+ * an fstat() should still work. NB. We cannot use >+ * fsp_is_alternate_stream(fsp) for this as the base_fsp >+ * has already been closed at this point and so the value >+ * fsp_is_alternate_stream() checks for is already NULL. >+ */ >+ if (fsp->fsp_name->stream_name == NULL) { >+ return status; >+ } > } > } > >-- >2.39.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
slow
:
review+
Actions:
View
Attachments on
bug 15487
: 18177