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: <20250310124735.GR5880@noisy.programming.kicks-ass.net>
Date: Mon, 10 Mar 2025 13:47:35 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: mark.barnett@....com
Cc: mingo@...hat.com, acme@...nel.org, namhyung@...nel.org,
	irogers@...gle.com, ben.gainey@....com, deepak.surti@....com,
	ak@...ux.intel.com, will@...nel.org, james.clark@....com,
	mark.rutland@....com, alexander.shishkin@...ux.intel.com,
	jolsa@...nel.org, adrian.hunter@...el.com,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 3/5] perf: Allow adding fixed random jitter to the
 alternate sampling period

On Fri, Mar 07, 2025 at 08:22:45PM +0000, mark.barnett@....com wrote:
> @@ -9922,7 +9923,10 @@ static int __perf_event_overflow(struct perf_event *event,
>  	if (event->attr.alt_sample_period) {
>  		bool using_alt = hwc->using_alt_sample_period;
>  		u64 sample_period = (using_alt ? event->attr.sample_period
> -					       : event->attr.alt_sample_period);
> +					       : event->attr.alt_sample_period)
> +				  + (event->attr.jitter_alt_period
> +					? get_random_u32_below(2 << event->attr.jitter_alt_period)
> +					: 0);

So, ... this here is NMI context, right? Have you looked at the guts of
get_random_u32_below() ?

I would strongly suggest you go do so.

>  
>  		hwc->sample_period = sample_period;
>  		hwc->using_alt_sample_period = !using_alt;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ