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:	Thu, 3 May 2012 22:29:03 -0400
From:	Arnaud Lacombe <lacombar@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	namhyung.kim@....com, gregkh@...uxfoundation.org,
	a.p.zijlstra@...llo.nl, paulus@...ba.org, mingo@...hat.com,
	acme@...stprotocols.net, jolsa@...hat.com,
	linux-kernel@...r.kernel.org
Subject: Re: perf build failure on Linus's tree

Hi,

On Thu, May 3, 2012 at 10:14 PM, Arnaud Lacombe <lacombar@...il.com> wrote:
> Hi,
>
> On Thu, May 3, 2012 at 9:50 PM, David Miller <davem@...emloft.net> wrote:
>> From: Namhyung Kim <namhyung.kim@....com>
>> Date: Fri, 04 May 2012 10:37:24 +0900
>>
>>> Hi,
>>>
>>> On Thu, 3 May 2012 14:57:48 -0700, Greg KH wrote:
>>>> Linus's tree right now (3.4.rc5.67.gac001.dirty) gives me the following
>>>> build error when I try to build perf:
>>>>     CC util/parse-events-flex.o
>>>> <stdout>: In function ‘yy_get_next_buffer’:
>>>> <stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>>>> util/parse-events.l: In function ‘parse_events_lex’:
>>>> util/parse-events.l:122:1: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
>>>> cc1: all warnings being treated as errors
>>>>
>>>> Do you really want to ensure that flex's build warnings fail the build?
>>>>
>>>> thanks,
>>>>
>>>> greg k-h
>>>
>>> Can't reproduce it on my Fedora 17 box:
>>
>> Because your glibc headers probably don't have the warn_unused_result attribute
>> in the extern declaration of fwrite() like Greg's do.
>>
> `tools/perf/Makefile' adds -D_FORTIFY_SOURCE=2 on the compiler's
> command line, which in turn adds `__attribute__
> ((__warn_unused_result__))' to fwrite(3)'s prototypes, via `__wur'. I
> double checked by pre-processing `util/parse-events-flex.c' with the
> same arguments used by perf. fwrite(3) ends up being declared as:
>
> extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
>        size_t __n, FILE *__restrict __s) __attribute__
> ((__warn_unused_result__));
>
> So it is definitively enabled, and used, on Fedora.
>
> Above tests were done on Fedora 15/x86_64 and Fedora 16/x86_64, `perf'
> build without any issue there too.
>
it would seem that OpenSuse 12.1 and Fedora ship the same `flex'
package, upstream version 2.5.35. However, Fedora specifically harden
flex(1) wrt. lacks of fwrite(3)'s return value check, see [0] for the
exact patch.

 - Arnaud

[0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD

> my 0.2c,
>  - Arnaud
--
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