Commit 9f8b577f authored by Andrea Parri (Microsoft)'s avatar Andrea Parri (Microsoft) Committed by Wei Liu

Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests

hv_panic_page might contain guest-sensitive information, do not dump it
over to Hyper-V by default in isolated guests.

While at it, update some comments in hyperv_{panic,die}_event().
Reported-by: default avatarDexuan Cui <decui@microsoft.com>
Signed-off-by: default avatarAndrea Parri (Microsoft) <parri.andrea@gmail.com>
Reviewed-by: default avatarDexuan Cui <decui@microsoft.com>
Link: https://lore.kernel.org/r/20220301141135.2232-1-parri.andrea@gmail.comSigned-off-by: default avatarWei Liu <wei.liu@kernel.org>
parent f443e374
...@@ -77,8 +77,8 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val, ...@@ -77,8 +77,8 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
/* /*
* Hyper-V should be notified only once about a panic. If we will be * Hyper-V should be notified only once about a panic. If we will be
* doing hyperv_report_panic_msg() later with kmsg data, don't do * doing hv_kmsg_dump() with kmsg data later, don't do the notification
* the notification here. * here.
*/ */
if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
&& hyperv_report_reg()) { && hyperv_report_reg()) {
...@@ -100,8 +100,8 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val, ...@@ -100,8 +100,8 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
/* /*
* Hyper-V should be notified only once about a panic. If we will be * Hyper-V should be notified only once about a panic. If we will be
* doing hyperv_report_panic_msg() later with kmsg data, don't do * doing hv_kmsg_dump() with kmsg data later, don't do the notification
* the notification here. * here.
*/ */
if (hyperv_report_reg()) if (hyperv_report_reg())
hyperv_report_panic(regs, val, true); hyperv_report_panic(regs, val, true);
...@@ -1546,14 +1546,20 @@ static int vmbus_bus_init(void) ...@@ -1546,14 +1546,20 @@ static int vmbus_bus_init(void)
if (ret) if (ret)
goto err_connect; goto err_connect;
if (hv_is_isolation_supported())
sysctl_record_panic_msg = 0;
/* /*
* Only register if the crash MSRs are available * Only register if the crash MSRs are available
*/ */
if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
u64 hyperv_crash_ctl; u64 hyperv_crash_ctl;
/* /*
* Sysctl registration is not fatal, since by default * Panic message recording (sysctl_record_panic_msg)
* reporting is enabled. * is enabled by default in non-isolated guests and
* disabled by default in isolated guests; the panic
* message recording won't be available in isolated
* guests should the following registration fail.
*/ */
hv_ctl_table_hdr = register_sysctl_table(hv_root_table); hv_ctl_table_hdr = register_sysctl_table(hv_root_table);
if (!hv_ctl_table_hdr) if (!hv_ctl_table_hdr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment