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: <4E938C08.2070801@schaufler-ca.com>
Date:	Mon, 10 Oct 2011 17:21:28 -0700
From:	Casey Schaufler <casey@...aufler-ca.com>
To:	Jarkko Sakkinen <jarkko.sakkinen@...el.com>
CC:	linux-kernel@...r.kernel.org,
	linux-security-module@...r.kernel.org,
	Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH] Smack: fix for /smack/access output, use string instead
 of byte

On 10/10/2011 4:29 AM, Jarkko Sakkinen wrote:
> Small fix for the output of access SmackFS file. Use string
> is instead of byte. Makes it easier to extend API if it is
> needed.
>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@...el.com>

Applied to git://gitorious.org/smack-next/kernel.git

> ---
>  security/smack/smackfs.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
> index 54f6e18..5498c4a 100644
> --- a/security/smack/smackfs.c
> +++ b/security/smack/smackfs.c
> @@ -1497,6 +1497,7 @@ static ssize_t smk_write_access(struct file *file, const char __user *buf,
>  {
>  	struct smack_rule rule;
>  	char *data;
> +	int res;
>  
>  	if (!capable(CAP_MAC_ADMIN))
>  		return -EPERM;
> @@ -1508,8 +1509,10 @@ static ssize_t smk_write_access(struct file *file, const char __user *buf,
>  	if (count < SMK_LOADLEN || smk_parse_rule(data, &rule))
>  		return -EINVAL;
>  
> -	data[0] = smk_access(rule.smk_subject, rule.smk_object,
> -			     rule.smk_access, NULL) == 0;
> +	res = smk_access(rule.smk_subject, rule.smk_object, rule.smk_access,
> +			  NULL);
> +	data[0] = res == 0 ? '1' : '0';
> +	data[1] = '\0';
>  
>  	simple_transaction_set(file, 1);
>  	return SMK_LOADLEN;

--
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