mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Johansen <john.johansen@canonical.com>
To: Karl Mehltretter <kmehltretter@gmail.com>,
	Georgia Garcia <georgia.garcia@canonical.com>,
	Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>
Cc: apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] apparmor: Fix the return value in split_token_from_name() kernel-doc
Date: Tue, 27 Oct 2026 13:20:01 -0700	[thread overview]
Message-ID: <247a50dd-9fc3-460d-8ad2-1da34c0c5678@canonical.com> (raw)
In-Reply-To: <20260912000302.34565-1-kmehltretter@gmail.com>

On 9/11/26 17:03, Karl Mehltretter wrote:
> 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>

Acked-by: John Johansen <john.johansen@canonical.com>

I have pulled this into the apparmor tree

> ---
>   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)
>   {


      reply	other threads:[~2026-10-27 20:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12  0:03 Karl Mehltretter
2026-10-27 20:20 ` John Johansen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=247a50dd-9fc3-460d-8ad2-1da34c0c5678@canonical.com \
    --to=john.johansen@canonical.com \
    --cc=apparmor@lists.ubuntu.com \
    --cc=georgia.garcia@canonical.com \
    --cc=jmorris@namei.org \
    --cc=kmehltretter@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®