-
Notifications
You must be signed in to change notification settings - Fork 583
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
sandbox/cgroup: improve cgroup-based process termination algorithm #14513
sandbox/cgroup: improve cgroup-based process termination algorithm #14513
Commits on Sep 29, 2024
-
sandbox/cgroup: improve cgroup-based process termination algorithm
unify termination algorithm for v1/v2 - for each snap cgroup: - while cgroup.procs is not empty: - SIGKILL each pid in cgroup.procs - for v1 only, also kill pids found in freezer cgroup created by snap-confine - this is relevant for systemd v237 (used in ubuntu 18.04) for non-root users where the transient scope cgroups are not created This logic drops the freeze/kill/thaw approach with all the weird v1/v2/kernel backward compatibility. Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9da9133 - Browse repository at this point
Copy the full SHA 9da9133View commit details -
sandbox/cgroup: address review comments
Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8e24620 - Browse repository at this point
Copy the full SHA 8e24620View commit details -
tests: add a fork bomb variant for tests/main/snap-remove-terminate
This test variant stress-tests the new algorithm where snapd could be racing after a fork bomb without doing freezing first by continuously killing pids that show up until all pids are drained from cgroup. Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 577196c - Browse repository at this point
Copy the full SHA 577196cView commit details -
tests: address review comments
Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1f0f275 - Browse repository at this point
Copy the full SHA 1f0f275View commit details -
Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f0012ce - Browse repository at this point
Copy the full SHA f0012ceView commit details -
Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c4cfbd7 - Browse repository at this point
Copy the full SHA c4cfbd7View commit details -
sandbox/cgroup: address fork bombs in KillSnapProcesses
Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8013083 - Browse repository at this point
Copy the full SHA 8013083View commit details -
sandbox/cgroup: add context propagation and timeout to killProcessesI…
…nCgroup Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 310f356 - Browse repository at this point
Copy the full SHA 310f356View commit details -
sandbox/cgroup: don't use freezer cgroup for tracking in KillSnapProc…
…esses for v1 Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 37c8531 - Browse repository at this point
Copy the full SHA 37c8531View commit details -
many: sync snap-confine and kill-snap-apps task
This syncs snap-confine and this task to make sure they are not racing on two important resources: - Remove inhibition lock (which snap-confine exits when observing) - V1 freezer cgroup (which snap-confine creates and joins) This is needed to address an issue in systemd v237 (used by Ubuntu 18.04) for non-root users where no tracking transient scope cgroups are created except the freezer cgroup which is created in snap-confine after the inhibition lock is release by "snap run". Effectively the sequence below is followed: - kill-snap-apps task holds snap lock - kill-snap-apps holds remove inhibition lock - snap-confine holds snap lock - snap-confine exits if remove inhibition lock exists - snap-confine creates/joins freezer Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d8f0ddd - Browse repository at this point
Copy the full SHA d8f0dddView commit details -
sandbox/cgroup: freeze/thaw per cgroup when killing snap apps on cgor…
…up v1 When sending SIGKILL signals to snap pids in a frozen v1 cgroup a thaw must be done for those signals to take effect. Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b218ec5 - Browse repository at this point
Copy the full SHA b218ec5View commit details -
tests/main/snap-remove-terminate: prevent fork-bomb variant from dest…
…roying test machine The fork-bomb test variant was destroying test machines especially those with older systemd versions where DefaultTaskMax was unlimited. This runs the fork-bomb test variant under a separate user whose TasksMax is limited. Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for eeeb1ab - Browse repository at this point
Copy the full SHA eeeb1abView commit details -
tests/main/snap-remove-terminate: skip amazon-linux-2 for fork-bomb v…
…ariant Amazon Linux 2 does not support systemd --user needed by the fork-bomb variant of the test. Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0006bc5 - Browse repository at this point
Copy the full SHA 0006bc5View commit details -
Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1ffcb7c - Browse repository at this point
Copy the full SHA 1ffcb7cView commit details
Commits on Sep 30, 2024
-
Signed-off-by: Zeyad Gouda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9454158 - Browse repository at this point
Copy the full SHA 9454158View commit details