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:	Fri, 27 Feb 2015 09:58:23 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Peter Zijlstra <peterz@...radead.org>, namhyung@...nel.org,
	Naohiro Aota <naota@...sp.net>, Ingo Molnar <mingo@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH perf/core ] [BUGFIX] perf-probe: Fix get_real_path to
 free allocated memory in error path

(2015/02/26 23:46), Arnaldo Carvalho de Melo wrote:
> Em Thu, Feb 26, 2015 at 05:25:04PM +0900, Masami Hiramatsu escreveu:
>> Fix get_real_path to free allocated memory when comp_dir
>> is used for complementing path and getting an error.
> 
> 
> While reviewing this patch I noticed this is needed, ack?

Ah, right!

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>

Thank you,

> 
> - Arnaldo
> 
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 4a93bf433344..9526cf37682e 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -533,7 +533,7 @@ static int get_real_path(const char *raw_path, const char *comp_dir,
>  		else {
>  			if (access(raw_path, R_OK) == 0) {
>  				*new_path = strdup(raw_path);
> -				return 0;
> +				return *new_path ? 0 : -ENOMEM;
>  			} else
>  				return -errno;
>  		}
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com


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