Repository navigation
Commit 2c83164
selinux: fall back to ref-walk if audit is required
commit 0188d5c upstream.
commit bda0be7 ("security: make inode_follow_link RCU-walk aware")
passed down the rcu flag to the SELinux AVC, but failed to adjust the
test in slow_avc_audit() to also return -ECHILD on LSM_AUDIT_DATA_DENTRY.
Previously, we only returned -ECHILD if generating an audit record with
LSM_AUDIT_DATA_INODE since this was only relevant from inode_permission.
Move the handling of MAY_NOT_BLOCK to avc_audit() and its inlined
equivalent in selinux_inode_permission() immediately after we determine
that audit is required, and always fall back to ref-walk in this case.
Fixes: bda0be7 ("security: make inode_follow_link RCU-walk aware")
Reported-by: Will Deacon <will@kernel.org>
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 36f4415 commit 2c83164
3 files changed
Lines changed: 17 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
| 427 | + | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
761 | | - | |
762 | | - | |
| 761 | + | |
763 | 762 | | |
764 | 763 | | |
765 | 764 | | |
| |||
772 | 771 | | |
773 | 772 | | |
774 | 773 | | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | 774 | | |
787 | 775 | | |
788 | 776 | | |
| |||
855 | 843 | | |
856 | 844 | | |
857 | 845 | | |
858 | | - | |
| 846 | + | |
859 | 847 | | |
860 | 848 | | |
861 | 849 | | |
862 | 850 | | |
863 | 851 | | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
| 852 | + | |
| 853 | + | |
868 | 854 | | |
869 | 855 | | |
870 | 856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3019 | 3019 | | |
3020 | 3020 | | |
3021 | 3021 | | |
3022 | | - | |
3023 | | - | |
| 3022 | + | |
3024 | 3023 | | |
3025 | 3024 | | |
3026 | 3025 | | |
| |||
3031 | 3030 | | |
3032 | 3031 | | |
3033 | 3032 | | |
3034 | | - | |
| 3033 | + | |
3035 | 3034 | | |
3036 | 3035 | | |
3037 | 3036 | | |
| |||
3078 | 3077 | | |
3079 | 3078 | | |
3080 | 3079 | | |
3081 | | - | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
3082 | 3085 | | |
3083 | 3086 | | |
3084 | 3087 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| |||
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | | - | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
0 commit comments