diff options
author | Mark Johnston <markj@FreeBSD.org> | 2025-03-10 03:00:59 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2025-03-10 03:00:59 +0000 |
commit | 9a30c8d347bf9aaa89277b6e5a275f737be8edce (patch) | |
tree | 17d31551e3b2d7711796d01d6058890ecc87228a /usr.sbin/bsdinstall | |
parent | 7ee1bdd094d376fdc547e8ca33e472f1d37a7d79 (diff) |
libdtrace: Fix an off-by-one in CPU ID handling
The illumos-specific _SC_CPUID_MAX is the largest CPU ID in the system. This
was mapped to _SC_NPROCESSORS_CONF, which is the total number of CPUs recognized
by the kernel. If CPU IDs are contiguous, as is the case on amd64 and arm64,
this value is one greater than the maximum ID. As a result, when consuming
per-CPU dtrace buffers, libdtrace tries to fetch from a non-existent CPU. This
is mostly harmless in practice, but still wrong.
As we don't have a sysconf value for the maximum CPU ID, add a wrapper which
fetches it using the kern.smp.maxid sysctl.
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D49243
Diffstat (limited to 'usr.sbin/bsdinstall')
0 files changed, 0 insertions, 0 deletions