summaryrefslogtreecommitdiff
path: root/kernel/capability.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2026-09-07 13:44:24 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2026-09-07 13:44:24 +0200
commit3ab04dcce43cd4fdaed94f08f4e6289be4921ea4 (patch)
tree61229f2644f48301f9d09722e390295cb55a2cf4 /kernel/capability.c
parenta9f09b5ea0c3db1e2d4c0f8d3ebdd612d8aa0366 (diff)
parentdf2908090cda368b01ff43709f51890076c56157 (diff)
downloadlinux-next-3ab04dcce43cd4fdaed94f08f4e6289be4921ea4.tar.gz
linux-next-3ab04dcce43cd4fdaed94f08f4e6289be4921ea4.zip
Merge drm/drm-next into drm-misc-next
Backmerging to get drm-misc-next up to v7.3-rc2. Requested for commit 3a2c4d55e32a ("treewide: refresh kmalloc_obj() conversions"). Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'kernel/capability.c')
-rw-r--r--kernel/capability.c19
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 */
/**