All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org
Cc: linux-xfs@vger.kernel.org, hch@lst.de
Subject: [PATCH 4/9] xfs: validate attr remote value buffer owners
Date: Mon, 26 Feb 2024 18:27:22 -0800	[thread overview]
Message-ID: <170900013160.938940.3980607749296840778.stgit@frogsfrogsfrogs> (raw)
In-Reply-To: <170900013068.938940.1740993823820687963.stgit@frogsfrogsfrogs>

From: Darrick J. Wong <djwong@kernel.org>

Check the owner field of xattr remote value blocks.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/libxfs/xfs_attr_remote.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
index b8cdd15c4e1af..3dd0b6b0956c0 100644
--- a/fs/xfs/libxfs/xfs_attr_remote.c
+++ b/fs/xfs/libxfs/xfs_attr_remote.c
@@ -280,12 +280,12 @@ xfs_attr_rmtval_copyout(
 	struct xfs_mount	*mp,
 	struct xfs_buf		*bp,
 	struct xfs_inode	*dp,
+	xfs_ino_t		owner,
 	int			*offset,
 	int			*valuelen,
 	uint8_t			**dst)
 {
 	char			*src = bp->b_addr;
-	xfs_ino_t		ino = dp->i_ino;
 	xfs_daddr_t		bno = xfs_buf_daddr(bp);
 	int			len = BBTOB(bp->b_length);
 	int			blksize = mp->m_attr_geo->blksize;
@@ -299,11 +299,11 @@ xfs_attr_rmtval_copyout(
 		byte_cnt = min(*valuelen, byte_cnt);
 
 		if (xfs_has_crc(mp)) {
-			if (xfs_attr3_rmt_hdr_ok(src, ino, *offset,
+			if (xfs_attr3_rmt_hdr_ok(src, owner, *offset,
 						  byte_cnt, bno)) {
 				xfs_alert(mp,
 "remote attribute header mismatch bno/off/len/owner (0x%llx/0x%x/Ox%x/0x%llx)",
-					bno, *offset, byte_cnt, ino);
+					bno, *offset, byte_cnt, owner);
 				xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
 				return -EFSCORRUPTED;
 			}
@@ -427,8 +427,7 @@ xfs_attr_rmtval_get(
 				return error;
 
 			error = xfs_attr_rmtval_copyout(mp, bp, args->dp,
-							&offset, &valuelen,
-							&dst);
+					args->owner, &offset, &valuelen, &dst);
 			xfs_buf_relse(bp);
 			if (error)
 				return error;


  parent reply	other threads:[~2024-02-27  2:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27  2:18 [PATCHSET v29.4 06/13] xfs: set and validate dir/attr block owners Darrick J. Wong
2024-02-27  2:26 ` [PATCH 1/9] xfs: add an explicit owner field to xfs_da_args Darrick J. Wong
2024-02-28 15:54   ` Christoph Hellwig
2024-02-27  2:26 ` [PATCH 2/9] xfs: use the xfs_da_args owner field to set new dir/attr block owner Darrick J. Wong
2024-02-28 15:54   ` Christoph Hellwig
2024-02-27  2:27 ` [PATCH 3/9] xfs: validate attr leaf buffer owners Darrick J. Wong
2024-02-28 15:57   ` Christoph Hellwig
2024-02-28 17:41     ` Darrick J. Wong
2024-02-27  2:27 ` Darrick J. Wong [this message]
2024-02-28 15:57   ` [PATCH 4/9] xfs: validate attr remote value " Christoph Hellwig
2024-02-27  2:27 ` [PATCH 5/9] xfs: validate dabtree node " Darrick J. Wong
2024-02-28 15:58   ` Christoph Hellwig
2024-02-27  2:27 ` [PATCH 6/9] xfs: validate directory leaf " Darrick J. Wong
2024-02-28 15:58   ` Christoph Hellwig
2024-02-27  2:28 ` [PATCH 7/9] xfs: validate explicit directory data " Darrick J. Wong
2024-02-28 15:58   ` Christoph Hellwig
2024-02-27  2:28 ` [PATCH 8/9] xfs: validate explicit directory block " Darrick J. Wong
2024-02-28 15:59   ` Christoph Hellwig
2024-02-27  2:28 ` [PATCH 9/9] xfs: validate explicit directory free block owners Darrick J. Wong
2024-02-28 15:59   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2023-12-31 19:45 [PATCHSET v29.0 21/40] xfsprogs: set and validate dir/attr " Darrick J. Wong
2023-12-31 22:33 ` [PATCH 4/9] xfs: validate attr remote value buffer owners Darrick J. Wong
2023-12-31 19:30 [PATCHSET v29.0 19/28] xfs: set and validate dir/attr block owners Darrick J. Wong
2023-12-31 20:33 ` [PATCH 4/9] xfs: validate attr remote value buffer owners Darrick J. Wong
2023-05-26  0:35 [PATCHSET v25.0 0/9] xfs: set and validate dir/attr block owners Darrick J. Wong
2023-05-26  1:31 ` [PATCH 4/9] xfs: validate attr remote value buffer owners Darrick J. Wong
2022-12-30 22:14 [PATCHSET v24.0 0/9] xfs: set and validate dir/attr block owners Darrick J. Wong
2022-12-30 22:14 ` [PATCH 4/9] xfs: validate attr remote value buffer owners Darrick J. Wong

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=170900013160.938940.3980607749296840778.stgit@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=hch@lst.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.