Page MenuHomeFreeBSD

cpucontrol: Be more strict with input validation
ClosedPublic

Authored by markj on Jan 27 2026, 9:23 PM.
Tags
None
Referenced Files
F160337027: D54919.id170614.diff
Tue, Jun 23, 10:40 AM
Unknown Object (File)
Mon, Jun 22, 2:05 PM
Unknown Object (File)
Mon, Jun 22, 8:28 AM
Unknown Object (File)
Sun, Jun 21, 7:34 PM
Unknown Object (File)
Sat, Jun 20, 8:25 AM
Unknown Object (File)
May 21 2026, 5:27 PM
Unknown Object (File)
May 21 2026, 4:03 AM
Unknown Object (File)
May 20 2026, 10:11 AM
Subscribers

Details

Summary

Avoid truncating 32-bit values. This would have saved me a bit of time
when I was looking at a cpuid leaf on my system and typed 0x80000001f
instead of 0x8000001f.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70172
Build 67055: arc lint + arc unit

Event Timeline

markj requested review of this revision.Jan 27 2026, 9:23 PM
usr.sbin/cpucontrol/cpucontrol.c
122

Why not strtoumax() then?

125

I do not think that usage() is required there, user does know what she did, but mis-typed the input.

markj marked 2 inline comments as done.

Handle kib's comments.

usr.sbin/cpucontrol/cpucontrol.c
125

Ok, I just copied the prevailing pattern.

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