Accepted mainline fixe148e567a925fs/smb/serverReported-by · Linux 7.2

Proof/Linux kernel/ksmbd: preserve VFS POSIX ACL mask

KERNEL.02 — Mainline contribution

The VFS computed the ACL. KSMBD overwrote it.

The VFS had already derived the child’s access and default ACLs from the parent ACL and the requested mode. KSMBD then reloaded the parent ACL, forced ACL_MASK to full rwx, and installed that instead.

Commite148e567a925
Subsystemfs/smb/server
Filevfs.c
RoleReported-by
Patch authorNamjae Jeon
Signed into treeSteve French
First tagv7.2-rc5
MainlineLinux 7.2
KSMBD must preserve the child ACL and effective mask produced by the VFS. It must not reload the parent ACL after creation and broaden the result.
Class
incorrect permission assignment
Trigger
SMB object creation
Control
equivalent local creation
Outcome
cross-principal access widening
Upstream credit.Charles Vosburgh reported this issue; Namjae Jeon authored the accepted patch and Steve French signed it into the SMB tree. That distinction is preserved throughout. No executable private harness or raw lab evidence is published.

POSIX ACLs express permissions for named users and groups in addition to the traditional owner, group and other mode bits. The ACL_MASK entry is the effective permission ceiling applied to named-user, named-group and owning-group entries.

A recorded entry, suppressed by the maskPOSIX ACL
user:someuser:rwx
mask::---

The VFS inheritance path takes the parent’s default ACL and the requested file mode into account when constructing a new child. That result is the security answer downstream code should preserve.

KSMBD must preserve the child ACL and effective mask produced by the VFS; it must not reload the parent ACL after creation and broaden the result.

The problem is not that KSMBD handled ACLs at all. It is that this happened after the VFS had already performed inheritance and mode-based normalization — discarding the VFS-computed effective mask and replacing it with a broader one.

Before the accepted patch, ksmbd_vfs_inherit_posix_acl() obtained the parent default ACL and modified its mask entry:

Vulnerable helperfs/smb/server/vfs.c
acls = get_inode_acl(parent_inode, ACL_TYPE_DEFAULT);
if (IS_ERR_OR_NULL(acls))
	return -ENOENT;
pace = acls->a_entries;

for (i = 0; i < acls->a_count; i++, pace++) {
	if (pace->e_tag == ACL_MASK) {
		pace->e_perm = 0x07;
		break;
	}
}

0x07 is full rwx. The helper then installed that ACL on the child as its access ACL and, for directories, as its default ACL:

Installing the widened ACLfs/smb/server/vfs.c
rc = set_posix_acl(idmap, dentry, ACL_TYPE_ACCESS, acls);

if (S_ISDIR(inode->i_mode))
	rc = set_posix_acl(idmap, dentry, ACL_TYPE_DEFAULT, acls);

The bounded research scenario uses two distinct authenticated principals: a creator allowed to create a child through the SMB share, and another named principal whose ACL entry exists but is intentionally suppressed by a restrictive mask.

01 · Policy

Restrictive parent ACL

A named entry records rwx; the mask suppresses it.

02 · Create

SMB path

The VFS computes the correct child ACL first.

03 · Rewrite

Mask forced to rwx

KSMBD reloads the parent ACL and installs a broader result.

04 · Propagate

Directory defaults

For directories, the widened ACL can flow into later descendants.

With ordinary local/VFS creation under the equivalent parent ACL, the restrictive mask stays effective and the second principal is denied. With the vulnerable KSMBD rewrite, the child ACL can instead acquire mask::rwx, activating permissions that were recorded but ineffective.

The original research used an owned disposable Linux/KSMBD environment and compared local creation with SMB creation under the same restrictive default ACL.

Local control

VFS creation

An object created locally beneath the parent keeps the named principal restricted by the inherited mask.

SMB path

KSMBD creation

The equivalent object’s access ACL shows the widened effective mask.

Separate principal

Access divergence

The local control remains denied while the SMB-created object becomes readable or writable.

SETUP parent default ACL: user:principal-B:rwx mask::--- LOCAL create child via VFS → principal-B denied SMB create child via KSMBD → child ACL shows mask::rwx SMB principal-B read/write on new object: granted DIR widened ACL installed as directory default → descendants inherit POST-PATCH VFS-computed child ACL preserved
Stated limits. The validated scope is narrow: permission widening for affected newly created objects and their descendants. It is not evidence of arbitrary path access outside the share, access to unrelated pre-existing objects, kernel memory corruption, command execution, UID escalation, or universal impact on KSMBD deployments without the relevant ACL configuration.
BoundaryResult
Administrator policyParent default POSIX ACL with restrictive mask
Trusted kernel resultVFS-computed child access/default ACL
KSMBD errorPost-create parent ACL reload plus forced ACL_MASK = rwx
ConsequenceEffective permissions on new SMB-created objects can exceed intent
This is a post-processing bug: the initial security mechanism works, and a later subsystem helper overwrites the correct result.
From finding to accepted patch

Compare the two creation paths, not the code alone.

An ACL helper reads plausibly in isolation. The finding only becomes concrete when the same parent directory produces one permission result locally and a different one over SMB.

SK.01

Source mapping

Locate every point where KSMBD touches ACL state after the VFS has created the inode.

SK.02

Ordering hypothesis

Ask whether a second inheritance pass can contradict a completed VFS decision.

SK.03

Differential construction

Create equivalent objects locally and through SMB under one restrictive parent ACL.

SK.04

Skeptic gate

Use a genuinely separate principal, and hold the claim to newly created objects and descendants.

HUMAN

Report and upstream review

Report to the KSMBD maintainers; credit patch authorship where it belongs.

Mainline commit e148e567a925 removes the mask mutation and the subsequent set_posix_acl() calls:

Accepted upstream changefs/smb/server/vfs.c
-	pace = acls->a_entries;
-
-	for (i = 0; i < acls->a_count; i++, pace++) {
-		if (pace->e_tag == ACL_MASK) {
-			pace->e_perm = 0x07;
-			break;
-		}
-	}
-
-	rc = set_posix_acl(idmap, dentry, ACL_TYPE_ACCESS, acls);
-	...
+	posix_acl_release(acls);
+	return 0;

The fixed helper still detects whether the parent has a default ACL, but no longer re-applies or broadens that ACL after the VFS creation path has done the correct inheritance work.

Upstream commit messagepublic trailers
The VFS initializes a child's POSIX ACL from the parent's default ACL and
the requested creation mode. Do not mutate the parent ACL or overwrite the
child's VFS-computed access and default ACLs afterwards.

This preserves restrictive ACL_MASK entries and prevents SMB object creation
from widening effective permissions.

Reported-by: Charles Vosburgh <trilobyte777@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

The accepted commit fixes pre-existing behaviour but does not publish a complete affected-version range, and this page does not invent one.

TagFix presentBasis
Linux 7.1.3nooriginal validation reproduced the behaviour here
v7.2-rc4nopublic tag containment check
v7.2-rc5yesfirst verified mainline tag containing the fix
Linux 7.2yesfinal mainline release

The exact introducing commit was not independently established during the bounded review. The upstream commit assigns no CVE or CVSS score, so none is asserted here.

A strong KSMBD regression test should:

  1. configure a parent directory with a restrictive default ACL mask and a named principal;
  2. create equivalent children locally and through SMB;
  3. compare the resulting ACLs and effective permissions;
  4. test both files and directories;
  5. test a descendant beneath an SMB-created directory; and
  6. verify that KSMBD does not mutate the parent cached or on-disk ACL as part of child creation.
The ACL attached to a new inode after VFS creation is authoritative unless a later operation has explicit, policy-backed reason to change it.
JULY 2026
Issue reported by Charles Vosburgh to the KSMBD maintainers.
2026-07-17
Fix authored by Namjae Jeon.
2026-07-22
Commit e148e567a925 recorded in upstream history.
LINUX 7.2-rc5
First verified mainline tag containing the fix.
LINUX 7.2
Final mainline release containing the accepted change.
  1. Linux mainline commit e148e567a925
  2. git.kernel.org commit view

Credit: Reported by Charles Vosburgh, credited upstream through the accepted commit’s Reported-by trailer. The accepted patch was authored by Namjae Jeon and signed into the SMB tree by Steve French. This page preserves that distinction rather than presenting reporting credit as patch authorship.