scheduler: fix SCHED_DEADLINE upper bound check to reject 2^63 - #2232
Rajkaran-122 wants to merge 1 commit into
Conversation
271f7b4 to
ead13d8
Compare
|
Ephemeral COPR build failed. @containers/packit-build please check. |
|
tests are failing @eriksjolund PTAL |
ead13d8 to
88a96d9
Compare
88a96d9 to
6d87085
Compare
|
LGTM (I just reviewed the changes in src/libcrun/scheduler.c) |
kolyshkin
left a comment
There was a problem hiding this comment.
I took a brief look at the test cases -- and it is ridiculous to have 20+ lines of code to check each and every boundary values.
Maybe the new tests does not make any sense?
6d87085 to
11e58bc
Compare
@Rajkaran-122 ^^^ |
051e55f to
7b5baa0
Compare
|
please apply the fixup and commit the final clean patch |
7b5baa0 to
115c65d
Compare
@giuseppe sir PTAL . |
|
@Rajkaran-122 you need to squash your commits (as @giuseppe said above). |
115c65d to
96dd5b6
Compare
@kolyshkin @giuseppe sir PTAL . |
kolyshkin
left a comment
There was a problem hiding this comment.
So what's wrong with using the existing test, just decrease its number by one? Why write a new test?
Per sched(7), SCHED_DEADLINE parameters must be at least 1024 and less than 2^63. The current code uses greater than max with max = 2^63, which incorrectly accepts values equal to 2^63. Change the check to greater than or equal to max to reject the endpoint as required by the kernel spec. Add regression test for the specific bug (2^63 rejection). Fixes containers#2190 Signed-off-by: Rajkaran Yadav <[email protected]>
96dd5b6 to
add48e6
Compare
|
@giuseppe sir Could you please rerun the failed |
|
@eriksjolund PTAL |
Per sched(7),
SCHED_DEADLINEparameters must be at least 1024 and less than 2^63. The current code usesmax = 1ULL << 63together with a>comparison, which incorrectly accepts a value equal to 2^63.Change
maxto(1ULL << 63) - 1so that the existing range check correctly rejects 2^63 while accepting the maximum valid value.Keep the existing
must be betweenerror messages unchanged.Add a focused regression test for the specific bug:
SCHED_DEADLINEruntime/deadline values.Fixes #2190