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]
Date:   Wed, 17 Jan 2018 10:31:56 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Thomas Richter <tmricht@...ux.vnet.ibm.com>
Cc:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        brueckner@...ux.vnet.ibm.com, schwidefsky@...ibm.com,
        heiko.carstens@...ibm.com
Subject: Re: [PATCH] perf record: Fix failed memory allocation for
 get_cpuid_str

Em Wed, Jan 17, 2018 at 02:16:11PM +0100, Thomas Richter escreveu:
> In x86 architecture dependend part function
> get_cpuid_str() mallocs a 128 byte buffer, but does not
> check if the memory allocation succeeded or not.
> When the memory allocation fails, function __get_cpuid()
> is called with first parameter being a NULL pointer.
> However this function references its first parameter
> and operates on a NULL pointer which might cause core
> dumps.

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Thomas Richter <tmricht@...ux.vnet.ibm.com>
> ---
>  tools/perf/arch/x86/util/header.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/arch/x86/util/header.c b/tools/perf/arch/x86/util/header.c
> index 33027c5e6f92..c6b5204e0280 100644
> --- a/tools/perf/arch/x86/util/header.c
> +++ b/tools/perf/arch/x86/util/header.c
> @@ -70,7 +70,7 @@ get_cpuid_str(void)
>  {
>  	char *buf = malloc(128);
>  
> -	if (__get_cpuid(buf, 128, "%s-%u-%X$") < 0) {
> +	if (buf && __get_cpuid(buf, 128, "%s-%u-%X$") < 0) {
>  		free(buf);
>  		return NULL;
>  	}
> -- 
> 2.13.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ