Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: aalbersh@kernel.org, linux-xfs@vger.kernel.org, hch@lst.de
Subject: Re: [PATCH 3/6] mkfs: fix symlink target length check in create_nondir_inode
Date: Tue, 30 Jun 2026 07:34:40 +0200	[thread overview]
Message-ID: <20260630053440.GC21007@lst.de> (raw)
In-Reply-To: <178278129861.858323.4909937638621779858.stgit@frogsfrogsfrogs>

On Mon, Jun 29, 2026 at 06:03:26PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Codex complains about the way this function tries to detect symlink
> targets that are so long that the new filesystem cannot handle them.
> Specifically, it complains about the confusion between
> XFS_SYMLINK_MAXLEN and PATH_MAX.
> 
> To be clear, XFS cannot handle targets longer than XFS_SYMLINK_MAXLEN
> bytes.  PATH_MAX is irrelevant here.  The manpage for readlink(3) says
> that it returns the number of bytes copied into the buffer and does not
> say that it null-terminates the buffer.  Therefore, the only way to
> detect the overflow condition is to declare a buffer larger than
> XFS_SYMLINK_MAXLEN and see if readink returns a value greater than
> XFS_SYMLINK_MAXLEN.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


  reply	other threads:[~2026-06-30  5:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  1:02 [PATCHSET 2/4] mkfs.xfs: codex-inspired bug fixes Darrick J. Wong
2026-06-30  1:02 ` [PATCH 1/6] mkfs: don't redefine DIRT for protofiles Darrick J. Wong
2026-06-30  5:31   ` Christoph Hellwig
2026-06-30  1:03 ` [PATCH 2/6] mkfs: fix PATH_MAX check Darrick J. Wong
2026-06-30  5:31   ` Christoph Hellwig
2026-06-30  1:03 ` [PATCH 3/6] mkfs: fix symlink target length check in create_nondir_inode Darrick J. Wong
2026-06-30  5:34   ` Christoph Hellwig [this message]
2026-06-30  1:03 ` [PATCH 4/6] mkfs: fix hardlink detection in directory import code Darrick J. Wong
2026-06-30  5:38   ` Christoph Hellwig
2026-06-30 16:28     ` Darrick J. Wong
2026-06-30  1:03 ` [PATCH 5/6] mkfs: PQUOTA shouldn't conflict with GQNOENFORCE Darrick J. Wong
2026-06-30  5:41   ` Christoph Hellwig
2026-06-30 16:27     ` Darrick J. Wong
2026-06-30  1:04 ` [PATCH 6/6] xfs_protofile: make nondirectory arguments actually work Darrick J. Wong
2026-06-30  5:45   ` Christoph Hellwig

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=20260630053440.GC21007@lst.de \
    --to=hch@lst.de \
    --cc=aalbersh@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@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