mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.ibm.com>
To: Mimi Zohar <zohar@linux.ibm.com>, linux-integrity@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] evm: fix writing <securityfs>/evm overflow
Date: Thu, 29 Apr 2021 15:58:42 -0400	[thread overview]
Message-ID: <74b7bec9-0c88-0b33-5f9f-b4d2a08105c8@linux.ibm.com> (raw)
In-Reply-To: <20210429195332.310697-1-zohar@linux.ibm.com>


On 4/29/21 3:53 PM, Mimi Zohar wrote:
> EVM_SETUP_COMPLETE is defined as 0x80000000, which is larger than INT_MAX.
> The "-fno-strict-overflow" compiler option properly prevents signaling
> EVM that the EVM policy setup is complete.  Define and read an unsigned
> int.
>
> Fixes: f00d79750712 ("EVM: Allow userspace to signal an RSA key has been
> loaded")
> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>


Tested-by: Stefan Berger <stefanb@linux.ibm.com>

> ---
>   security/integrity/evm/evm_secfs.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c
> index bbc85637e18b..0007d3362754 100644
> --- a/security/integrity/evm/evm_secfs.c
> +++ b/security/integrity/evm/evm_secfs.c
> @@ -66,12 +66,13 @@ static ssize_t evm_read_key(struct file *filp, char __user *buf,
>   static ssize_t evm_write_key(struct file *file, const char __user *buf,
>   			     size_t count, loff_t *ppos)
>   {
> -	int i, ret;
> +	unsigned int i;
> +	int ret;
>   
>   	if (!capable(CAP_SYS_ADMIN) || (evm_initialized & EVM_SETUP_COMPLETE))
>   		return -EPERM;
>   
> -	ret = kstrtoint_from_user(buf, count, 0, &i);
> +	ret = kstrtouint_from_user(buf, count, 0, &i);
>   
>   	if (ret)
>   		return ret;

      reply	other threads:[~2021-04-29 20:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 19:53 Mimi Zohar
2021-04-29 19:58 ` Stefan Berger [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=74b7bec9-0c88-0b33-5f9f-b4d2a08105c8@linux.ibm.com \
    --to=stefanb@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zohar@linux.ibm.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®