Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grml-live: strip xattrs in squashfs #197

Merged
merged 1 commit into from
Dec 10, 2024
Merged

grml-live: strip xattrs in squashfs #197

merged 1 commit into from
Dec 10, 2024

Conversation

zeha
Copy link
Member

@zeha zeha commented Dec 10, 2024

Ignore all extended attributes from files in chroot when adding them to the squashfs.

This avoids:

  1. leaking containerization supplied selinux attributes into the squashfs, which can be seen when building in podman, and in docker.

  2. prevents unpacking errors in a later build-only step in containers not supporting xattrs. Can also be seen in podman.

On a normal machine and also on a normal (booted) Grml system, the only things having xattrs are:

file: var/log/journal
system.posix_acl_access
system.posix_acl_default

file: var/log/journal/1e77092b16004314a93d779757d513ac
system.posix_acl_access
system.posix_acl_default

Both of these are apparently applied by systemd/journald during boot, even if the filesystem does not have them.

@zeha zeha requested a review from mika December 10, 2024 12:25
@zeha zeha self-assigned this Dec 10, 2024
grml-live Outdated
if hasclass GRML_SMALL ; then
SQUASHFS_OPTIONS="$SQUASHFS_OPTIONS -e initrd.img* vmlinuz*"
fi

# log stuff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this change here is only visible due to (missing) rebase of previous change, FTR :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased a bit too much, but indeed its the commit from #199.

Ignore all extended attributes from files in chroot when adding them to the
squashfs.

This avoids:

1) leaking containerization supplied selinux attributes into the squashfs,
which can be seen when building in podman, and in docker.

2) prevents unpacking errors in a later build-only step in containers not
supporting xattrs. Can also be seen in podman.

On a normal machine and also on a normal (booted) Grml system, the only things
having xattrs are:

file: var/log/journal
system.posix_acl_access
system.posix_acl_default

file: var/log/journal/1e77092b16004314a93d779757d513ac
system.posix_acl_access
system.posix_acl_default

Both of these are apparently applied by systemd/journald during boot, even if
the filesystem does not have them.
@zeha zeha force-pushed the zeha/strip-xattrs branch from 2455102 to 56b8b77 Compare December 10, 2024 16:52
@zeha zeha merged commit 43fd61f into master Dec 10, 2024
10 checks passed
@zeha zeha deleted the zeha/strip-xattrs branch December 10, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants