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: <5693E0C6.2080509@iogearbox.net>
Date:	Mon, 11 Jan 2016 18:05:10 +0100
From:	Daniel Borkmann <daniel@...earbox.net>
To:	Wang Nan <wangnan0@...wei.com>, davem@...emloft.net,
	acme@...nel.org
CC:	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	pi3orama@....com, lizefan@...wei.com,
	Adrian Hunter <adrian.hunter@...el.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	David Ahern <dsahern@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Yunlong Song <yunlong.song@...wei.com>
Subject: Re: [PATCH net-next] perf/core: Put size of a sample at the end of
 it by PERF_SAMPLE_TAILSIZE

Hi Wang,

On 01/11/2016 02:24 PM, Wang Nan wrote:
> This patch introduces a PERF_SAMPLE_TAILSIZE flag which allows a size
> field attached at the end of a sample. The idea comes from [1] that,
> with tie size at tail of an event, it is possible for user program who
> read from the ring buffer parse events backward.
>
> For example:
>
>     head
>      |
>      V
>   +--+---+-------+----------+------+---+
>   |E6|...|   B  8|   C    11|  D  7|E..|
>   +--+---+-------+----------+------+---+
>
> In this case, from the 'head' pointer provided by kernel, user program
> can first see '6' by (*(head - sizeof(u64))), then it can get the start
> pointer of record 'E', then it can read size and find start position
> of record D, C, B in similar way.
>
> The implementation is easy: adding a PERF_SAMPLE_TAILSIZE flag, makes
> perf_output_sample() output size at the end of a sample.
>
> Following things are done for ensure the ring buffer is safe for
> backward parsing:
>
>   - Don't allow two events with different PERF_SAMPLE_TAILSIZE setting
>     set their output to each other;
>
>   - For non-sample events, also output tailsize if required.
>
> This patch has a limitation for perf:
>
> Before reading such ring buffer, perf must ensure all events which may
> output to it is already stopped, so the 'head' pointer it get is the
> end of the last record.
>
> [1] http://lkml.kernel.org/g/1449063499-236703-1-git-send-email-wangnan0@huawei.com
>
> Signed-off-by: Wang Nan <wangnan0@...wei.com>
> Cc: Adrian Hunter <adrian.hunter@...el.com>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: David Ahern <dsahern@...il.com>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Yunlong Song <yunlong.song@...wei.com>
> Cc: David S. Miller <davem@...emloft.net>
[...]

As this seems unrelated to networking, net-next tree seems not really appropriate?

Cheers,
Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ