Commit c147e13
smack: fix bug: unprivileged task can create labels
If an unprivileged task is allowed to relabel itself
(/smack/relabel-self is not empty),
it can freely create new labels by writing their
names into own /proc/PID/attr/smack/current
This occurs because do_setattr() imports
the provided label in advance,
before checking "relabel-self" list.
This change ensures that the "relabel-self" list
is checked before importing the label.
Fixes: 38416e5 ("Smack: limited capability for changing process label")
Signed-off-by: Konstantin Andreev <andreev@swemel.ru>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>1 parent 78fc6a9 commit c147e13
1 file changed
Lines changed: 27 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3778 | 3778 | | |
3779 | 3779 | | |
3780 | 3780 | | |
3781 | | - | |
3782 | | - | |
| 3781 | + | |
| 3782 | + | |
3783 | 3783 | | |
3784 | 3784 | | |
3785 | 3785 | | |
| |||
3790 | 3790 | | |
3791 | 3791 | | |
3792 | 3792 | | |
3793 | | - | |
3794 | | - | |
3795 | | - | |
| 3793 | + | |
| 3794 | + | |
| 3795 | + | |
3796 | 3796 | | |
3797 | 3797 | | |
3798 | 3798 | | |
3799 | 3799 | | |
3800 | 3800 | | |
3801 | | - | |
3802 | | - | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
3803 | 3810 | | |
3804 | 3811 | | |
3805 | | - | |
| 3812 | + | |
3806 | 3813 | | |
3807 | | - | |
3808 | | - | |
3809 | | - | |
3810 | | - | |
3811 | | - | |
3812 | | - | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
3813 | 3817 | | |
3814 | 3818 | | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
3815 | 3828 | | |
3816 | 3829 | | |
3817 | 3830 | | |
| |||
0 commit comments