-
Notifications
You must be signed in to change notification settings - Fork 660
Fix: getsockopt usage for SO_PASSCRED/SO_PASSSEC on Linux 6.16+Fix socket opts #2711
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
base: criu-dev
Are you sure you want to change the base?
Fix: getsockopt usage for SO_PASSCRED/SO_PASSSEC on Linux 6.16+Fix socket opts #2711
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
- you don't need to change anything in the test code. Test code is correct.
- we shouldn't introduce any checks based on a kernel version in CRIU code, except a very-very rare cases
- please, squash your commits and add
Signed-off-by
tag
Thank you for your advice.
|
Take a look at kerndat.c. That is where CRIU checks for runtime features. It is important to check for runtime features and not during compile time. |
a036216
to
375f58e
Compare
fe790c7
to
ad23fff
Compare
Hi @DongSunchao , please read the contribution guidelines at https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html and reformat your commits. The command |
d8f289f
to
d9be15a
Compare
4ff0c8a
to
2ba4d0d
Compare
I somehow overlooked this one, you can look into #2719 where I have some improving ideas. Like:
|
I've seen your code, and I really think your approach is better than mine. I'll change my code soon. |
0ea0c45
to
cfe8b39
Compare
@DongSunchao Would it be possible to reset the author of your commits to yourself (instead of The following blog post provides more information on how to write good commit messages and why this is important: https://cbea.ms/git-commit/#seven-rules |
40a8df2
to
eac71fd
Compare
02a482c
to
81f4ff5
Compare
I've made the requested changes and have done my best to follow the guidelines. However, I've run into a new issue: my code passes the Fedora Rawhide test in my repository action but fails the Vagrant Fedora Rawhide test on this PR. I'm not sure how to resolve it. |
Having a hunk adding lines in first patch
And then having hunk removing those same lines in second patch:
is generally discouraged. Please remove the hunk touching zdtm from the first patch completely. Also by those hunks you remove important |
81f4ff5
to
2b168ed
Compare
My apologies. I caught a cold last night, so I rechecked my code and fixed the other errors. Please point out any other issues you find. I'd appreciate your help. |
I still see all the same problems with zdtm hunk and also new excess hunk 8402f8d#diff-d6b1349661211f7a79a28b685b951ce03f5919c95f404faacea6ce98692b8bf6 |
8c7edab
to
8f4e5eb
Compare
5667847
to
ec04868
Compare
…ASSSEC SO_PASSCRED and SO_PASSSEC are only valid for AF_UNIX and AF_NETLINK This patch updates the test logic to use a unix socket for these options, while preserving the original value consistency check Fixes: checkpoint-restore#2705 Signed-off-by: Dong Sunchao <[email protected]>
ec04868
to
654c101
Compare
Linux 6.16+ restricts SO_PASSCRED and SO_PASSSEC to AF_UNIX, AF_NETLINK, and AF_BLUETOOTH This patch updates CRIU to check the socket family before dumping these options Fixes: checkpoint-restore#2705 Signed-off-by: Dong Sunchao <[email protected]>
654c101
to
de3b0d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you!
Hi, there is another issue related to the one I mentioned previously. The code fails the Vagrant Fedora Rawhide based test with an error in However, I've tried running the same test on my local virtual machine (kernel version 6.17.0-0.rc1.250815gd7ee5bdce789.21.fc44.x86_64, Vagrant Fedora), and it passes successfully. I find this very strange and suspect the issue might be related to the CI environment. |
Linux 6.16 changed the behavior of getsockopt for credential-related options and it restricted
SO_PASS{CRED,PIDFD,SEC}
toAF_{UNIX,NETLINK,BLUETOOTH}
.This patch updates the logic to correctly handle
SO_PASSCRED
andSO_PASSSEC
,ensuring compatibility with newer kernels while preserving support for older ones.
Besides, /test/zdtm/static/sock_opts00.c has been changed to check the kernel version so that
PF_INET
can skip theSO_PASSCRED
andSO_PASSSEC
options.Tested with: ./test/zdtm.py run -t zdtm/static/sock_opts00 -f ns
Fixes: #2705