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

dmz: overlay: minor fixups #4509

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Nov 4, 2024

In addition to some documentation fixes, fix the xino dmesg log issue.


If /run/runc and /usr/bin are on different filesystems, overlayfs may
enable the xino feature which results in the following log message:

kernel: overlayfs: "xino" feature enabled using 3 upper inode bits.

Each time we have to protect /proc/self/exe. So disable xino to remove
the log message (we don't care about the inode numbers of the files
anyway).

Fixes #4508
Closes #4506
Signed-off-by: Aleksa Sarai [email protected]

@cyphar cyphar added this to the 1.2.2 milestone Nov 4, 2024
If /run/runc and /usr/bin are on different filesystems, overlayfs may
enable the xino feature which results in the following log message:

  kernel: overlayfs: "xino" feature enabled using 3 upper inode bits.

Each time we have to protect /proc/self/exe. So disable xino to remove
the log message (we don't care about the inode numbers of the files
anyway).

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar force-pushed the overlay-exe-fixups branch from b2426ab to c8215f7 Compare November 4, 2024 10:01
@AkihiroSuda
Copy link
Member

Side note: it is confusing that the new overlay stuff is also called "dmz"

@cyphar
Copy link
Member Author

cyphar commented Nov 4, 2024

Yeah it might make sense to rename libcontainer/dmz to libcontainer/sealedexe or something at some point.

@cyphar cyphar force-pushed the overlay-exe-fixups branch from c8215f7 to 8c6767b Compare November 4, 2024 14:44
Fixes: 871057d ("drop runc-dmz solution according to overlay solution")
Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar force-pushed the overlay-exe-fixups branch from 8c6767b to b9dfb22 Compare November 4, 2024 14:45
@kolyshkin kolyshkin added the backport/1.2-todo A PR in main branch which needs to be backported to release-1.2 label Nov 4, 2024
Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@rata rata left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, let's document the Linux kernel requirements, as it is probably 5.x what we need for this new protection

Comment on lines +3 to +10
> **NOTE**: Since runc 1.2.0, runc will now use a private overlayfs mount to
> protect the runc binary. This protection is far more light-weight than
> memfd-bind, and for most users this should obviate the need for `memfd-bind`
> entirely. Rootless containers will still make a memfd copy (unless you are
> using `runc` itself inside a user namespace -- a-la
> [`rootlesskit`][rootlesskit]), but `memfd-bind` is not particularly useful
> for rootless container users anyway (see [Caveats](#Caveats) for more
> details).
Copy link
Member

Choose a reason for hiding this comment

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

Can you document the Linux kernel requirements?

Copy link
Contributor

Choose a reason for hiding this comment

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

@rata are you referring to kernel requirements needed for overlayfs-based protection, or is it about memfd-bind?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, sorry, I mean overlayfs. We are using the new mount API, now another "new" syscall too. It's important to document it, IMHO.

@kolyshkin
Copy link
Contributor

Side note: it is confusing that the new overlay stuff is also called "dmz"

Let's not do that until the code will be stabilized (say until v1.3 release) as otherwise backporting stuff will be a pain.

@kolyshkin kolyshkin requested a review from AkihiroSuda November 7, 2024 18:17
@AkihiroSuda AkihiroSuda merged commit 2fc0caf into opencontainers:main Nov 8, 2024
40 checks passed
@rata
Copy link
Member

rata commented Nov 8, 2024

Can someone open a follow-up PR to document the kernel requirements for the overlayfs-based protection?

@cyphar
Copy link
Member Author

cyphar commented Nov 8, 2024

Sorry, I was at a conference today. I planned to update this PR tomorrow 😅. I'll send a new one.

One thing to note is that these docs living in contrib/cmd/memfd-bind is a bit anachronistic now and used to be linked to from the README.md (and it seems we might remove it entirely soon, as @kolyshkin suggested in another thread). But for now we can just keep it here.

@cyphar cyphar deleted the overlay-exe-fixups branch November 8, 2024 13:25
@rata
Copy link
Member

rata commented Nov 8, 2024

@cyphar thanks! Yeah, not sure where it's the right place, but the requirements should be somewhere :D

@cyphar
Copy link
Member Author

cyphar commented Nov 12, 2024

#4525 is the follow-up PR.

@lifubang lifubang added backport/1.2-done A PR in main branch which has been backported to release-1.2 and removed backport/1.2-todo A PR in main branch which needs to be backported to release-1.2 labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.2-done A PR in main branch which has been backported to release-1.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Journald full of "overlayfs: "xino" feature enabled using 3 up"
5 participants