Skip to contentSkip to conversation

capability: fix doc warnings in capability.c

PATCH In review Baokun Li 2 participants 3 messages Jun 5, 2021 – Jun 8, 2021

Subsystems (2)
lore
Share & tools
lore

Baokun Li

author
#0 lore raw

PATCH 1/1 capability: fix doc warnings in capability.c

Fixes the following W=1 kernel build warning(s):

kernel/capability.c:490: warning: Function parameter or
member 'mnt_userns' not described in 'privileged_wrt_inode_uidgid'
kernel/capability.c:506: warning: Function parameter or
member 'mnt_userns' not described in 'capable_wrt_inode_uidgid'

---
 kernel/capability.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/capability.c +2 -0
index 46a361dde042..27a959aa897f 100644
@@ -480,6 +480,7 @@ EXPORT_SYMBOL(file_ns_capable);
 /**
  * privileged_wrt_inode_uidgid - Do capabilities in the namespace work over the inode?
  * @ns: The user namespace in question
+ * @mnt_userns: User namespace of the mount the inode was found from
  * @inode: The inode in question
  *
  * Return true if the inode uid and gid are within the namespace.
@@ -495,6 +496,7 @@ bool privileged_wrt_inode_uidgid(struct user_namespace *ns,
 /**
  * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped
  * @inode: The inode in question
+ * @mnt_userns: User namespace of the mount the inode was found from
  * @cap: The capability in question
  *
  * Return true if the current task has the given capability targeted at
Signature · 1 line
2.31.1
maintainer
#1 lore raw
Quoted 25 lines · Baokun Li

Fixes the following W=1 kernel build warning(s):

kernel/capability.c:490: warning: Function parameter or
member 'mnt_userns' not described in 'privileged_wrt_inode_uidgid'
kernel/capability.c:506: warning: Function parameter or
member 'mnt_userns' not described in 'capable_wrt_inode_uidgid'

---
 kernel/capability.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/capability.c +1 -0
index 46a361dde042..27a959aa897f 100644
@@ -480,6 +480,7 @@ EXPORT_SYMBOL(file_ns_capable);
 /**
  * privileged_wrt_inode_uidgid - Do capabilities in the namespace work over the inode?
  * @ns: The user namespace in question
+ * @mnt_userns: User namespace of the mount the inode was found from
  * @inode: The inode in question
  *
  * Return true if the inode uid and gid are within the namespace.

kernel/capability.c bool privileged_wrt_inode_uidgid(struct user_namespace *ns, · line 499

Quoted 4 lines
kernel/capability.c +1 -0
@@ -495,6 +496,7 @@ bool privileged_wrt_inode_uidgid(struct user_namespace *ns,
 /**
  * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped
  * @inode: The inode in question
+ * @mnt_userns: User namespace of the mount the inode was found from

The mnt_userns comes before the inode in this fn.

Quoted 5 lines
kernel/capability.c +0 -0
  * @cap: The capability in question
  *
  * Return true if the current task has the given capability targeted at
Signature · 1 line
2.31.1
#2 lore raw

Thank you for your advice.

I didn't notice the order of the parameters.

I'm about to send a patch v2 with the changes suggested by you.

Quoted 38 lines · Serge E. Hallyn
Quoted 25 lines · Baokun Li

Fixes the following W=1 kernel build warning(s):

kernel/capability.c:490: warning: Function parameter or
member 'mnt_userns' not described in 'privileged_wrt_inode_uidgid'
kernel/capability.c:506: warning: Function parameter or
member 'mnt_userns' not described in 'capable_wrt_inode_uidgid'

---
  kernel/capability.c | 2 ++
  1 file changed, 2 insertions(+)
kernel/capability.c +1 -0
index 46a361dde042..27a959aa897f 100644
@@ -480,6 +480,7 @@ EXPORT_SYMBOL(file_ns_capable);
  /**
   * privileged_wrt_inode_uidgid - Do capabilities in the namespace work over the inode?
   * @ns: The user namespace in question
+ * @mnt_userns: User namespace of the mount the inode was found from
   * @inode: The inode in question
   *
   * Return true if the inode uid and gid are within the namespace.

kernel/capability.c bool privileged_wrt_inode_uidgid(struct user_namespace *ns, · line 499

Quoted 4 lines
kernel/capability.c +1 -0
@@ -495,6 +496,7 @@ bool privileged_wrt_inode_uidgid(struct user_namespace *ns,
  /**
   * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped
   * @inode: The inode in question
+ * @mnt_userns: User namespace of the mount the inode was found from

The mnt_userns comes before the inode in this fn.

Quoted 5 lines
kernel/capability.c +0 -0
   * @cap: The capability in question
   *
   * Return true if the current task has the given capability targeted at
Signature · 1 line
2.31.1

.