2022-01-31 22:49:22

by Yang Li

[permalink] [raw]
Subject: [PATCH -next 1/3] apparmor: Fix match_mnt_path_str() and match_mnt() kernel-doc comment

Fix a spelling problem and change @mntpath to @path to remove warnings
found by running scripts/kernel-doc, which is caused by using 'make W=1'.

security/apparmor/mount.c:321: warning: Function parameter or member
'devname' not described in 'match_mnt_path_str'
security/apparmor/mount.c:321: warning: Excess function parameter
'devnme' description in 'match_mnt_path_str'
security/apparmor/mount.c:377: warning: Function parameter or member
'path' not described in 'match_mnt'
security/apparmor/mount.c:377: warning: Excess function parameter
'mntpath' description in 'match_mnt'

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
---
security/apparmor/mount.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/apparmor/mount.c b/security/apparmor/mount.c
index 23aafe68d49a..5cc5de062fc8 100644
--- a/security/apparmor/mount.c
+++ b/security/apparmor/mount.c
@@ -304,7 +304,7 @@ static int path_flags(struct aa_profile *profile, const struct path *path)
* @profile: the confining profile
* @mntpath: for the mntpnt (NOT NULL)
* @buffer: buffer to be used to lookup mntpath
- * @devnme: string for the devname/src_name (MAY BE NULL OR ERRPTR)
+ * @devname: string for the devname/src_name (MAY BE NULL OR ERRPTR)
* @type: string for the dev type (MAYBE NULL)
* @flags: mount flags to match
* @data: fs mount data (MAYBE NULL)
@@ -359,7 +359,7 @@ static int match_mnt_path_str(struct aa_profile *profile,
/**
* match_mnt - handle path matching for mount
* @profile: the confining profile
- * @mntpath: for the mntpnt (NOT NULL)
+ * @path: for the mntpnt (NOT NULL)
* @buffer: buffer to be used to lookup mntpath
* @devpath: path devname/src_name (MAYBE NULL)
* @devbuffer: buffer to be used to lookup devname/src_name
--
2.20.1.7.g153144c


2022-01-31 22:49:25

by Yang Li

[permalink] [raw]
Subject: [PATCH -next 2/3] apparmor: Fix some kernel-doc comments

Add the description of @ns_name, change function name aa_u16_chunck to
unpack_u16_chunk and verify_head to verify_header in kernel-doc comment
to remove warnings found by running scripts/kernel-doc, which is caused
by using 'make W=1'.

security/apparmor/policy_unpack.c:224: warning: expecting prototype for
aa_u16_chunck(). Prototype was for unpack_u16_chunk() instead
security/apparmor/policy_unpack.c:678: warning: Function parameter or
member 'ns_name' not described in 'unpack_profile'
security/apparmor/policy_unpack.c:950: warning: expecting prototype for
verify_head(). Prototype was for verify_header() instead

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
---
security/apparmor/policy_unpack.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 55dca9e3af50..3cc0fd2dff87 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -214,7 +214,7 @@ static void *kvmemdup(const void *src, size_t len)
}

/**
- * aa_u16_chunck - test and do bounds checking for a u16 size based chunk
+ * unpack_u16_chunk - test and do bounds checking for a u16 size based chunk
* @e: serialized data read head (NOT NULL)
* @chunk: start address for chunk of data (NOT NULL)
*
@@ -671,6 +671,7 @@ static int datacmp(struct rhashtable_compare_arg *arg, const void *obj)
/**
* unpack_profile - unpack a serialized profile
* @e: serialized data extent information (NOT NULL)
+ * @ns_name: pointer of newly allocated copy of %NULL in case of error
*
* NOTE: unpack profile sets audit struct if there is a failure
*/
@@ -939,7 +940,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
}

/**
- * verify_head - unpack serialized stream header
+ * verify_header - unpack serialized stream header
* @e: serialized data read head (NOT NULL)
* @required: whether the header is required or optional
* @ns: Returns - namespace if one is specified else NULL (NOT NULL)
--
2.20.1.7.g153144c

2022-01-31 22:49:51

by Yang Li

[permalink] [raw]
Subject: [PATCH 3/3] apparmor: Fix some kernel-doc comments

Don't use /** for non-kernel-doc comments and change function name
aa_mangle_name to mangle_name in kernel-doc comment to Remove some
warnings found by running scripts/kernel-doc, which is caused by
using 'make W=1'.

security/apparmor/apparmorfs.c:1503: warning: Cannot understand *
on line 1503 - I thought it was a doc line
security/apparmor/apparmorfs.c:1530: warning: Cannot understand *
on line 1530 - I thought it was a doc line
security/apparmor/apparmorfs.c:1892: warning: Cannot understand *
on line 1892 - I thought it was a doc line
security/apparmor/apparmorfs.c:108: warning: expecting prototype for
aa_mangle_name(). Prototype was for mangle_name() instead

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
---
security/apparmor/apparmorfs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 15efe4076fc4..4d7df859542d 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -98,7 +98,7 @@ static struct rawdata_f_data *rawdata_f_data_alloc(size_t size)
#endif

/**
- * aa_mangle_name - mangle a profile name to std profile layout form
+ * mangle_name - mangle a profile name to std profile layout form
* @name: profile name to mangle (NOT NULL)
* @target: buffer to store mangled name, same length as @name (MAYBE NULL)
*
@@ -1499,7 +1499,7 @@ int __aa_fs_create_rawdata(struct aa_ns *ns, struct aa_loaddata *rawdata)

/** fns to setup dynamic per profile/namespace files **/

-/**
+/*
*
* Requires: @profile->ns->lock held
*/
@@ -1526,7 +1526,7 @@ void __aafs_profile_rmdir(struct aa_profile *profile)
}
}

-/**
+/*
*
* Requires: @old->ns->lock held
*/
@@ -1888,7 +1888,7 @@ static void __aa_fs_list_remove_rawdata(struct aa_ns *ns)
__aa_fs_remove_rawdata(ent);
}

-/**
+/*
*
* Requires: @ns->lock held
*/
--
2.20.1.7.g153144c

2022-02-01 08:59:39

by John Johansen

[permalink] [raw]
Subject: Re: [PATCH -next 1/3] apparmor: Fix match_mnt_path_str() and match_mnt() kernel-doc comment

On 1/28/22 18:50, Yang Li wrote:
> Fix a spelling problem and change @mntpath to @path to remove warnings
> found by running scripts/kernel-doc, which is caused by using 'make W=1'.
>
> security/apparmor/mount.c:321: warning: Function parameter or member
> 'devname' not described in 'match_mnt_path_str'
> security/apparmor/mount.c:321: warning: Excess function parameter
> 'devnme' description in 'match_mnt_path_str'
> security/apparmor/mount.c:377: warning: Function parameter or member
> 'path' not described in 'match_mnt'
> security/apparmor/mount.c:377: warning: Excess function parameter
> 'mntpath' description in 'match_mnt'
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Yang Li <[email protected]>
Acked-by: John Johansen <[email protected]>

I have pulled this into my tree

> ---
> security/apparmor/mount.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/apparmor/mount.c b/security/apparmor/mount.c
> index 23aafe68d49a..5cc5de062fc8 100644
> --- a/security/apparmor/mount.c
> +++ b/security/apparmor/mount.c
> @@ -304,7 +304,7 @@ static int path_flags(struct aa_profile *profile, const struct path *path)
> * @profile: the confining profile
> * @mntpath: for the mntpnt (NOT NULL)
> * @buffer: buffer to be used to lookup mntpath
> - * @devnme: string for the devname/src_name (MAY BE NULL OR ERRPTR)
> + * @devname: string for the devname/src_name (MAY BE NULL OR ERRPTR)
> * @type: string for the dev type (MAYBE NULL)
> * @flags: mount flags to match
> * @data: fs mount data (MAYBE NULL)
> @@ -359,7 +359,7 @@ static int match_mnt_path_str(struct aa_profile *profile,
> /**
> * match_mnt - handle path matching for mount
> * @profile: the confining profile
> - * @mntpath: for the mntpnt (NOT NULL)
> + * @path: for the mntpnt (NOT NULL)
> * @buffer: buffer to be used to lookup mntpath
> * @devpath: path devname/src_name (MAYBE NULL)
> * @devbuffer: buffer to be used to lookup devname/src_name

2022-02-01 08:59:46

by John Johansen

[permalink] [raw]
Subject: Re: [PATCH 3/3] apparmor: Fix some kernel-doc comments

On 1/28/22 18:51, Yang Li wrote:
> Don't use /** for non-kernel-doc comments and change function name
> aa_mangle_name to mangle_name in kernel-doc comment to Remove some
> warnings found by running scripts/kernel-doc, which is caused by
> using 'make W=1'.
>
> security/apparmor/apparmorfs.c:1503: warning: Cannot understand *
> on line 1503 - I thought it was a doc line
> security/apparmor/apparmorfs.c:1530: warning: Cannot understand *
> on line 1530 - I thought it was a doc line
> security/apparmor/apparmorfs.c:1892: warning: Cannot understand *
> on line 1892 - I thought it was a doc line
> security/apparmor/apparmorfs.c:108: warning: expecting prototype for
> aa_mangle_name(). Prototype was for mangle_name() instead
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Yang Li <[email protected]>

Acked-by: John Johansen <[email protected]>

I have pulled this into my tree


> ---
> security/apparmor/apparmorfs.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index 15efe4076fc4..4d7df859542d 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -98,7 +98,7 @@ static struct rawdata_f_data *rawdata_f_data_alloc(size_t size)
> #endif
>
> /**
> - * aa_mangle_name - mangle a profile name to std profile layout form
> + * mangle_name - mangle a profile name to std profile layout form
> * @name: profile name to mangle (NOT NULL)
> * @target: buffer to store mangled name, same length as @name (MAYBE NULL)
> *
> @@ -1499,7 +1499,7 @@ int __aa_fs_create_rawdata(struct aa_ns *ns, struct aa_loaddata *rawdata)
>
> /** fns to setup dynamic per profile/namespace files **/
>
> -/**
> +/*
> *
> * Requires: @profile->ns->lock held
> */
> @@ -1526,7 +1526,7 @@ void __aafs_profile_rmdir(struct aa_profile *profile)
> }
> }
>
> -/**
> +/*
> *
> * Requires: @old->ns->lock held
> */
> @@ -1888,7 +1888,7 @@ static void __aa_fs_list_remove_rawdata(struct aa_ns *ns)
> __aa_fs_remove_rawdata(ent);
> }
>
> -/**
> +/*
> *
> * Requires: @ns->lock held
> */

2022-02-01 09:01:45

by John Johansen

[permalink] [raw]
Subject: Re: [PATCH -next 2/3] apparmor: Fix some kernel-doc comments

On 1/28/22 18:51, Yang Li wrote:
> Add the description of @ns_name, change function name aa_u16_chunck to
> unpack_u16_chunk and verify_head to verify_header in kernel-doc comment
> to remove warnings found by running scripts/kernel-doc, which is caused
> by using 'make W=1'.
>
> security/apparmor/policy_unpack.c:224: warning: expecting prototype for
> aa_u16_chunck(). Prototype was for unpack_u16_chunk() instead
> security/apparmor/policy_unpack.c:678: warning: Function parameter or
> member 'ns_name' not described in 'unpack_profile'
> security/apparmor/policy_unpack.c:950: warning: expecting prototype for
> verify_head(). Prototype was for verify_header() instead
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Yang Li <[email protected]>
Acked-by: John Johansen <[email protected]>

I have pulled this into my tree

> ---
> security/apparmor/policy_unpack.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
> index 55dca9e3af50..3cc0fd2dff87 100644
> --- a/security/apparmor/policy_unpack.c
> +++ b/security/apparmor/policy_unpack.c
> @@ -214,7 +214,7 @@ static void *kvmemdup(const void *src, size_t len)
> }
>
> /**
> - * aa_u16_chunck - test and do bounds checking for a u16 size based chunk
> + * unpack_u16_chunk - test and do bounds checking for a u16 size based chunk
> * @e: serialized data read head (NOT NULL)
> * @chunk: start address for chunk of data (NOT NULL)
> *
> @@ -671,6 +671,7 @@ static int datacmp(struct rhashtable_compare_arg *arg, const void *obj)
> /**
> * unpack_profile - unpack a serialized profile
> * @e: serialized data extent information (NOT NULL)
> + * @ns_name: pointer of newly allocated copy of %NULL in case of error
> *
> * NOTE: unpack profile sets audit struct if there is a failure
> */
> @@ -939,7 +940,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
> }
>
> /**
> - * verify_head - unpack serialized stream header
> + * verify_header - unpack serialized stream header
> * @e: serialized data read head (NOT NULL)
> * @required: whether the header is required or optional
> * @ns: Returns - namespace if one is specified else NULL (NOT NULL)