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] [thread-next>] [day] [month] [year] [list]
Message-ID: <560AD436.1070005@tycho.nsa.gov>
Date:	Tue, 29 Sep 2015 14:11:02 -0400
From:	Stephen Smalley <sds@...ho.nsa.gov>
To:	Rasmus Villemoes <linux@...musvillemoes.dk>,
	Paul Moore <paul@...l-moore.com>,
	Eric Paris <eparis@...isplace.org>,
	James Morris <james.l.morris@...cle.com>,
	"Serge E. Hallyn" <serge@...lyn.com>
Cc:	linux-security-module@...r.kernel.org,
	linux-kernel@...r.kernel.org, selinux@...ho.nsa.gov
Subject: Re: [PATCH 3/5] selinux: use kmemdup in
 security_sid_to_context_core()

On 09/25/2015 06:34 PM, Rasmus Villemoes wrote:
> Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>

Acked-by:  Stephen Smalley <sds@...ho.nsa.gov>

> ---
>   security/selinux/ss/services.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
> index c550df0e0ff1..994c824a34c6 100644
> --- a/security/selinux/ss/services.c
> +++ b/security/selinux/ss/services.c
> @@ -1259,12 +1259,12 @@ static int security_sid_to_context_core(u32 sid, char **scontext,
>   			*scontext_len = strlen(initial_sid_to_string[sid]) + 1;
>   			if (!scontext)
>   				goto out;
> -			scontextp = kmalloc(*scontext_len, GFP_ATOMIC);
> +			scontextp = kmemdup(initial_sid_to_string[sid],
> +					    *scontext_len, GFP_ATOMIC);
>   			if (!scontextp) {
>   				rc = -ENOMEM;
>   				goto out;
>   			}
> -			strcpy(scontextp, initial_sid_to_string[sid]);
>   			*scontext = scontextp;
>   			goto out;
>   		}
>

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