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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1413159248.14699.47.camel@dhcp-9-2-203-236.watson.ibm.com>
Date:	Sun, 12 Oct 2014 20:14:08 -0400
From:	Mimi Zohar <zohar@...ux.vnet.ibm.com>
To:	Dmitry Kasatkin <d.kasatkin@...sung.com>
Cc:	linux-ima-devel@...ts.sourceforge.net,
	linux-security-module@...r.kernel.org,
	linux-kernel@...r.kernel.org, dmitry.kasatkin@...il.com
Subject: Re: [PATCH v2 3/4] ima: ignore empty and with whitespaces policy
 lines

On Fri, 2014-10-03 at 14:40 +0300, Dmitry Kasatkin wrote:
> Empty policy lines cause parsing failures which is, especially
> for new users, hard to spot. This patch prevents it.
> 
> It is now possible to 'cat policy > <securityfs>/ima/policy'.

The patch itself is fine, but dropping this comment as commit "6ccd045
ima: handle multiple rules per write" already added support to 'cat' the
policy.

Mimi

> Changes in v2:
> * strip leading blanks and tabs in rules to prevent parsing failures
> 
> Signed-off-by: Dmitry Kasatkin <d.kasatkin@...sung.com>
> ---
>  security/integrity/ima/ima_policy.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
> index bf232b9..d2c47d4 100644
> --- a/security/integrity/ima/ima_policy.c
> +++ b/security/integrity/ima/ima_policy.c
> @@ -696,8 +696,9 @@ ssize_t ima_parse_add_rule(char *rule)
> 
>  	p = strsep(&rule, "\n");
>  	len = strlen(p) + 1;
> +	p += strspn(p, " \t");
> 
> -	if (*p == '#')
> +	if (*p == '#' || *p == '\0')
>  		return len;
> 
>  	entry = kzalloc(sizeof(*entry), GFP_KERNEL);



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ