Commit 395a02d
landlock: Use bit-fields for storing handled layer access masks
When defined using bit-fields, the compiler takes care of packing the
bits in a memory-efficient way and frees us from defining
LANDLOCK_SHIFT_ACCESS_* by hand. The exact memory layout does not
matter in our use case.
The manual definition of LANDLOCK_SHIFT_ACCESS_* has resulted in bugs in
at least two recent patch sets [1] [2] where new kinds of handled access
rights were introduced.
Cc: Mikhail Ivanov <ivanov.mikhail1@huawei-partners.com>
Cc: Tahera Fahimi <fahimitahera@gmail.com>
Link: https://lore.kernel.org/r/ebd680cc-25d6-ee14-4856-310f5e5e28e4@huawei-partners.com [1]
Link: https://lore.kernel.org/r/ZmLEoBfHyUR3nKAV@google.com [2]
Signed-off-by: Günther Noack <gnoack@google.com>
Link: https://lore.kernel.org/r/20240610082115.1693267-1-gnoack@google.com
Signed-off-by: Mickaël Salaün <mic@digikod.net>1 parent 256abd8 commit 395a02d
3 files changed
+9
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | 175 | | |
180 | 176 | | |
181 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | | - | |
| 268 | + | |
270 | 269 | | |
271 | 270 | | |
272 | 271 | | |
| |||
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
281 | | - | |
282 | | - | |
| 280 | + | |
283 | 281 | | |
284 | 282 | | |
285 | 283 | | |
286 | 284 | | |
287 | 285 | | |
288 | 286 | | |
289 | | - | |
290 | | - | |
291 | | - | |
| 287 | + | |
292 | 288 | | |
293 | 289 | | |
294 | 290 | | |
| |||
304 | 300 | | |
305 | 301 | | |
306 | 302 | | |
307 | | - | |
308 | | - | |
309 | | - | |
| 303 | + | |
310 | 304 | | |
311 | 305 | | |
312 | 306 | | |
| |||
0 commit comments