mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Bridges <icb@fastmail.org>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Tom Talpey <tom@talpey.com>,
	ChenXiaoSong <chenxiaosong@chenxiaosong.com>,
	linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ian Bridges <icb@fastmail.org>
Subject: [PATCH 0/2] ksmbd: fix DACL evaluation for denies and guest sessions
Date: Thu, 29 Oct 2026 21:05:21 -0500	[thread overview]
Message-ID: <20261030020523.302085-1-icb@fastmail.org> (raw)

On an acl_xattr share, smb_check_perm_dacl() has two evaluation errors.
Patch 1 makes every open evaluate the DACL in order. Today a deny ACE
that is the first one matching the caller grants every right it does not
name. Patch 2 stops guest and anonymous sessions from matching
Authenticated Users ACEs.

The two patches belong together. Each one alone moves some guest results
the wrong way through the other error. Patch 1 alone lets a guest gather
rights from Authenticated Users ACEs as it walks the DACL. Patch 2 alone
can leave an Everyone deny as the first ACE a guest matches, and that
deny then grants every right it does not name.

With both applied, every combination of one or two allow or deny ACEs
for the caller, Everyone and Authenticated Users was tested, with
READ_DATA, WRITE_DATA, WRITE_EA, APPEND_DATA or full access as the mask
(930 DACLs). Each DACL also ended with an allow ACE giving the owner
full access. The tests ran as an authenticated user, a guest and an
anonymous session. Compared with the base, every result that changes
agrees with ordered evaluation (MS-DTYP 2.5.3.2) and the definition of
Authenticated Users (MS-DTYP 2.4.2.4), and no result that agreed
changes.

Both patches carry Cc stable and need to be backported in this order.

Ian Bridges (2):
  ksmbd: evaluate the DACL in order for requested access
  ksmbd: exclude guest and anonymous sessions from Authenticated Users
    ACEs

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


base-commit: af8c72f6550744fe948ef2dbc7ab8739c149aab2
-- 
2.47.3


             reply	other threads:[~2026-10-30  2:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30  2:05 Ian Bridges [this message]
2026-10-30  2:05 ` [PATCH 1/2] ksmbd: evaluate the DACL in order for requested access Ian Bridges
2026-10-30  2:05 ` [PATCH 2/2] ksmbd: exclude guest and anonymous sessions from Authenticated Users ACEs 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=20261030020523.302085-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®