summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCarlos Maiolino <cem@kernel.org>2026-08-04 11:45:52 +0200
committerCarlos Maiolino <cem@kernel.org>2026-08-21 09:09:54 +0200
commit1b91724d0bdc470ed8f353d1cc8d3e4123b51ed5 (patch)
tree5345c849846ff945166ca01dacbe36da0888b2ae /include
parente2f62a9744ebad3bcb6347a648e615026e9efeff (diff)
downloadlinux-next-1b91724d0bdc470ed8f353d1cc8d3e4123b51ed5.tar.gz
linux-next-1b91724d0bdc470ed8f353d1cc8d3e4123b51ed5.zip
capability: Add new capable_noaudit
In some situations (quota enforcement bypass in this case) we'd like to check for a specific capability without triggering spurious audit messages from security modules like selinux. Add a new helper so we don't need to use ns_capable_noaudit() directly. Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Serge Hallyn <sergeh@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/capability.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 37db92b3d6f8..f8532d92fcad 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -145,6 +145,7 @@ extern bool has_capability_noaudit(struct task_struct *t, int cap);
extern bool has_ns_capability_noaudit(struct task_struct *t,
struct user_namespace *ns, int cap);
extern bool capable(int cap);
+bool capable_noaudit(int cap);
extern bool ns_capable(struct user_namespace *ns, int cap);
extern bool ns_capable_noaudit(struct user_namespace *ns, int cap);
extern bool ns_capable_setid(struct user_namespace *ns, int cap);
@@ -167,6 +168,10 @@ static inline bool capable(int cap)
{
return true;
}
+static inline bool capable_noaudit(int cap)
+{
+ return true;
+}
static inline bool ns_capable(struct user_namespace *ns, int cap)
{
return true;