Commit 2c61b30
selinux: shrink critical section in sel_write_load()
commit 868f31e upstream.
Currently sel_write_load() takes the policy mutex earlier than
necessary. Move the taking of the mutex later. This avoids
holding it unnecessarily across the vmalloc() and copy_from_user()
of the policy data.
Cc: stable@vger.kernel.org
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 9ba2a2c commit 2c61b30
1 file changed
Lines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
597 | | - | |
598 | | - | |
599 | 597 | | |
600 | 598 | | |
601 | 599 | | |
602 | | - | |
| 600 | + | |
603 | 601 | | |
604 | 602 | | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
| 603 | + | |
| 604 | + | |
609 | 605 | | |
610 | 606 | | |
611 | 607 | | |
612 | 608 | | |
613 | 609 | | |
| 610 | + | |
614 | 611 | | |
615 | 612 | | |
616 | 613 | | |
617 | | - | |
| 614 | + | |
618 | 615 | | |
619 | 616 | | |
620 | 617 | | |
621 | 618 | | |
622 | 619 | | |
623 | 620 | | |
624 | | - | |
| 621 | + | |
625 | 622 | | |
626 | 623 | | |
627 | 624 | | |
| |||
631 | 628 | | |
632 | 629 | | |
633 | 630 | | |
634 | | - | |
| 631 | + | |
635 | 632 | | |
| 633 | + | |
636 | 634 | | |
637 | 635 | | |
638 | 636 | | |
| |||
0 commit comments