linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Ahmet Eray Karadag <eraykrdg1@gmail.com>,
	tytso@mit.edu, adilger.kernel@dilger.ca,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzbot+0be4f339a8218d2a5bb1@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] Fix: ext4: guard against EA inode refcount underflow in xattr update
Date: Wed, 24 Sep 2025 18:53:46 -0400	[thread overview]
Message-ID: <aNR2erc6QYubynYK@arch-box> (raw)
In-Reply-To: <20250923233934.GJ8084@frogsfrogsfrogs>

Hi Darrick, Ted,

Thanks a lot for taking the time to review this patch and for the helpful
suggestions. 

> /me wonders if you could use check_add_overflow for this, but otherwise
> everthing looks fine to me...
We looked at check_add_overflow() and check_sub_overflow(), but our
understanding is that they are mainly useful if ref_change can vary beyond the
current ±1. Since the call site appear to only pass increments or decrements
of one, would you prefer we still use the helpers for defensive hardening, or
is it acceptable to rely on explicit 0 / U64_MAX boundary checks in this case?

> ...though while you're modifying the precondition checking here, I think
> these i_nlink preconditions should also be hoisted to the top and cause
> an EFSCORRUPTED return on bad inputs.
Thanks for pointing this out. We will include this in V3.

Cheers,
	Albin

  reply	other threads:[~2025-09-24 22:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 17:55 [PATCH] Fix: ext4: guard against EA inode refcount underflow in xattr update Ahmet Eray Karadag
2025-09-18 18:18 ` Darrick J. Wong
2025-09-19 14:45   ` Theodore Ts'o
2025-09-20  2:13 ` [PATCH v2] " Ahmet Eray Karadag
2025-09-23 23:39   ` Darrick J. Wong
2025-09-24 22:53     ` Albin Babu Varghese [this message]
2025-09-26 21:47   ` Theodore Ts'o

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=aNR2erc6QYubynYK@arch-box \
    --to=albinbabuvarghese20@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=djwong@kernel.org \
    --cc=eraykrdg1@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+0be4f339a8218d2a5bb1@syzkaller.appspotmail.com \
    --cc=tytso@mit.edu \
    /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 NNTP newsgroup(s).