linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests
@ 2022-03-01 14:11 Andrea Parri (Microsoft)
  2022-03-01 20:29 ` Dexuan Cui
  0 siblings, 1 reply; 3+ messages in thread
From: Andrea Parri (Microsoft) @ 2022-03-01 14:11 UTC (permalink / raw)
  To: KY Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	Dexuan Cui, Michael Kelley
  Cc: linux-hyperv, linux-kernel, Andrea Parri (Microsoft)

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>
---
 drivers/hv/vmbus_drv.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 12a2b37e87f30..a963b970ffb2f 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -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
-	 * doing hyperv_report_panic_msg() later with kmsg data, don't do
-	 * the notification here.
+	 * doing hv_kmsg_dump() with kmsg data later, don't do the notification
+	 * here.
 	 */
 	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
 	    && hyperv_report_reg()) {
@@ -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
-	 * doing hyperv_report_panic_msg() later with kmsg data, don't do
-	 * the notification here.
+	 * doing hv_kmsg_dump() with kmsg data later, don't do the notification
+	 * here.
 	 */
 	if (hyperv_report_reg())
 		hyperv_report_panic(regs, val, true);
@@ -1546,14 +1546,20 @@ static int vmbus_bus_init(void)
 	if (ret)
 		goto err_connect;
 
+	if (hv_is_isolation_supported())
+		sysctl_record_panic_msg = 0;
+
 	/*
 	 * Only register if the crash MSRs are available
 	 */
 	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
 		u64 hyperv_crash_ctl;
 		/*
-		 * Sysctl registration is not fatal, since by default
-		 * reporting is enabled.
+		 * Panic message recording (sysctl_record_panic_msg)
+		 * 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);
 		if (!hv_ctl_table_hdr)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests
  2022-03-01 14:11 [PATCH] Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests Andrea Parri (Microsoft)
@ 2022-03-01 20:29 ` Dexuan Cui
  2022-03-29 12:02   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Dexuan Cui @ 2022-03-01 20:29 UTC (permalink / raw)
  To: Andrea Parri (Microsoft),
	KY Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	Michael Kelley (LINUX)
  Cc: linux-hyperv, linux-kernel

> From: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
> Sent: Tuesday, March 1, 2022 6:12 AM
> ...
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests
  2022-03-01 20:29 ` Dexuan Cui
@ 2022-03-29 12:02   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2022-03-29 12:02 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Andrea Parri (Microsoft),
	KY Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	Michael Kelley (LINUX),
	linux-hyperv, linux-kernel

On Tue, Mar 01, 2022 at 08:29:43PM +0000, Dexuan Cui wrote:
> > From: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
> > Sent: Tuesday, March 1, 2022 6:12 AM
> > ...
> > 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>

Applied to hyperv-fixes. Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-29 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 14:11 [PATCH] Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests Andrea Parri (Microsoft)
2022-03-01 20:29 ` Dexuan Cui
2022-03-29 12:02   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).