Page MenuHomeFreeBSD

x86: Export cpu_model[]
ClosedPublic

Authored by markj on Jan 2 2024, 10:56 PM.
Tags
None
Referenced Files
F100684450: D43281.id132160.diff
Fri, Oct 18, 8:37 AM
Unknown Object (File)
Wed, Oct 16, 4:57 AM
Unknown Object (File)
Tue, Oct 15, 3:40 PM
Unknown Object (File)
Tue, Oct 15, 3:40 PM
Unknown Object (File)
Mon, Oct 14, 12:16 PM
Unknown Object (File)
Sat, Oct 12, 8:35 AM
Unknown Object (File)
Fri, Oct 11, 12:57 AM
Unknown Object (File)
Thu, Oct 10, 9:25 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 55204
Build 52093: arc lint + arc unit

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.