Commit c915297
smack: fix bug: unprivileged task can create labels
[ Upstream commit c147e13ea7fe9f118f8c9ba5e96cbd644b00d6b3 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Ulrich Hecht <uli@kernel.org>1 parent 5354a56 commit c915297
1 file changed
Lines changed: 27 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3655 | 3655 | | |
3656 | 3656 | | |
3657 | 3657 | | |
3658 | | - | |
3659 | | - | |
| 3658 | + | |
| 3659 | + | |
3660 | 3660 | | |
3661 | 3661 | | |
3662 | 3662 | | |
| |||
3667 | 3667 | | |
3668 | 3668 | | |
3669 | 3669 | | |
3670 | | - | |
3671 | | - | |
3672 | | - | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
3673 | 3673 | | |
3674 | 3674 | | |
3675 | 3675 | | |
3676 | 3676 | | |
3677 | 3677 | | |
3678 | | - | |
3679 | | - | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
3680 | 3687 | | |
3681 | 3688 | | |
3682 | | - | |
| 3689 | + | |
3683 | 3690 | | |
3684 | | - | |
3685 | | - | |
3686 | | - | |
3687 | | - | |
3688 | | - | |
3689 | | - | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
3690 | 3694 | | |
3691 | 3695 | | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
3692 | 3705 | | |
3693 | 3706 | | |
3694 | 3707 | | |
| |||
0 commit comments