diff options
| author | Mark Brown <broonie@kernel.org> | 2026-10-08 14:41:27 +0200 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-08 14:41:27 +0200 |
| commit | 9f19c8a019d7c1fb720133ca86154be1ccff39b5 (patch) | |
| tree | a7c9d53fd675abff61a63352822a3939171ad6aa /kernel/capability.c | |
| parent | 2597b3f0a0e46069ffd754112b2bd33406fb6eec (diff) | |
| parent | f52260f49b107fddbcf7c75f9cf2347a5031f0f7 (diff) | |
| download | linux-next-9f19c8a019d7c1fb720133ca86154be1ccff39b5.tar.gz linux-next-9f19c8a019d7c1fb720133ca86154be1ccff39b5.zip | |
Merge regmap/for-7.4 into regmap-next
Diffstat (limited to 'kernel/capability.c')
| -rw-r--r-- | kernel/capability.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel/capability.c b/kernel/capability.c index 829f49ae07b9..90e6ab62f6db 100644 --- a/kernel/capability.c +++ b/kernel/capability.c @@ -326,7 +326,6 @@ bool has_capability_noaudit(struct task_struct *t, int cap) { return has_ns_capability_noaudit(t, &init_user_ns, cap); } -EXPORT_SYMBOL(has_capability_noaudit); static bool ns_capable_common(struct user_namespace *ns, int cap, @@ -416,6 +415,24 @@ bool capable(int cap) return ns_capable(&init_user_ns, cap); } EXPORT_SYMBOL(capable); + +/** + * capable_noaudit - Determine if the current task has a superior + * capability in effect by checking the process's effective + * capabilities (unaudited). + * @cap: The capability to be tested for + * + * This is the same as capable(), except it uses CAP_OPT_NOAUDIT as to prevent + * issuing spurious audit messages. + * + * This sets PF_SUPERPRIV on the task if the capability is available on the + * assumption that it's about to be used. + */ +bool capable_noaudit(int cap) +{ + return ns_capable_noaudit(&init_user_ns, cap); +} +EXPORT_SYMBOL(capable_noaudit); #endif /* CONFIG_MULTIUSER */ /** |
