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: <20120702153426.GC12542@infradead.org>
Date:	Mon, 2 Jul 2012 12:34:26 -0300
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Markus Trippelsdorf <markus@...ppelsdorf.de>,
	Namhyung Kim <namhyung.kim@....com>
Subject: Re: [PATCH] perf target: Ignore return value of strerror_r()
 explicitly

Em Mon, Jul 02, 2012 at 03:20:14PM +0900, Namhyung Kim escreveu:
> Since glibc 2.16 added the warn_unused_result (wur) attribute
> to the function, we should check the return value or ignore it
> explicitly.
> 
> Reported-by: Markus Trippelsdorf <markus@...ppelsdorf.de>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>

> +++ b/tools/perf/util/target.c
> @@ -111,7 +111,8 @@ int perf_target__strerror(struct perf_target *target, int errnum,
>  	const char *msg;
>  
>  	if (errnum >= 0) {
> -		strerror_r(errnum, buf, buflen);
> +		/* make glibc (>= 2.16) happy */
> +		(void)strerror_r(errnum, buf, buflen);

Is this really the best way to handle this?

What if some perf tool is buggy and passes an invalid errnum?  Shouldn't
we catch that?

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