linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] capability: fix doc warnings in capability.c
@ 2021-06-05  6:26 Baokun Li
  2021-06-07 23:09 ` Serge E. Hallyn
  0 siblings, 1 reply; 3+ messages in thread
From: Baokun Li @ 2021-06-05  6:26 UTC (permalink / raw)
  To: serge, linux-security-module, linux-kernel
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1

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'

Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 kernel/capability.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/capability.c b/kernel/capability.c
index 46a361dde042..27a959aa897f 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -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
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] capability: fix doc warnings in capability.c
  2021-06-05  6:26 [PATCH -next] capability: fix doc warnings in capability.c Baokun Li
@ 2021-06-07 23:09 ` Serge E. Hallyn
  2021-06-08  1:14   ` libaokun (A)
  0 siblings, 1 reply; 3+ messages in thread
From: Serge E. Hallyn @ 2021-06-07 23:09 UTC (permalink / raw)
  To: Baokun Li
  Cc: serge, linux-security-module, linux-kernel, weiyongjun1,
	yuehaibing, yangjihong1, yukuai3

On Sat, Jun 05, 2021 at 02:26:02PM +0800, Baokun Li wrote:
> 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'
> 
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
>  kernel/capability.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/capability.c b/kernel/capability.c
> index 46a361dde042..27a959aa897f 100644
> --- a/kernel/capability.c
> +++ b/kernel/capability.c
> @@ -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

The mnt_userns comes before the inode in this fn.

>   * @cap: The capability in question
>   *
>   * Return true if the current task has the given capability targeted at
> -- 
> 2.31.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] capability: fix doc warnings in capability.c
  2021-06-07 23:09 ` Serge E. Hallyn
@ 2021-06-08  1:14   ` libaokun (A)
  0 siblings, 0 replies; 3+ messages in thread
From: libaokun (A) @ 2021-06-08  1:14 UTC (permalink / raw)
  To: Serge E. Hallyn
  Cc: linux-security-module, linux-kernel, weiyongjun1, yuehaibing,
	yangjihong1, yukuai3, libaokun1

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.

在 2021/6/8 7:09, Serge E. Hallyn 写道:
> On Sat, Jun 05, 2021 at 02:26:02PM +0800, Baokun Li wrote:
>> 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'
>>
>> Signed-off-by: Baokun Li <libaokun1@huawei.com>
>> ---
>>   kernel/capability.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/kernel/capability.c b/kernel/capability.c
>> index 46a361dde042..27a959aa897f 100644
>> --- a/kernel/capability.c
>> +++ b/kernel/capability.c
>> @@ -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
> The mnt_userns comes before the inode in this fn.
>
>>    * @cap: The capability in question
>>    *
>>    * Return true if the current task has the given capability targeted at
>> -- 
>> 2.31.1
> .

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-08  1:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-05  6:26 [PATCH -next] capability: fix doc warnings in capability.c Baokun Li
2021-06-07 23:09 ` Serge E. Hallyn
2021-06-08  1:14   ` libaokun (A)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).