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: <4B9BE952.7080808@schaufler-ca.com>
Date:	Sat, 13 Mar 2010 11:36:50 -0800
From:	Casey Schaufler <casey@...aufler-ca.com>
To:	wzt.wzt@...il.com
CC:	linux-kernel@...r.kernel.org,
	linux-security-module@...r.kernel.org,
	Stephen Smalley <sds@...ho.nsa.gov>,
	Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH] Security: Add break judge to smk_import_entry() in security/smack/smack_access.c

wzt.wzt@...il.com wrote:
> In smk_import_entry(), smack[i] = '\0' was set if found = 1, so:
> if (found)
> 	smack[i] = '\0';
> No need to continue again, just can break the loop.
>
> Signed-off-by: Zhitong Wang <zhitong.wangzt@...baba-inc.com>
>   
Nacked-by: Casey Schaufler <casey@...aufler-ca.com>
> ---
>  security/smack/smack_access.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
> index 0f9ac81..0e064e8 100644
> --- a/security/smack/smack_access.c
> +++ b/security/smack/smack_access.c
> @@ -318,7 +318,7 @@ struct smack_known *smk_import_entry(const char *string, int len)
>  
>  	for (i = 0, found = 0; i < SMK_LABELLEN; i++) {
>  		if (found)
> -			smack[i] = '\0';
> +			break;
>  		else if (i >= len || string[i] > '~' || string[i] <= ' ' ||
>  			 string[i] == '/' || string[i] == '"' ||
>  			 string[i] == '\\' || string[i] == '\'') {
>   
The intention of this code is to fill the label. Yes, I could zero the
target in advance and break here but would that be significantly better?
I don't see that it would be. In any case, the change you suggest would
not suffice by itself.

Are you looking for a real project to work on? I could suggest a
thing or two that would be much more welcome than these attempts
at pointless code change.



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