Linux-CIFS Archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@kernel.org>
To: Qianchang Zhao <pioooooooooip@gmail.com>
Cc: Steve French <smfrench@gmail.com>,
	gregkh@linuxfoundation.org,  linux-cifs@vger.kernel.org,
	linux-kernel@vger.kernel.org, security@kernel.org,
	 Zhitong Liu <liuzhitong1993@gmail.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] ksmbd: vfs: skip lock-range check on equal size to avoid size==0 underflow
Date: Sun, 9 Nov 2025 10:32:37 +0900	[thread overview]
Message-ID: <CAKYAXd-SSBbW+FhC7mHYEh1JLFRVNyNOLiogbj=Nt1eszxf2vw@mail.gmail.com> (raw)
In-Reply-To: <20251108155712.384021-1-pioooooooooip@gmail.com>

On Sun, Nov 9, 2025 at 12:57 AM Qianchang Zhao <pioooooooooip@gmail.com> wrote:
>
> When size equals the current i_size (including 0), the code used to call
> check_lock_range(filp, i_size, size - 1, WRITE), which computes `size - 1`
> and can underflow for size==0. Skip the equal case.
>
> Reported-by: Qianchang Zhao <pioooooooooip@gmail.com>
> Reported-by: Zhitong Liu <liuzhitong1993@gmail.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Qianchang Zhao <pioooooooooip@gmail.com>
Applied it to #ksmbd-for-next-next.
Thanks!

  reply	other threads:[~2025-11-09  1:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2025110803-retrace-unnatural-127f@gregkh>
2025-11-08 12:36 ` [PATCH] ksmbd: vfs: fix truncate lock-range check for shrink/grow and avoid size==0 underflow Qianchang Zhao
2025-11-08 14:46   ` Namjae Jeon
2025-11-08 15:57     ` [PATCH v2] ksmbd: vfs: skip lock-range check on equal size to " Qianchang Zhao
2025-11-09  1:32       ` Namjae Jeon [this message]
2025-11-08 16:00     ` [PATCH] ksmbd: vfs: fix truncate lock-range check for shrink/grow and " くさあさ

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='CAKYAXd-SSBbW+FhC7mHYEh1JLFRVNyNOLiogbj=Nt1eszxf2vw@mail.gmail.com' \
    --to=linkinjeon@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuzhitong1993@gmail.com \
    --cc=pioooooooooip@gmail.com \
    --cc=security@kernel.org \
    --cc=smfrench@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).