Repository navigation
nplb: Derive the denied priority in ErrorOnPermissionDenied - #13105
Merged
Merged
Conversation
Contributor
|
Contributor
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request enables the PosixSetPriorityTests.ErrorOnPermissionDenied test on ARM and ARM64 AOSP platforms and updates its implementation to dynamically determine the priority ceiling using getrlimit with RLIMIT_NICE. Feedback on the changes highlights that RLIMIT_NICE is Linux-specific and will cause compilation failures on other POSIX platforms like macOS or FreeBSD, so this logic should be conditionally compiled using #ifdef RLIMIT_NICE.
sacuff
reviewed
Oct 7, 2026
PosixSetPriorityTests.ErrorOnPermissionDenied raises the process priority by one and expects EACCES, assuming any unprivileged raise is denied. An unprivileged process may, however, lower its nice value down to 20 - RLIMIT_NICE. Android grants applications enough of that limit to manage their own thread priorities, so on AOSP the raise succeeded and the test failed. Try the first priority the kernel actually denies, one below both the current value and the RLIMIT_NICE ceiling. Also check `getpriority` on its raw return value in this test and in SetProcessPrioritySuccessfully. Both checked the value after adding or subtracting one, so a failing `getpriority` (-1) was never reported. Bug: 532068409
hferreiro
force-pushed
the
nplb-setpriority
branch
from
October 8, 2026 12:48
d6d18da to
cb31ed3
Compare
sacuff
approved these changes
Oct 8, 2026
briantting
pushed a commit
that referenced
this pull request
Oct 12, 2026
…missionDenied Refer to original PR: #13105 PosixSetPriorityTests.ErrorOnPermissionDenied raises the process priority by one and expects EACCES, assuming any unprivileged raise is denied. An unprivileged process may, however, lower its nice value down to 20 - RLIMIT_NICE. Android grants applications enough of that limit to manage their own thread priorities, so on AOSP the raise succeeded and the test failed. Try the first priority the kernel actually denies, one below both the current value and the RLIMIT_NICE ceiling. Also check `getpriority` on its raw return value in this test and in SetProcessPrioritySuccessfully. Both checked the value after adding or subtracting one, so a failing `getpriority` (-1) was never reported. Bug: 532068409 (cherry picked from commit 1cfb7b3)
briantting
pushed a commit
that referenced
this pull request
Oct 16, 2026
…missionDenied Refer to original PR: #13105 PosixSetPriorityTests.ErrorOnPermissionDenied raises the process priority by one and expects EACCES, assuming any unprivileged raise is denied. An unprivileged process may, however, lower its nice value down to 20 - RLIMIT_NICE. Android grants applications enough of that limit to manage their own thread priorities, so on AOSP the raise succeeded and the test failed. Try the first priority the kernel actually denies, one below both the current value and the RLIMIT_NICE ceiling. Also check `getpriority` on its raw return value in this test and in SetProcessPrioritySuccessfully. Both checked the value after adding or subtracting one, so a failing `getpriority` (-1) was never reported. Bug: 532068409 (cherry picked from commit 1cfb7b3)
briantting
pushed a commit
that referenced
this pull request
Oct 16, 2026
…missionDenied Refer to original PR: #13105 PosixSetPriorityTests.ErrorOnPermissionDenied raises the process priority by one and expects EACCES, assuming any unprivileged raise is denied. An unprivileged process may, however, lower its nice value down to 20 - RLIMIT_NICE. Android grants applications enough of that limit to manage their own thread priorities, so on AOSP the raise succeeded and the test failed. Try the first priority the kernel actually denies, one below both the current value and the RLIMIT_NICE ceiling. Also check `getpriority` on its raw return value in this test and in SetProcessPrioritySuccessfully. Both checked the value after adding or subtracting one, so a failing `getpriority` (-1) was never reported. Bug: 532068409 (cherry picked from commit 1cfb7b3)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PosixSetPriorityTests.ErrorOnPermissionDenied raises the process priority by one and expects EACCES, assuming any unprivileged raise is denied. An unprivileged process may, however, lower its nice value down to 20 - RLIMIT_NICE. Android grants applications enough of that limit to manage their own thread priorities, so on AOSP the raise succeeded and the test failed.
Try the first priority the kernel actually denies, one below both the current value and the RLIMIT_NICE ceiling.
Also check
getpriorityon its raw return value in this test and in SetProcessPrioritySuccessfully. Both checked the value after adding or subtracting one, so a failinggetpriority(-1) was never reported.Bug: 532068409