Commit 714362f
selinux: allow multiple opens of /sys/fs/selinux/policy
commit a02cd68 upstream.
Currently there can only be a single open of /sys/fs/selinux/policy at
any time. This allows any process to block any other process from
reading the kernel policy. The original motivation seems to have been
a mix of preventing an inconsistent view of the policy size and
preventing userspace from allocating kernel memory without bound, but
this is arguably equally bad. Eliminate the policy_opened flag and
shrink the critical section that the policy mutex is held. While we
are making changes here, drop a couple of extraneous BUG_ONs.
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/selinux/20100726193414.19538.64028.stgit@paris.rdu.redhat.com/
Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 579d3e4 commit 714362f
1 file changed
Lines changed: 4 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| |||
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
343 | | - | |
344 | 342 | | |
345 | 343 | | |
346 | 344 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | 345 | | |
352 | 346 | | |
353 | 347 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
| 348 | + | |
359 | 349 | | |
360 | | - | |
361 | 350 | | |
362 | 351 | | |
363 | | - | |
| 352 | + | |
364 | 353 | | |
| 354 | + | |
365 | 355 | | |
366 | 356 | | |
367 | 357 | | |
368 | | - | |
369 | 358 | | |
370 | 359 | | |
371 | 360 | | |
372 | 361 | | |
373 | 362 | | |
374 | | - | |
375 | | - | |
| 363 | + | |
376 | 364 | | |
377 | 365 | | |
378 | 366 | | |
379 | | - | |
380 | | - | |
381 | 367 | | |
382 | 368 | | |
383 | 369 | | |
| |||
390 | 376 | | |
391 | 377 | | |
392 | 378 | | |
393 | | - | |
394 | 379 | | |
395 | 380 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 381 | | |
401 | 382 | | |
402 | 383 | | |
| |||
0 commit comments