Commit 66ccd25
selinux: simplify away security_policydb_len()
Remove the security_policydb_len() calls from sel_open_policy() and
instead update the inode size from the size returned from
security_read_policy().
Since after this change security_policydb_len() is only called from
security_load_policy(), remove it entirely and just open-code it there.
Also, since security_load_policy() is always called with policy_mutex
held, make it dereference the policy pointer directly and drop the
unnecessary RCU locking.
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>1 parent 9ff9abc commit 66ccd25
3 files changed
Lines changed: 10 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | 222 | | |
224 | 223 | | |
225 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | 418 | | |
425 | 419 | | |
426 | 420 | | |
427 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2328 | 2328 | | |
2329 | 2329 | | |
2330 | 2330 | | |
2331 | | - | |
2332 | | - | |
2333 | | - | |
2334 | | - | |
2335 | | - | |
2336 | | - | |
2337 | | - | |
2338 | | - | |
2339 | | - | |
2340 | | - | |
2341 | | - | |
2342 | | - | |
2343 | | - | |
2344 | | - | |
2345 | | - | |
2346 | | - | |
2347 | 2331 | | |
2348 | 2332 | | |
2349 | 2333 | | |
| |||
3903 | 3887 | | |
3904 | 3888 | | |
3905 | 3889 | | |
3906 | | - | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
3907 | 3893 | | |
3908 | 3894 | | |
3909 | | - | |
3910 | | - | |
| 3895 | + | |
3911 | 3896 | | |
3912 | 3897 | | |
3913 | 3898 | | |
3914 | 3899 | | |
3915 | 3900 | | |
3916 | 3901 | | |
3917 | 3902 | | |
3918 | | - | |
3919 | | - | |
3920 | 3903 | | |
3921 | | - | |
3922 | | - | |
3923 | 3904 | | |
3924 | 3905 | | |
3925 | 3906 | | |
| |||
0 commit comments