[Bug 179282] [amd64] [patch] add Intel SMAP for FreeBSD-CURRENT

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Nov 4 21:51:00 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=179282

--- Comment #5 from op at hardenedbsd.org ---
And this is the fix for the security issue:

diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 12166b785508..ae31a9d0e896 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1680,7 +1680,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
        msr = ((u_int64_t)GSEL(GCODE_SEL, SEL_KPL) << 32) |
              ((u_int64_t)GSEL(GUCODE32_SEL, SEL_UPL) << 48);
        wrmsr(MSR_STAR, msr);
-       wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D);
+       wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D|PSL_AC);

        /*
         * Temporary forge some valid pointer to PCB, for exception

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-amd64 mailing list