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, 18 Feb 2011 08:28:22 -0700
From:	David Ahern <daahern@...co.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	mingo@...e.hu, acme@...stprotocols.net, paulus@...ba.org
Subject: Re: [PATCH 1/3] perf events: fix WARN_ON_ONCE for 64-bit raw data,
 SW events



On 02/18/11 07:55, Peter Zijlstra wrote:
>> Another gotcha is in perf_output_sample there is:
>>             struct {
>>                 u32 size;
>>                 u32 data;
>>             } raw = {
>>                 .size = sizeof(u32),
>>                 .data = 0,
>>             };
>>
>> While that meets the 8-byte stride I was concerned that changing the
>> size field to u64 breaks ABI.
> 
> It would.
> 
> No, what you need to do is provide data that is sized such that it
> matches the 8b stride adding padding where needed.

I want to push a 64-bit counter to userspace. By definition it meets the
8-byte stride. Now how do I get sizeof(size field) + sizeof(data) to
meet an 8-byte stride? I can't when sizeof(size field) = 4. Ok, I can
pad the data with 4 bytes, but then I an api to tell the user to strip
the 4-byte pad. Seems like an odd way to go.

Why is an 8-byte stride preferred over a 4-bytes?

David

> 
> Anyway, I don't think you need RAW at all.
> 
--
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