public inbox for linux-security-module@vger.kernel.org
 help / color / mirror / Atom feed
From: Fan Wu <wufan@linux.microsoft.com>
To: luca.boccassi@gmail.com, linux-security-module@vger.kernel.org
Cc: paul@paul-moore.com
Subject: Re: [PATCH v2 1/2] ipe: return -ESTALE instead of -EINVAL on update when new policy has a lower version
Date: Wed, 25 Sep 2024 13:53:22 -0700	[thread overview]
Message-ID: <86c607dd-6b21-4731-89e0-d60dfc3f6943@linux.microsoft.com> (raw)
In-Reply-To: <20240925204227.528624-1-luca.boccassi@gmail.com>



On 9/25/2024 1:42 PM, luca.boccassi@gmail.com wrote:
> From: Luca Boccassi <bluca@debian.org>
> 
> When loading policies in userspace we want a recognizable error when an
> update attempts to use an old policy, as that is an error that needs
> to be treated differently from an invalid policy. Use -ESTALE as it is
> clear enough for an update mechanism.
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> Reviewed-by: Serge Hallyn <serge@hallyn.com>
> ---
>   security/ipe/policy.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/ipe/policy.c b/security/ipe/policy.c
> index bf5aa97911e1..3a0069c6d5af 100644
> --- a/security/ipe/policy.c
> +++ b/security/ipe/policy.c
> @@ -107,7 +107,7 @@ int ipe_update_policy(struct inode *root, const char *text, size_t textlen,
>   	}
>   
>   	if (ver_to_u64(old) > ver_to_u64(new)) {
> -		rc = -EINVAL;
> +		rc = -ESTALE;
>   		goto err;
>   	}
>

Acked-by: Fan Wu <wufan@linux.microsoft.com>

I'm still in the process of applying kernel.org account, once I get 
everything setup I will include this in my tree.

If that process take too long time I may ask Paul to merge this from the 
lsm tree in next merge window.

-Fan

      parent reply	other threads:[~2024-09-25 20:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 20:42 [PATCH v2 1/2] ipe: return -ESTALE instead of -EINVAL on update when new policy has a lower version luca.boccassi
2024-09-25 20:42 ` [PATCH v2 2/2] ipe: also reject policy updates with the same version luca.boccassi
2024-09-25 20:56   ` Fan Wu
2024-09-25 20:53 ` Fan Wu [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=86c607dd-6b21-4731-89e0-d60dfc3f6943@linux.microsoft.com \
    --to=wufan@linux.microsoft.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=luca.boccassi@gmail.com \
    --cc=paul@paul-moore.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