FreeBSD Bugzilla – Attachment 191850 Details for
Bug 192487
cpucontrol uses unsafe procedure to detect current microcode version
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for cpucontrol to read Intel CPU revision correctly
patch-usr.sbin-cpucontrol-intel.c (text/plain), 894 bytes, created by
Dan Lukes
on 2018-03-26 20:58:03 UTC
(
hide
)
Description:
Patch for cpucontrol to read Intel CPU revision correctly
Filename:
MIME Type:
Creator:
Dan Lukes
Created:
2018-03-26 20:58:03 UTC
Size:
894 bytes
patch
obsolete
>--- usr.sbin/cpucontrol/intel.c.orig 2017-12-05 21:17:12.000000000 +0100 >+++ usr.sbin/cpucontrol/intel.c 2018-03-26 20:51:47.223557000 +0200 >@@ -93,7 +93,8 @@ > void *fw_data; > size_t data_size, total_size; > cpuctl_msr_args_t msrargs = { >- .msr = MSR_IA32_PLATFORM_ID, >+ .msr = MSR_BIOS_SIGN, >+ .data = 0, > }; > cpuctl_cpuid_args_t idargs = { > .level = 1, /* Signature. */ >@@ -113,12 +114,18 @@ > WARN(0, "could not open %s for writing", dev); > return; > } >+ error = ioctl(devfd, CPUCTL_WRMSR, &msrargs); >+ if (error < 0) { >+ WARN(0, "ioctl(%s)", dev); >+ goto fail; >+ } > error = ioctl(devfd, CPUCTL_CPUID, &idargs); > if (error < 0) { > WARN(0, "ioctl(%s)", dev); > goto fail; > } > signature = idargs.data[0]; >+ msrargs.msr = MSR_IA32_PLATFORM_ID; > error = ioctl(devfd, CPUCTL_RDMSR, &msrargs); > if (error < 0) { > WARN(0, "ioctl(%s)", dev);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 192487
: 191850 |
191851