]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: add parent pointer validator functions
authorAllison Henderson <allison.henderson@oracle.com>
Mon, 29 Jul 2024 23:22:47 +0000 (16:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:02 +0000 (17:01 -0700)
commit564c22ccb55a0d9ab7572ebf544c862fe2208fdd
tree5a442b5dbb91597831ec08e5f2de8d4c0148e193
parent8038116e1f7dd405103d2c01c39b28dfd11ced8e
xfs: add parent pointer validator functions

Source kernel commit: a08d6729637428b6ef8c6a5a94d8c6db7b805a44

The attr name of a parent pointer is a string, and the attr value of a
parent pointer is (more or less) a file handle.  So we need to modify
attr_namecheck to verify the parent pointer name, and add a
xfs_parent_valuecheck function to sanitize the handle.  At the same
time, we need to validate attr values during log recovery if the xattr
is really a parent pointer.

Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
[djwong: move functions to xfs_parent.c, adjust for new disk format]
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/Makefile
libxfs/xfs_attr.c
libxfs/xfs_parent.c [new file with mode: 0644]
libxfs/xfs_parent.h [new file with mode: 0644]