From: Paulo Alcantara <pc@manguebit.org>
To: Dominik Maier <dmnk@google.com>, Steve French <sfrench@samba.org>,
Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org, dmnk+artist@google.com,
Dominik Maier <dmnk@google.com>
Subject: Re: [PATCH] smb: client: fix slab-out-of-bounds write in id_mode_to_cifs_acl()
Date: Fri, 23 Oct 2026 22:10:29 -0300 [thread overview]
Message-ID: <b71198e85e4498dc27853062529daff3@manguebit.org> (raw)
In-Reply-To: <20261022232116.2536320-1-dmnk@google.com>
Dominik Maier <dmnk@google.com> writes:
> In id_mode_to_cifs_acl(), while the chown branch reserves
> sizeof(struct smb_ntsd) + 2 * sizeof(struct smb_sid) (plus
> sizeof(struct smb_acl) and the worst-case ACE space after
> commit 0ee150794c75 ("smb: client: fix heap overflow in DACL owner/group
> rewrite")), the chmod branch only adds 2 * sizeof(struct smb_ace) or
> 5 * sizeof(struct smb_ace) to secdesclen (or 1 * sizeof(struct smb_ace)
> on posix).
>
> However, the chmod branch also invokes build_sec_desc() ->
> copy_sec_desc(), which unconditionally writes the Owner SID at
> pnntsd + sidsoffset and the Group SID at
> pnntsd + sidsoffset + sizeof(struct smb_sid) (2 * 68 = 136 bytes total),
> and set_chmod_dacl() always writes a struct smb_acl header (8 bytes)
> even when the source descriptor has dacloffset == 0. When a security
> descriptor has compact or overlapping Owner/Group SIDs (or
> dacloffset == 0), calling chmod() under-allocates pnntsd and writes past
> the end of the slab buffer.
>
> Reserve sizeof(struct smb_acl) + 2 * sizeof(struct smb_sid) (plus
> sizeof(struct smb_ntsd) on the posix path) in the chmod branch of
> id_mode_to_cifs_acl().
> ...
Applied.
prev parent reply other threads:[~2026-10-24 1:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 23:21 [PATCH] smb: client: fix slab-out-of-bounds write in id_mode_to_cifs_acl() Dominik Maier
2026-10-24 1:10 ` Paulo Alcantara [this message]
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=b71198e85e4498dc27853062529daff3@manguebit.org \
--to=pc@manguebit.org \
--cc=dmnk+artist@google.com \
--cc=dmnk@google.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=sfrench@samba.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.