generic/062: filter setfattr --restore symlink-safety warning
PATCH 1/1 generic/062: filter setfattr --restore symlink-safety warning
From: Avinesh Kumar <[email protected]>
attr 2.6.0 (CVE-2026-54371 fix)[0] makes "setfattr --restore" warn when used without -P and the dump contains a symlink, which generic/062 does. The warning leaks into the compared output via the setfattr() wrapper and fails the test. Adding -P isn't portable (older attr doesn't have it), so filter the warning in the wrapper instead.
--- tests/generic/062 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tests/generic/062 +7 -1
@@ -30,7 +30,13 @@ getfattr() setfattr() { - $SETFATTR_PROG $@ 2>&1 | _filter_scratch + # attr >= 2.6.0 (CVE-2026-54371 fix) warns that "setfattr --restore" without + # -P/--physical is unsafe because it can traverse symlinks. Older attr does + # not accept -P, so just filter the warning to stay version-agnostic. + $SETFATTR_PROG $@ 2>&1 | \ + sed -e '/^setfattr: .*--restore.* is unsafe without option/d' \ + -e '/^Warning: option --restore=.* is unsafe without option/d' | \ + _filter_scratch } _create_test_bed()
Signature · 1 line
2.54.0
PATCH v2 1/1 generic/062: filter setfattr --restore symlink-safety warning
From: Avinesh Kumar <[email protected]>
attr 2.6.0 (CVE-2026-54371 fix)[0] makes "setfattr --restore" warn when used without -P and the dump contains a symlink, which generic/062 does. The warning leaks into the compared output via the setfattr() wrapper and fails the test. Adding -P isn't portable (older attr doesn't have it), so filter the warning in the wrapper instead.
--- tests/generic/062 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tests/generic/062 +6 -1
@@ -30,7 +30,12 @@ getfattr() setfattr() { - $SETFATTR_PROG $@ 2>&1 | _filter_scratch + # attr >= 2.6.0 (CVE-2026-54371 fix) warns that "setfattr --restore" without + # -P/--physical is unsafe because it can traverse symlinks. Older attr does + # not accept -P, so just filter the warning to stay version-agnostic. + $SETFATTR_PROG $@ 2>&1 | \ + sed -e '/^Warning: option --restore=file is unsafe without option/d' | \ + _filter_scratch } _create_test_bed()
Signature · 1 line
2.54.0
Quoted 9 lines · Avinesh Kumar
From: Avinesh Kumar <[email protected]>
attr 2.6.0 (CVE-2026-54371 fix)[0] makes "setfattr --restore" warn when used without -P and the dump contains a symlink, which generic/062 does. The warning leaks into the compared output via the
setfattr()wrapper and fails the test. Adding -P isn't portable (older attr doesn't have it), so filter the warning in the wrapper instead.
For generic/062, modifying the g/062 itself seems fine and logical, as _extend_test_bed() explicitly introduces complex symlink paths for testing purposes.
Have you run xfstests on XFS with attr 2.6.0? There are quite a few setfattr --restore invocations in common/populate. If those also trigger the new unsafe restore warnings, we might want to consider introducing a helper function, such as _setfattr or _setfattr_restore to handle to -h and -P things.
Quoted 27 lines
Signed-off-by Avinesh Kumar <[email protected]>--- tests/generic/062 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)tests/generic/062 +6
-1@@ -30,7 +30,12 @@ getfattr() setfattr() { - $SETFATTR_PROG $@ 2>&1 | _filter_scratch + # attr >= 2.6.0 (CVE-2026-54371 fix) warns that "setfattr --restore" without + # -P/--physical is unsafe because it can traverse symlinks. Older attr does + # not accept -P, so just filter the warning to stay version-agnostic. + $SETFATTR_PROG $@ 2>&1 | \ + sed -e '/^Warning: option --restore=file is unsafe without option/d' | \ + _filter_scratch } _create_test_bed()Signature · 1 line
2.54.0
Hello Zorro,
Thanks for the review.
Quoted 15 lines · Zorro Lang
Quoted 9 lines · Avinesh Kumar
From: Avinesh Kumar <[email protected]>
attr 2.6.0 (CVE-2026-54371 fix)[0] makes "setfattr --restore" warn when used without -P and the dump contains a symlink, which generic/062 does. The warning leaks into the compared output via the
setfattr()wrapper and fails the test. Adding -P isn't portable (older attr doesn't have it), so filter the warning in the wrapper instead.For generic/062, modifying the g/062 itself seems fine and logical, as
_extend_test_bed()explicitly introduces complex symlink paths for testing purposes.
Quoted 7 lines
Have you run xfstests on XFS with attr 2.6.0? There are quite a few setfattr --restore invocations in common/populate. If those also trigger the new unsafe restore warnings, we might want to consider introducing a helper function, such as
_setfattror_setfattr_restoreto handle to -h and -P things.Reviewed-by Zorro Lang <[email protected]>
I am sorry, I forgot to reply to my patch here. I got same feedback from Darrick when I sent patch for xfs/083 for the same issue. So this is being handled with a wrapper. Please review here and this patch can be ignored -
https://lore.kernel.org/fstests/[email protected]/T/#m3bef5e49d3ca17f845a3ccab8b6dea5b67c00d86
Regards,
Avinesh
Quoted 28 lines
Quoted 28 lines
Signed-off-by Avinesh Kumar <[email protected]>--- tests/generic/062 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)tests/generic/062 +6
-1@@ -30,7 +30,12 @@ getfattr() setfattr() { - $SETFATTR_PROG $@ 2>&1 | _filter_scratch + # attr >= 2.6.0 (CVE-2026-54371 fix) warns that "setfattr --restore" without + # -P/--physical is unsafe because it can traverse symlinks. Older attr does + # not accept -P, so just filter the warning to stay version-agnostic. + $SETFATTR_PROG $@ 2>&1 | \ + sed -e '/^Warning: option --restore=file is unsafe without option/d' | \ + _filter_scratch } _create_test_bed()Signature · 1 line
2.54.0
Quoted 26 lines · Avinesh Kumar
Hello Zorro,
Thanks for the review.
Quoted 21 lines · Zorro Lang
Quoted 9 lines · Avinesh Kumar
From: Avinesh Kumar <[email protected]>
attr 2.6.0 (CVE-2026-54371 fix)[0] makes "setfattr --restore" warn when used without -P and the dump contains a symlink, which generic/062 does. The warning leaks into the compared output via the
setfattr()wrapper and fails the test. Adding -P isn't portable (older attr doesn't have it), so filter the warning in the wrapper instead.For generic/062, modifying the g/062 itself seems fine and logical, as
_extend_test_bed()explicitly introduces complex symlink paths for testing purposes.Have you run xfstests on XFS with attr 2.6.0? There are quite a few setfattr --restore invocations in common/populate. If those also trigger the new unsafe restore warnings, we might want to consider introducing a helper function, such as
_setfattror_setfattr_restoreto handle to -h and -P things.
Quoted 7 lines
Quoted 1 line
Reviewed-by Zorro Lang <[email protected]>I am sorry, I forgot to reply to my patch here. I got same feedback from Darrick when I sent patch for xfs/083 for the same issue. So this is being handled with a wrapper. Please review here and this patch can be ignored -
https://lore.kernel.org/fstests/[email protected]/T/#m3bef5e49d3ca17f845a3ccab8b6dea5b67c00d86
Great! Darrick gave you a similar review point, I'm going to check that new patch.
Thanks,
Zorro
Quoted 33 lines
Regards,
AvineshQuoted 26 lines
Quoted 26 lines
Signed-off-by Avinesh Kumar <[email protected]>--- tests/generic/062 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)tests/generic/062 +6
-1@@ -30,7 +30,12 @@ getfattr() setfattr() { - $SETFATTR_PROG $@ 2>&1 | _filter_scratch + # attr >= 2.6.0 (CVE-2026-54371 fix) warns that "setfattr --restore" without + # -P/--physical is unsafe because it can traverse symlinks. Older attr does + # not accept -P, so just filter the warning to stay version-agnostic. + $SETFATTR_PROG $@ 2>&1 | \ + sed -e '/^Warning: option --restore=file is unsafe without option/d' | \ + _filter_scratch } _create_test_bed()Signature · 1 line
2.54.0