Re: [PATCH bpf-next] selftests/bpf: more precise cpu_mitigations state detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2025-06-11 at 10:54 +0800, Yafang Shao wrote:

[...]

> > +       config = gzopen("/proc/config.gz", "rb");
> 
> The /proc/config.gz file is not enabled in certain kernel releases.
> Should we also check "/boot/config-$(uname -r)" as an alternative?
>

Oh, my... It's a zoo, on Fedora the config location is:

  /usr/lib/modules/$(uname -r)/config

Tbh, I was fixing a problem with tests execution in a specific
environment. Adding a list of common locations for config is an
option.

Another option I tried but discarded is [1], where
kernel/cpu.c:cpu_mitigations variable is read directly by a BPF
program. But this is probably too heavy-handed.

[1]  https://github.com/eddyz87/bpf/tree/better-unpriv-disabled-detector

[...]






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux