lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Dec 2017 12:00:01 -0600
From:   "Serge E. Hallyn" <serge@...lyn.com>
To:     Vasyl Gomonovych <gomonovych@...il.com>
Cc:     zohar@...ux.vnet.ibm.com, dmitry.kasatkin@...il.com,
        james.l.morris@...cle.com, serge@...lyn.com,
        linux-integrity@...r.kernel.org,
        linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ima: Fix warn potential negative subtraction from max

Quoting Vasyl Gomonovych (gomonovych@...il.com):
> Found by smatch:
> security/integrity/ima/ima_queue.c:122 ima_add_digest_entry() warn:
> potential negative subtraction from max '(~0)- size'
> 
> Signed-off-by: Vasyl Gomonovych <gomonovych@...il.com>
> ---
>  security/integrity/ima/ima_queue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c
> index a02a86d51102..446018478b81 100644
> --- a/security/integrity/ima/ima_queue.c
> +++ b/security/integrity/ima/ima_queue.c
> @@ -116,7 +116,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry,
>  	}
>  
>  	if (binary_runtime_size != ULONG_MAX) {
> -		int size;
> +		unsigned int size;

Hm, but get_binary_runtime_size() returns an int.

>  
>  		size = get_binary_runtime_size(entry);
>  		binary_runtime_size = (binary_runtime_size < ULONG_MAX - size) ?
> -- 
> 1.9.1

Powered by blists - more mailing lists