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

Diagnose capability changes if migrating between kernels of different cap_last_cap. #2200

Closed
wants to merge 1 commit into from

Conversation

osctobe
Copy link
Contributor

@osctobe osctobe commented Jun 15, 2023

Log when trying to restore capabilities unknown to the kernel.

@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2023

Codecov Report

Patch coverage: 86.36% and project coverage change: -0.06 ⚠️

Comparison is base (2d6f04c) 70.35% compared to head (ad6ca9c) 70.30%.

❗ Current head ad6ca9c differs from pull request most recent head 541856d. Consider uploading reports for the commit 541856d to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##           criu-dev    #2200      +/-   ##
============================================
- Coverage     70.35%   70.30%   -0.06%     
============================================
  Files           133      132       -1     
  Lines         34001    33995       -6     
============================================
- Hits          23923    23900      -23     
- Misses        10078    10095      +17     
Impacted Files Coverage Δ
criu/cr-restore.c 67.37% <86.36%> (+0.17%) ⬆️

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

criu/cr-restore.c Outdated Show resolved Hide resolved
@osctobe osctobe requested a review from avagin June 19, 2023 15:04
@osctobe osctobe changed the title Add cap_last_cap to the image and use it during restore of cap bounding set. Diagnose capability changes if migrating between kernels of different cap_last_cap. Jun 21, 2023
@osctobe osctobe force-pushed the cap-restore-fix branch 5 times, most recently from 0f83a62 to 9f323ad Compare June 26, 2023 21:01
criu/cr-restore.c Outdated Show resolved Hide resolved
@avagin
Copy link
Member

avagin commented Jul 3, 2023

Change-Id: Iee9efb7d46e4a40558ab21035d352d6dcb74dc6a

nit: pls remove these Change-Id tags.

@osctobe osctobe force-pushed the cap-restore-fix branch 2 times, most recently from dd3691d to 17cd778 Compare July 19, 2023 16:05
@osctobe osctobe requested a review from avagin July 19, 2023 16:06
criu/cr-restore.c Outdated Show resolved Hide resolved
criu/cr-restore.c Outdated Show resolved Hide resolved
@osctobe osctobe force-pushed the cap-restore-fix branch 4 times, most recently from 021db4e to eef1dda Compare July 25, 2023 17:38
@osctobe osctobe requested a review from avagin July 25, 2023 17:39
…els.

When restoring on a kernel that has different number of supported
capabilities than checkpoint one, check that the extra caps are unset.

There are two directions to consider:

1) dump.cap_last_cap > restore.cap_last_cap
	- restoring might reduce the processes' capabilities if restored
	  kernel doesn't support checkpointed caps. Warn.

2) dump.cap_last_cap < restore.cap_last_cap
	- restoring will fill the extra caps with zeroes. No changes.

Note: `last_cap` might change without affecting `n_words`.

Signed-off-by: Michał Mirosław <[email protected]>
@avagin
Copy link
Member

avagin commented Jul 26, 2023

Merged. Thanks

@avagin avagin closed this Jul 26, 2023
@osctobe osctobe deleted the cap-restore-fix branch July 27, 2023 01:09
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.

3 participants