Skip to content

Commit 9f8b577

Browse files
andrea-parriliuw
authored andcommitted
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: Dexuan Cui <decui@microsoft.com> Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com> Reviewed-by: Dexuan Cui <decui@microsoft.com> Link: https://lore.kernel.org/r/20220301141135.2232-1-parri.andrea@gmail.com Signed-off-by: Wei Liu <wei.liu@kernel.org>
1 parent f443e37 commit 9f8b577

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

drivers/hv/vmbus_drv.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
7777

7878
/*
7979
* Hyper-V should be notified only once about a panic. If we will be
80-
* doing hyperv_report_panic_msg() later with kmsg data, don't do
81-
* the notification here.
80+
* doing hv_kmsg_dump() with kmsg data later, don't do the notification
81+
* here.
8282
*/
8383
if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
8484
&& hyperv_report_reg()) {
@@ -100,8 +100,8 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
100100

101101
/*
102102
* Hyper-V should be notified only once about a panic. If we will be
103-
* doing hyperv_report_panic_msg() later with kmsg data, don't do
104-
* the notification here.
103+
* doing hv_kmsg_dump() with kmsg data later, don't do the notification
104+
* here.
105105
*/
106106
if (hyperv_report_reg())
107107
hyperv_report_panic(regs, val, true);
@@ -1546,14 +1546,20 @@ static int vmbus_bus_init(void)
15461546
if (ret)
15471547
goto err_connect;
15481548

1549+
if (hv_is_isolation_supported())
1550+
sysctl_record_panic_msg = 0;
1551+
15491552
/*
15501553
* Only register if the crash MSRs are available
15511554
*/
15521555
if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
15531556
u64 hyperv_crash_ctl;
15541557
/*
1555-
* Sysctl registration is not fatal, since by default
1556-
* reporting is enabled.
1558+
* Panic message recording (sysctl_record_panic_msg)
1559+
* is enabled by default in non-isolated guests and
1560+
* disabled by default in isolated guests; the panic
1561+
* message recording won't be available in isolated
1562+
* guests should the following registration fail.
15571563
*/
15581564
hv_ctl_table_hdr = register_sysctl_table(hv_root_table);
15591565
if (!hv_ctl_table_hdr)

0 commit comments

Comments
 (0)