Closed StyXman closed 4 years ago
On the same note, maybe I could run cleanup code of the blocking file if there was a pre-stop/pre-delete hook. Should I open a separate issue for that?
We're pretty allergic to hooks as having those behave consistently in a cluster and be properly integrated with the read-only filesystem of the snap is a pain. Instead we'd rather have LXD do the right thing from the start. In this case, we'll most likely want to use our own walk-based recursive removal logic and when encountering that error, attempt to clear the attribute and try the deletion again.
Then you should check which other attributes and alternative methods of limiting capabilities (AppArmour, SELinux? I really don't know) are available that could lead to these kind of issues.
LXD itself normally runs unconfined at the LSM layer and its containers can't load policies to prevent themselves from getting deleted. So I can only think of the usual suspects:
Confirmed that as expected, this can only be a problem inside a privileged container, so we don't need to treat this as a security/DoS at least.
I can confirm that 3.23 fixes this. You can close this.
Required information
Issue description
This container contains (!!!) a file that has the append-only attribute set. This attribute has the side effect of not allowing
root
to remove it. solxc delete
usually fails if you don't unset it withchattr -a
. I have Ansible playbooks to handle this, and it usually works... until it doesn't.Steps to reproduce
I'm really not sure how i got here. I got the same 2 weeks ago and I don't remember how I fixed it, sorry.
Information to attach
lxc config show NAME --expanded
)lxc monitor
while reproducing the issue)