From: Ian Bridges <icb@fastmail.org>
To: linkinjeon@kernel.org
Cc: senozhatsky@chromium.org, tom@talpey.com,
chenxiaosong@chenxiaosong.com, linux-cifs@vger.kernel.org,
linux-kernel@vger.kernel.org, Ian Bridges <icb@fastmail.org>,
stable@vger.kernel.org
Subject: [PATCH] ksmbd: clear DACL_PRESENT when the query omits the DACL
Date: Wed, 18 Nov 2026 11:40:00 -0600 [thread overview]
Message-ID: <20261118174000.76954-1-icb@fastmail.org> (raw)
build_sec_desc() starts the Control of a security query reply from
SELF_RELATIVE and ORs in the Control of the stored descriptor. A stored
descriptor with a DACL has DACL_PRESENT. When the client asks only for
the owner or the group, the reply then has DACL_PRESENT set and no
DACL. A client reads DACL_PRESENT with a zero DACL offset as a NULL
DACL, not as a DACL that was left out of the reply. The server's own
access checks are not affected.
Do not take DACL_PRESENT from the stored descriptor. build_sec_desc()
already sets it when the DACL is requested.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
---
Tested on ksmbd-for-next 267029b35ad1 with KASAN. On a file with a
stored descriptor, a query for the owner, the group or both now returns
Control 0x8000 instead of 0x8004. Replies for the other tested
AdditionalInformation values are unchanged. smbtorture results match
the base.
This patch was developed with LLM assistance.
fs/smb/server/smbacl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c
index a87c22fa9a6e..5bd0c7eab515 100644
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -1077,8 +1077,9 @@ int build_sec_desc(const struct mnt_idmap *idmap,
pntsd->sacloffset = 0;
pntsd->revision = cpu_to_le16(1);
pntsd->type = cpu_to_le16(SELF_RELATIVE);
+ /* DACL_PRESENT is set below when the DACL is requested */
if (ppntsd)
- pntsd->type |= ppntsd->type;
+ pntsd->type |= ppntsd->type & ~cpu_to_le16(DACL_PRESENT);
if (addition_info & OWNER_SECINFO) {
pntsd->osidoffset = cpu_to_le32(offset);
--
2.47.3
reply other threads:[~2026-11-18 17:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261118174000.76954-1-icb@fastmail.org \
--to=icb@fastmail.org \
--cc=chenxiaosong@chenxiaosong.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=senozhatsky@chromium.org \
--cc=stable@vger.kernel.org \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®