Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH] apparmor: Fix the return value in split_token_from_name() kernel-doc
@ 2026-09-12  0:03 Karl Mehltretter
  0 siblings, 0 replies; only message in thread
From: Karl Mehltretter @ 2026-09-12  0:03 UTC (permalink / raw)
  To: John Johansen, Georgia Garcia, Paul Moore, James Morris,
	Serge E. Hallyn
  Cc: Karl Mehltretter, apparmor, linux-security-module, linux-kernel

split_token_from_name() returns ERR_PTR(-EINVAL) for malformed input,
but its kernel-doc describes NULL as the failure result. NULL is instead
a successful result when the name following the token is empty.

Document all three results: the name, NULL for an empty name, and an
error pointer for malformed input.

Fixes: 63e2b423771a ("AppArmor: userspace interfaces")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
 security/apparmor/procattr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/security/apparmor/procattr.c b/security/apparmor/procattr.c
index c07b6e8fd9c93c73ea82361af83337774e6d1bdf..cfc45db43aa0c7418604fbba0e4c30a90f0f6cbd 100644
--- a/security/apparmor/procattr.c
+++ b/security/apparmor/procattr.c
@@ -74,7 +74,8 @@ int aa_getprocattr(struct aa_label *label, char **string, bool newline)
  * @args: string to parse  (NOT NULL)
  * @token: stores returned parsed token value  (NOT NULL)
  *
- * Returns: start position of name after token else NULL on failure
+ * Returns: the name following the token, %NULL if the name is empty, or
+ * ERR_PTR(-EINVAL) if the input is malformed.
  */
 static char *split_token_from_name(const char *op, char *args, u64 *token)
 {
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-12  0:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-12  0:03 [PATCH] apparmor: Fix the return value in split_token_from_name() kernel-doc Karl Mehltretter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox