From: Namjae Jeon <linkinjeon@kernel.org>
To: DaeMyung Kang <charsyam@gmail.com>
Cc: Steve French <smfrench@gmail.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Tom Talpey <tom@talpey.com>,
linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ksmbd: fix CreateOptions sanitization clobbering the whole field
Date: Tue, 21 Apr 2026 10:39:55 +0900 [thread overview]
Message-ID: <CAKYAXd9c-CSqtXzgTn6davHNbLo4Y4ipma=5EHsZ5Wb72uEMEw@mail.gmail.com> (raw)
In-Reply-To: <20260420175125.3341090-1-charsyam@gmail.com>
On Tue, Apr 21, 2026 at 2:51 AM DaeMyung Kang <charsyam@gmail.com> wrote:
>
> smb2_open() attempts to clear conflicting CreateOptions bits
> (FILE_SEQUENTIAL_ONLY_LE together with FILE_RANDOM_ACCESS_LE, and
> FILE_NO_COMPRESSION_LE on a directory open), but uses a plain
> assignment of the bitwise negation of the target flag:
>
> req->CreateOptions = ~(FILE_SEQUENTIAL_ONLY_LE);
> req->CreateOptions = ~(FILE_NO_COMPRESSION_LE);
>
> This replaces the entire field with 0xFFFFFFFB / 0xFFFFFFEF rather
> than clearing a single bit. With the SEQUENTIAL/RANDOM case, the
> next check for FILE_OPEN_BY_FILE_ID_LE | CREATE_TREE_CONNECTION |
> FILE_RESERVE_OPFILTER_LE then trivially matches and a legitimate
> request is rejected with -EOPNOTSUPP. With the NO_COMPRESSION case,
> every downstream test (FILE_DELETE_ON_CLOSE, etc.) operates on a
> corrupted CreateOptions value.
>
> Use &= ~FLAG to clear only the intended bit in both places.
Applied it to #ksmbd-for-next-next.
Note that I have added the missing signed-off-by tag and let me know
if there is 1/2 patch.
Thanks!
prev parent reply other threads:[~2026-04-21 1:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 17:51 [PATCH 2/2] ksmbd: fix CreateOptions sanitization clobbering the whole field DaeMyung Kang
2026-04-21 1:39 ` Namjae Jeon [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='CAKYAXd9c-CSqtXzgTn6davHNbLo4Y4ipma=5EHsZ5Wb72uEMEw@mail.gmail.com' \
--to=linkinjeon@kernel.org \
--cc=charsyam@gmail.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=senozhatsky@chromium.org \
--cc=smfrench@gmail.com \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).