Skip to contentSkip to conversation

Xen missing prompt log when exec-sp=off

PATCH Superseded Jin Nan Wang 2 participants 4 messages Dec 16, 2019

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Xen missing prompt log when exec-sp=off

Fix a issue when user disable ETP exec-sp, xen missed a prompt log in dmesg.

---
 xen/arch/x86/hvm/vmx/vmx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
xen/arch/x86/hvm/vmx/vmx.c +5 -5
index 7970ba93e1..5e86dd0782 100644
@@ -2495,14 +2495,14 @@ const struct hvm_function_table * __init start_vmx(void)
     {
         bool cpu_has_bug_pschange_mc = has_if_pschange_mc();
 
+        /* Default to non-executable superpages on vulnerable hardware. */
         if ( opt_ept_exec_sp == -1 )
-        {
-            /* Default to non-executable superpages on vulnerable hardware. */
             opt_ept_exec_sp = !cpu_has_bug_pschange_mc;
 
-            if ( cpu_has_bug_pschange_mc )
-                printk("VMX: Disabling executable EPT superpages due to CVE-2018-12207\n");
-        }
+        if (opt_ept_exec_sp)
+            printk("VMX: Enable executable EPT superpages.\n");
+        else 
+            printk("VMX: Disabling executable EPT superpages due to CVE-2018-12207\n");
 
         vmx_function_table.hap_supported = 1;
         vmx_function_table.altp2m_supported = 1;
Signature · 7 lines
2.24.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 2 lines · Jin Nan Wang

Fix a issue when user disable ETP exec-sp, xen missed a prompt log in dmesg.

Why "missed" (and why "prompt")? I think the original intention was to log a message only when no command line option was given and the system would be vulnerable without the disabling.

Nevertheless two style remarks as well:

Quoted 6 lines
xen/arch/x86/hvm/vmx/vmx.c +0 -0
@@ -2495,14 +2495,14 @@ const struct hvm_function_table * __init start_vmx(void)
     {
         bool cpu_has_bug_pschange_mc = has_if_pschange_mc();
 

xen/arch/x86/hvm/vmx/vmx.c const struct hvm_function_table * __init start_vmx(void) · line 2502

Quoted 10 lines
xen/arch/x86/hvm/vmx/vmx.c +2 -5
+        /* Default to non-executable superpages on vulnerable hardware. */
         if ( opt_ept_exec_sp == -1 )
-        {
-            /* Default to non-executable superpages on vulnerable hardware. */
             opt_ept_exec_sp = !cpu_has_bug_pschange_mc;
 
-            if ( cpu_has_bug_pschange_mc )
-                printk("VMX: Disabling executable EPT superpages due to CVE-2018-12207\n");
-        }
+        if (opt_ept_exec_sp)

Missing blanks inside ().

xen/arch/x86/hvm/vmx/vmx.c const struct hvm_function_table * __init start_vmx(void) · line 2503

Quoted 1 line
xen/arch/x86/hvm/vmx/vmx.c +1 -0
+            printk("VMX: Enable executable EPT superpages.\n");

No full stop here please.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 6 lines · Jan Beulich
Quoted 2 lines · Jin Nan Wang

Fix a issue when user disable ETP exec-sp, xen missed a prompt log in dmesg.

Why "missed" (and why "prompt")? I think the original intention was to log a message only when no command line option was given and the system would be vulnerable without the disabling.

Yes, I guess it.

But when I test ept=exec-sp=off. I got a little confused.

Because of the "prompt" tell me it's disabled, at default.

when I add 'ept=exec-sp=off', the "prompt" is disappeared. It seems like it's ENABLED.

James

Quoted 20 lines

Nevertheless two style remarks as well:

Quoted 6 lines
xen/arch/x86/hvm/vmx/vmx.c +0 -0
@@ -2495,14 +2495,14 @@ const struct hvm_function_table * __init start_vmx(void)
      {
          bool cpu_has_bug_pschange_mc = has_if_pschange_mc();
 

xen/arch/x86/hvm/vmx/vmx.c const struct hvm_function_table * __init start_vmx(void) · line 2502

Quoted 10 lines
xen/arch/x86/hvm/vmx/vmx.c +2 -5
+        /* Default to non-executable superpages on vulnerable hardware. */
          if ( opt_ept_exec_sp == -1 )
-        {
-            /* Default to non-executable superpages on vulnerable hardware. */
              opt_ept_exec_sp = !cpu_has_bug_pschange_mc;
 
-            if ( cpu_has_bug_pschange_mc )
-                printk("VMX: Disabling executable EPT superpages due to CVE-2018-12207\n");
-        }
+        if (opt_ept_exec_sp)

Missing blanks inside ().

Quoted 4 lines

xen/arch/x86/hvm/vmx/vmx.c const struct hvm_function_table * __init start_vmx(void) · line 2503

Quoted 1 line
xen/arch/x86/hvm/vmx/vmx.c +1 -0
+            printk("VMX: Enable executable EPT superpages.\n");

No full stop here please.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
Quoted 9 lines · Jin Nan Wang
Quoted 6 lines · Jan Beulich
Quoted 2 lines · Jin Nan Wang

Fix a issue when user disable ETP exec-sp, xen missed a prompt log in dmesg.

Why "missed" (and why "prompt")? I think the original intention was to log a message only when no command line option was given and the system would be vulnerable without the disabling.

Quoted 8 lines

Yes, I guess it.

But when I test ept=exec-sp=off. I got a little confused.

Because of the "prompt" tell me it's disabled, at default.

when I add 'ept=exec-sp=off', the "prompt" is disappeared. It seems like it's ENABLED.

But when you don't see the log message (which btw is not a prompt) the next step then would be to check the command line. When you see "off" there, you'll know it's off. No confusion at all.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel