lkml.org 
[lkml]   [2021]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 07/12] evm: Allow xattr/attr operations for portable signatures
From
Date
Hi Roberto,

> diff --git a/include/linux/integrity.h b/include/linux/integrity.h
> index 2271939c5c31..2ea0f2f65ab6 100644
> --- a/include/linux/integrity.h
> +++ b/include/linux/integrity.h
>
> @@ -238,9 +241,12 @@ static enum integrity_status evm_verify_hmac(struct dentry *dentry,
> break;
> }
>
> - if (rc)
> - evm_status = (rc == -ENODATA) ?
> - INTEGRITY_NOXATTRS : INTEGRITY_FAIL;
> + if (rc) {
> + evm_status = INTEGRITY_NOXATTRS;
> + if (rc != -ENODATA)
> + evm_status = evm_immutable ?
> + INTEGRITY_FAIL_IMMUTABLE : INTEGRITY_FAIL;

The original code made an exception for the -ENODATA case. Using a
ternary operator made sense in that case. Inverting the test makes
the code less readable. Please use the standard "if" statement
instead.

thanks,

Mimi

\
 
 \ /
  Last update: 2021-05-03 02:14    [W:0.300 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site