Page MenuHomeFreeBSD

x86: Export cpu_model[]
ClosedPublic

Authored by markj on Jan 2 2024, 10:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 5:41 PM
Unknown Object (File)
Tue, Nov 5, 3:14 PM
Unknown Object (File)
Oct 18 2024, 8:37 AM
Unknown Object (File)
Oct 16 2024, 4:57 AM
Unknown Object (File)
Oct 15 2024, 3:40 PM
Unknown Object (File)
Oct 15 2024, 3:40 PM
Unknown Object (File)
Oct 14 2024, 12:16 PM
Unknown Object (File)
Oct 12 2024, 8:35 AM

Details

Summary

... and use it in linprocfs_docpuinfo(), rather than reading the value
using a sysctl. Note that linprocfs_docpuinfo() is only compiled for
x86.

Otherwise, programs reading the file from within a capsicum sandbox get
different results from unsandboxed programs, which is rather confusing.
And since cpuinfo now lets a sandboxed program find the CPU model, we
might as well annotate the sysctl with CTLFLAG_CAPRD.

PR: 276043
Reported by: Ricardo Branco <rbranco@suse.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jan 2 2024, 10:56 PM

(Yes, this should not be all in the same commit. I'll split it up before pushing.)

This revision is now accepted and ready to land.Jan 2 2024, 11:27 PM

Discussed with Mark on IRC the suitability of making hw.model available in capability mode.

I'd like to expand capsicum.4 with some more of the design intent of Capsicum, so that folks who don't have long experience with Capsicum can understand what sorts of sysctls should be expected to be available and why certain choices were made. But that need is present with or without this change.

Aside, note that hw.machine was only made available relatively recently, in 4a1c4de232af202aa5fa02c7adaa97174997ae61 (D28703).

I successfully tested the patch on a QEMU VM.