Re: [PATCHES perf-tools-next v2 00/13] Sanity check perf.data headers

From: Namhyung Kim

Date: Tue Apr 14 2026 - 02:21:30 EST


Hi Arnaldo,

On Fri, Apr 10, 2026 at 07:08:52PM -0300, Arnaldo Carvalho de Melo wrote:
> Hi,
>
> Sashiko recently mentioned the lack of sanity checking headers
> in perf.data files, that with a fuzzy or maliciously crafted file could
> make processing a perf.data file cause deleterious results.
>
> Add sanity checks and some arbitrarily generous upper limits to
> headers, if some are found to be questionable, lets tweak them in
> upcoming versions of this patchset.

Yep, I think it's a bit tricky to handle malformed files. But this
change would defend some of bad inputs. We can add more later.

>
> As registered in the Assisted-by tags in the patches, this was
> done using Claude code to speed up development, hopefully no
> hallucinations are present.

It looks fine.

>
> I'm also trying to get some of these checks into review-prompts
> skills, some of which were already merged, for instance:
>
> https://github.com/masoncl/review-prompts/commit/2bb2159893ea926e120105416e95629b9ef1508c

Thanks for doing this!
Namhyung