Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C135547076; Thu, 17 Sep 2026 18:08:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789668488; cv=none; b=HsIMozO+xjorEoxiH/1zoI2CTg5DILuRGB26IvTgdiAzk/0fI0tXmIWkeow44pu4Xg8mtF8Wi2EGfd4AQY6FOEEMqQGV5vvGDr7lTwOQvHUjfoAKlBIx8tfi6Z4qRRETWo8IpckuS9iPJfiIIS4Mp/b1Mi6vdMQv4JDKAqv0CHc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789668488; c=relaxed/simple; bh=Cep+mCOIYD+bjV/ijBgHw1xc/5Rn+KwEnGO5sUNsimU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kRnse7skUwGblsa6Sw0+ibISD32dIvgcLdcMxV1iEQ/+yBRU7twbAUVYytgeevYelhQ95LXcGuq3xxEy3OJl7bFSyM53JIayTTgx3S4479IerwDwQwI95KiK9TQqJOnTfzLMAs8SMTl/06fEy4ahHX6lcqrTeOvFQ5N1eqwemAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pTYkrPiX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pTYkrPiX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 735201F000FF; Thu, 17 Sep 2026 18:08:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789668487; bh=KRSbK7A5NHcK0mVh8KPSxDYPrnAcAz+d8b2CZb41buw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pTYkrPiXcerk7eNi8dugQVsEN2+jv21DgxhEIRkofSlb44NMUy54W4Sz22jMu5D5s uTYVk/+hDxchBtKO00y6rTJ6QfV9DEbJ70XgXULsxrzrBneULA++UN3dtMCnXNXAsg jLJvavpW1weGVDfkKMweSp/hyZZAUmQSoCbWrsjA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Charles Vosburgh , Namjae Jeon , Steve French , Sasha Levin Subject: [PATCH 6.12 0440/1102] ksmbd: preserve VFS inherited POSIX ACL mask Date: Thu, 17 Sep 2026 16:06:23 +0100 Message-ID: <20260917151550.722304971@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Namjae Jeon [ Upstream commit e148e567a9252643baa125cb65d7ae9c2c6cf68a ] 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 Signed-off-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/smb/server/vfs.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c index 13cb68135d1a1..7785bc10aff11 100644 --- a/fs/smb/server/vfs.c +++ b/fs/smb/server/vfs.c @@ -1965,10 +1965,6 @@ int ksmbd_vfs_inherit_posix_acl(struct mnt_idmap *idmap, struct path *path, struct inode *parent_inode) { struct posix_acl *acls; - struct posix_acl_entry *pace; - struct dentry *dentry = path->dentry; - struct inode *inode = d_inode(dentry); - int rc, i; if (!IS_ENABLED(CONFIG_FS_POSIX_ACL)) return -EOPNOTSUPP; @@ -1976,27 +1972,7 @@ int ksmbd_vfs_inherit_posix_acl(struct mnt_idmap *idmap, 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; - } - } - - rc = set_posix_acl(idmap, dentry, ACL_TYPE_ACCESS, acls); - if (rc < 0) - ksmbd_debug(SMB, "Set posix acl(ACL_TYPE_ACCESS) failed, rc : %d\n", - rc); - if (S_ISDIR(inode->i_mode)) { - rc = set_posix_acl(idmap, dentry, ACL_TYPE_DEFAULT, - acls); - if (rc < 0) - ksmbd_debug(SMB, "Set posix acl(ACL_TYPE_DEFAULT) failed, rc : %d\n", - rc); - } posix_acl_release(acls); - return rc; + return 0; } -- 2.53.0