Page MenuHomeFreeBSD

x86: Export cpu_model[]
ClosedPublic

Authored by markj on Jan 2 2024, 10:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 17, 3:25 AM
Unknown Object (File)
Fri, May 10, 3:51 AM
Unknown Object (File)
Thu, May 9, 10:49 PM
Unknown Object (File)
Thu, May 9, 2:20 PM
Unknown Object (File)
Apr 27 2024, 8:40 PM
Unknown Object (File)
Feb 17 2024, 5:36 PM
Unknown Object (File)
Jan 18 2024, 3:22 PM
Unknown Object (File)
Jan 9 2024, 8:22 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.