Commit b068fc0
perf: Refactor permissions check into perf_check_permission()
Refactor the permission check in perf_event_open() into a helper
perf_check_permission(). This makes the permission check logic more
readable (because we no longer have a negated disjunction). Add a
comment mentioning the ptrace check also checks the uid.
No functional change intended.
Signed-off-by: Marco Elver <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Dmitry Vyukov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]1 parent 9d7a6c9 commit b068fc0
1 file changed
+32
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11917 | 11917 | | |
11918 | 11918 | | |
11919 | 11919 | | |
| 11920 | + | |
| 11921 | + | |
| 11922 | + | |
| 11923 | + | |
| 11924 | + | |
| 11925 | + | |
| 11926 | + | |
| 11927 | + | |
| 11928 | + | |
| 11929 | + | |
| 11930 | + | |
| 11931 | + | |
| 11932 | + | |
| 11933 | + | |
| 11934 | + | |
| 11935 | + | |
| 11936 | + | |
| 11937 | + | |
| 11938 | + | |
| 11939 | + | |
| 11940 | + | |
| 11941 | + | |
| 11942 | + | |
| 11943 | + | |
| 11944 | + | |
| 11945 | + | |
| 11946 | + | |
| 11947 | + | |
| 11948 | + | |
| 11949 | + | |
| 11950 | + | |
11920 | 11951 | | |
11921 | 11952 | | |
11922 | 11953 | | |
| |||
12158 | 12189 | | |
12159 | 12190 | | |
12160 | 12191 | | |
12161 | | - | |
12162 | | - | |
12163 | | - | |
12164 | 12192 | | |
12165 | 12193 | | |
12166 | 12194 | | |
12167 | 12195 | | |
12168 | | - | |
12169 | | - | |
12170 | | - | |
12171 | | - | |
12172 | | - | |
12173 | | - | |
12174 | | - | |
12175 | | - | |
12176 | | - | |
12177 | | - | |
12178 | | - | |
12179 | | - | |
12180 | | - | |
12181 | | - | |
12182 | | - | |
12183 | | - | |
12184 | | - | |
12185 | | - | |
12186 | | - | |
12187 | | - | |
12188 | 12196 | | |
12189 | | - | |
12190 | | - | |
12191 | 12197 | | |
12192 | 12198 | | |
12193 | 12199 | | |
12194 | 12200 | | |
12195 | 12201 | | |
12196 | 12202 | | |
12197 | | - | |
| 12203 | + | |
12198 | 12204 | | |
12199 | 12205 | | |
12200 | 12206 | | |
| |||
0 commit comments