Commit a46e32d
landlock: Clarify BUILD_BUG_ON check in scoping logic
The BUILD_BUG_ON check in domain_is_scoped() and
unmask_scoped_access() should check that the loop that counts down
client_layer finishes. We therefore check that the numbers
LANDLOCK_MAX_NUM_LAYERS-1 and -1 are both representable by that
integer. If they are representable, the numbers in between are
representable too, and the loop finishes.
Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Link: https://lore.kernel.org/r/20260327164838.38231-6-gnoack3000@gmail.com
Signed-off-by: Mickaël Salaün <mic@digikod.net>1 parent ae97330 commit a46e32d
2 files changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1595 | 1595 | | |
1596 | 1596 | | |
1597 | 1597 | | |
1598 | | - | |
1599 | | - | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
1600 | 1601 | | |
1601 | | - | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
1602 | 1605 | | |
1603 | 1606 | | |
1604 | 1607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
| |||
0 commit comments