e2fsck: fix f_baddotdir failure on big-endian systems
Commit 63f44aafb1f2 ("e2fsck: fix ".." more gracefully if possible")
changed the check_dot() function to try to avoid resetting the '..'
entry when the '.' entry is too large.. But if we do that, then on
big-endian systems, we need to try byte swapping the rest of the
directory entries, or else the f_baddotdir test will fail on
big-endian systems.
Also add a check to avoid UBSAN warning when there is not enough space
at the end of the directory block for a directory entry, and so we can
potentially overflow some pointer arithmetic when trying to byte swap
the remainder of the (negative) space in the directory block.
Fixes: 63f44aafb1f2 ("e2fsck: fix ".." more gracefully if possible")
Signed-off-by: Theodore Ts'o <email address hidden>
libext2fs: fix translation of Posix ACL's on big-endian systems
The ACL returned by the kernel in lgetxattr(2) is returned in Little
Endian, even on Big Endian systems. Fix the functions
convert_posix_acl_to_disk_buffer() and convert_disk_buffer_to_posix_acl()
to work correctly on Big Endian systems. This fixes a failure of
the test m_rootdir_acl.
As I mentioned responding to another bug report, e2fsprogs's maint branch is currently in a translation freeze pending an upcoming 1.46.4 release. PTAL and let me know if you see other issues. (You probably don't care for Ubuntu but 1.46.4 should also fix some portability issues for GNU Hurd.)
These problems are fixed upstream. See:
commit 225e5d093b519f9 dbe9fcaacd99542 6f0e5194f6
Author: Theodore Ts'o <email address hidden>
Date: Wed Jul 28 13:51:13 2021 -0400
e2fsck: fix f_baddotdir failure on big-endian systems
Commit 63f44aafb1f2 ("e2fsck: fix ".." more gracefully if possible")
changed the check_dot() function to try to avoid resetting the '..'
entry when the '.' entry is too large.. But if we do that, then on
big-endian systems, we need to try byte swapping the rest of the
directory entries, or else the f_baddotdir test will fail on
big-endian systems.
Also add a check to avoid UBSAN warning when there is not enough space
at the end of the directory block for a directory entry, and so we can
potentially overflow some pointer arithmetic when trying to byte swap
the remainder of the (negative) space in the directory block.
Fixes: 63f44aafb1f2 ("e2fsck: fix ".." more gracefully if possible")
Signed-off-by: Theodore Ts'o <email address hidden>
commit 7a97083d4350b93 f4055bdd8465667 cecbb36438
Author: Theodore Ts'o <email address hidden>
Date: Fri Jul 30 12:29:44 2021 -0400
libext2fs: fix translation of Posix ACL's on big-endian systems
The ACL returned by the kernel in lgetxattr(2) is returned in Little posix_acl_ to_disk_ buffer( ) and convert_ disk_buffer_ to_posix_ acl()
Endian, even on Big Endian systems. Fix the functions
convert_
to work correctly on Big Endian systems. This fixes a failure of
the test m_rootdir_acl.
Signed-off-by: Theodore Ts'o <email address hidden>
As I mentioned responding to another bug report, e2fsprogs's maint branch is currently in a translation freeze pending an upcoming 1.46.4 release. PTAL and let me know if you see other issues. (You probably don't care for Ubuntu but 1.46.4 should also fix some portability issues for GNU Hurd.)