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
Fixup largefile define #31419
Fixup largefile define #31419
Conversation
This value is actually arch-specific, so this commit defines it for all the arches that set it to some custom value Fixes systemd#31417
Adds a SAFE_FD_FLAGS define to list out all the safe FD flags, and also an UNSAFE_FD_FLAGS() macro to strip out the safe flags and leave only the unsafe flags. This can be used to quickly check if any unsafe flags are set and print them for diagnostic purposes
8381a41
to
e4d0606
Compare
I tried this on both ppc64le and aarch64 and the issue seems to be indeed gone, thanks! Also, just out of curiosity, I tried this on armv7l as well, but there the test doesn't get far:
|
Otherwise weird stuff happens on the other side: [1217111.957263] testsuite-46.sh[61]: + homectl create test-user --disk-size=min --luks-discard=yes --image-path=/home/test-user.home --luks-pbkdf-type=pbkdf2 --luks-pbkdf-time-cost=1ms [1217112.598219] homectl[66]: Operation on home test-user failed: Provided flags are unsupported (0ad2578000000000). (taken from TEST-46-HOME run on armv7l) Fixes issue mentioned in systemd#31419 (comment).
-> #31420 |
Otherwise weird stuff happens on the other side: [1217111.957263] testsuite-46.sh[61]: + homectl create test-user --disk-size=min --luks-discard=yes --image-path=/home/test-user.home --luks-pbkdf-type=pbkdf2 --luks-pbkdf-time-cost=1ms [1217112.598219] homectl[66]: Operation on home test-user failed: Provided flags are unsupported (0ad2578000000000). (taken from TEST-46-HOME run on armv7l) Fixes issue mentioned in systemd#31419 (comment).
* This ensures that clients can't trick a privileged service into giving access to a file the client | ||
* doesn't already have access to (especially via something like O_PATH). | ||
* | ||
* O_NOFOLLOW: For some reason the kernel will return this flag from fcntl; it doesn't go away immediately |
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.
Btw, this is new w/ this PR. Just double checking that this was noticed
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "FD for %s has unexpected flags set", filename); | ||
if (UNSAFE_FD_FLAGS(flags) != 0) | ||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, | ||
"FD for %s has unexpected flags set: 0%o", |
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.
So I think this is probably too verbose to be included in bus error. We should add a helper that does log_debug internally. But I'll merge this as-is and submit a follow-up.
Otherwise weird stuff happens on the other side: [1217111.957263] testsuite-46.sh[61]: + homectl create test-user --disk-size=min --luks-discard=yes --image-path=/home/test-user.home --luks-pbkdf-type=pbkdf2 --luks-pbkdf-time-cost=1ms [1217112.598219] homectl[66]: Operation on home test-user failed: Provided flags are unsupported (0ad2578000000000). (taken from TEST-46-HOME run on armv7l) Fixes issue mentioned in #31419 (comment).
Otherwise weird stuff happens on the other side: [1217111.957263] testsuite-46.sh[61]: + homectl create test-user --disk-size=min --luks-discard=yes --image-path=/home/test-user.home --luks-pbkdf-type=pbkdf2 --luks-pbkdf-time-cost=1ms [1217112.598219] homectl[66]: Operation on home test-user failed: Provided flags are unsupported (0ad2578000000000). (taken from TEST-46-HOME run on armv7l) Fixes issue mentioned in systemd#31419 (comment).
Otherwise weird stuff happens on the other side: [1217111.957263] testsuite-46.sh[61]: + homectl create test-user --disk-size=min --luks-discard=yes --image-path=/home/test-user.home --luks-pbkdf-type=pbkdf2 --luks-pbkdf-time-cost=1ms [1217112.598219] homectl[66]: Operation on home test-user failed: Provided flags are unsupported (0ad2578000000000). (taken from TEST-46-HOME run on armv7l) Fixes issue mentioned in systemd#31419 (comment).
Fixes #31417
Also makes the error messages include the flags that are invalid, for easier debugging in the future, and defines a macro that declares what flags are safe to use (since there's > 1 consumer of this nowadays, and more coming with #26826)