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: <ZwYiTvrcVkF4W7O3@google.com>
Date: Tue, 8 Oct 2024 23:27:26 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Ravi Bangoria <ravi.bangoria@....com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
	eranian@...gle.com, mark.rutland@....com,
	alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
	irogers@...gle.com, adrian.hunter@...el.com,
	kan.liang@...ux.intel.com, tglx@...utronix.de, bp@...en8.de,
	dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	santosh.shukla@....com, ananth.narayan@....com,
	sandipan.das@....com
Subject: Re: [PATCH 5/8] perf/amd/ibs: Don't allow freq mode event creation
 through ->config interface

On Tue, Oct 08, 2024 at 11:00:37AM +0530, Ravi Bangoria wrote:
> >> Don't allow freq mode event creation through perf_event_attr->config
> >> interface.
> > 
> > Sounds reasonable.  I agree the freq mode should use the standard
> > interface using attr->sample_freq.  But I'm not sure if the behaivor is
> > defined when attr->freq is set and attr->sample_freq is 0.  Maybe this
> > should be handled in the generic code.
> 
> I also could not find any reason to allow {freq=1, sample_freq=0}, but:
> 
> 1) perf_event_open() allows it.
> 2) ioctl(PERF_EVENT_IOC_PERIOD) allows it.
> 3) all generic code explicitly checks for ->sample_freq != 0 wherever
>    ->freq == 1.
> 
> I will prepare and post a patch to reject such event and see if there
> are any objections.

Hmm.. now I think that the kernel won't treat it as a sampling event and
would ignore the attr.freq value.  Setting IOC_PERIOD to 0 would disable
sampling then.  Sorry for the noise.

Thanks,
Namhyung


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ