mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>
Subject: [PATCH v3 0/2] ksmbd: fix explicit DACL checks and parent-derived rights
Date: Sun,  8 Nov 2026 12:20:09 -0600	[thread overview]
Message-ID: <20261108182011.1888520-1-icb@fastmail.org> (raw)

smb_check_perm_dacl() mishandles explicit access requests. It can turn a
deny ACE into a grant, ignore earlier deny ACEs, and treat guest and
anonymous sessions as Authenticated Users. This can grant read or write
access that the stored DACL does not grant.

The function also ignores rights granted by the parent directory.
FILE_DELETE_CHILD can grant DELETE on a child, and FILE_LIST_DIRECTORY
can grant FILE_READ_ATTRIBUTES.

Patch 1 evaluates explicit requests in DACL order and excludes guest and
anonymous sessions from Authenticated Users. Patch 2 obtains explicitly
requested DELETE and FILE_READ_ATTRIBUTES rights from the parent DACL.

Patch 2 uses the authentication state added by patch 1. It also restores
parent-derived rights that patch 1 can remove from guests. Backport the
patches in order.

Older stable trees first need commit cc2f133e80eb ("ksmbd: fix maximum
allowed access checks") and the preceding DACL fixes through "ksmbd:
grant a caller what its groups and OWNER RIGHTS ACEs allow".

Changes since v2:
- Patch 1: keep the POSIX ACL fallback from replacing the DACL result
  when an Authenticated Users ACE is present, including for guest and
  anonymous sessions. Namjae found that the fallback could otherwise
  grant access denied by the DACL.
- Rebase onto the current ksmbd-for-next.

Changes since v1:
- Patch 2: let group and OWNER RIGHTS ACEs decide the strict parent
  check before the POSIX ACL fallback. Sashiko's review of v1 found that
  a POSIX ACL entry could otherwise hide a FILE_DELETE_CHILD grant.
- Patch 2: add a comment on which MAXIMUM_ALLOWED requests omit group
  ACEs.

v1: https://lore.kernel.org/linux-cifs/20261107062233.1579198-1-icb@fastmail.org/
v2: https://lore.kernel.org/linux-cifs/20261107231941.1824289-1-icb@fastmail.org/

Both patches were tested with KASAN on ksmbd-for-next 6f42553e493d.
Its fs/smb/server tree is identical to current head 2f14fe2d5895.
smbtorture results are unchanged.

This series was developed with LLM assistance.

Ian Bridges (2):
  ksmbd: evaluate the DACL in order for explicit access requests
  ksmbd: let the parent's DACL grant DELETE and FILE_READ_ATTRIBUTES

 fs/smb/server/mgmt/user_config.h   |   5 ++
 fs/smb/server/smb2pdu.c            |  11 ++-
 fs/smb/server/smbacl.c             | 133 +++++++++++++++++++++++++----
 fs/smb/server/smbacl.h             |   2 +-
 fs/smb/server/tests/smbacl_kunit.c |   4 +-
 5 files changed, 131 insertions(+), 24 deletions(-)


base-commit: 2f14fe2d589583ce649b2bf1b449cc9839abda8b
-- 
2.47.3


             reply	other threads:[~2026-11-08 18:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 18:20 Ian Bridges [this message]
2026-11-08 18:20 ` [PATCH v3 1/2] ksmbd: evaluate the DACL in order for explicit access requests Ian Bridges
2026-11-08 18:20 ` [PATCH v3 2/2] ksmbd: let the parent's DACL grant DELETE and FILE_READ_ATTRIBUTES Ian Bridges

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=20261108182011.1888520-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=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®