Skip to content

Comments

incusd/apparmor/lxc: Don't bother with sys/proc protections when nest…#2624

Merged
stgraber merged 1 commit intolxc:mainfrom
stgraber:main
Nov 6, 2025
Merged

incusd/apparmor/lxc: Don't bother with sys/proc protections when nest…#2624
stgraber merged 1 commit intolxc:mainfrom
stgraber:main

Conversation

@stgraber
Copy link
Member

@stgraber stgraber commented Nov 6, 2025

…ing enabled

When nesting is enabled, it's possible for the container to get a clean copy of /proc or /sys mounted anywhere without AppArmor being able to mediate. So there's little point in trying to apply safety checks on top of the main /proc and /sys.

On top of that, we've recently discovered that AppArmor doesn't properly handle file access relative to a file descriptor, causing a bunch of those checks to deny access when they shouldn't.

Closes #2623

…ing enabled

When nesting is enabled, it's possible for the container to get a clean
copy of /proc or /sys mounted anywhere without AppArmor being able to
mediate. So there's little point in trying to apply safety checks on top
of the main /proc and /sys.

On top of that, we've recently discovered that AppArmor doesn't properly
handle file access relative to a file descriptor, causing a bunch of
those checks to deny access when they shouldn't.

Closes lxc#2623

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
@elangelo
Copy link

elangelo commented Nov 13, 2025

I was trying out this fix. I have Ubuntu Noble. I checked the lts, stable and noble suites and all of them only contain version 6.0.5 which I think does not contain this fix?
28 minutes later... no idea what just happened but all of a sudden 6.18 is available...

@hamboosh478
Copy link

Sorry, total noob here. I am using LXCs on TrueNAS (which uses Incus). Previously had ptero set up and working. Had to rebuild it, and now I see that there is this issue with LXCs ... do we know if there will be a fix any time soon? Thanks so much.

@stgraber
Copy link
Member Author

@hamboosh478 that's up to the TrueNAS team. We don't control what version of Incus and what fixes get backported by specific distributions.

@hamboosh478
Copy link

Right, thanks. One last question: Is this a bug stemming from the specific incus version? And if not then what is the source?

@ireun
Copy link

ireun commented Nov 15, 2025

@Thomas-Langford I think you should look at this: opencontainers/runc#4968

@lukasz-zaroda
Copy link

lukasz-zaroda commented Nov 24, 2025

Is this fix coming to the Incus 6.0.x LTS? My setup also got broken.

@stgraber
Copy link
Member Author

We'll be tagging 6.0.6 LTS in the next 2-3 weeks, but whether distros pick it up and when is completely up to them.

@StefHeitzer
Copy link

Sorry for a real late question but we're currently still facing an issue with incus and exactly this topic. First of all we had simple lxc running and fixed the problems with the apparmor profile of each lxc container itself. Right now we are migrating to incus (which works pretty well currently) but nesting a docker container within the incus container causes exactly the same problems. We're using the zabbly daily packages and are currently on version 6.21. Is there anything else we need to consider @stgraber ?

Thanks in advance for the help!!!

@stgraber
Copy link
Member Author

@StefHeitzer did you set security.nesting=true on the parent container?

@StefHeitzer
Copy link

@StefHeitzer did you set security.nesting=true on the parent container?

Works like a charm! Put the setting within a profile and now everything works fine! Thanks a lot @stgraber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

nested docker 28.5.2 unable start containers; net.ipv4.ip_unprivileged_port_start permission denied

7 participants