Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.org>
To: Frank Sorenson <sorenson@redhat.com>, linux-cifs@vger.kernel.org
Cc: linkinjeon@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v4] smb: client: fix heap overflow in cifs_do_set_acl()
Date: Thu, 27 Aug 2026 22:18:48 -0300	[thread overview]
Message-ID: <4d1df965d61b1c091d4c0e90dff0e8e0@manguebit.org> (raw)
In-Reply-To: <20260827021336.82730-1-sorenson@redhat.com>

Frank Sorenson <sorenson@redhat.com> writes:

> cifs_set_acl() validates ACL size using posix_acl_xattr_size():
>
>         4 + (count * 8)  // 4-byte header + 8 bytes per ACE
>
> cifs_do_set_acl() then calls posix_acl_to_cifs() to write the CIFS
> wire format into the same buffer:
>
>         6 + (count * 10)  // 6-byte header + 10 bytes per ACE
>
> An ACL that passes the xattr-based check in cifs_set_acl() can
> overflow the heap when posix_acl_to_cifs() writes the larger CIFS
> format.
>
> Validate the CIFS format size against the remaining buffer space and
> USHRT_MAX before converting--data_count is __u16, so sizes above
> USHRT_MAX truncate the on-wire packet length, causing the server to
> apply a partial ACL.  Replace MaxDataCount = 1000 with
> min(CIFSMaxBufSize, USHRT_MAX).
> ...

Applied.

      reply	other threads:[~2026-08-28  1:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 18:32 [PATCH] smb: client: fix heap overflow in cifs_do_set_acl() from mismatched ACL format sizes Frank Sorenson
2026-08-25 21:43 ` [PATCH v2] smb: client: fix heap overflow in cifs_do_set_acl() Frank Sorenson
2026-08-26  0:03   ` Paulo Alcantara
2026-08-26  1:47     ` Frank Sorenson
2026-08-26 22:52       ` Paulo Alcantara
2026-08-27  2:13         ` [PATCH v4] " Frank Sorenson
2026-08-28  1:18           ` 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=4d1df965d61b1c091d4c0e90dff0e8e0@manguebit.org \
    --to=pc@manguebit.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=sorenson@redhat.com \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox