lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <MW2PR2101MB105226EC2D8216C68069BA62D7F00@MW2PR2101MB1052.namprd21.prod.outlook.com>
Date:   Mon, 23 Mar 2020 17:20:11 +0000
From:   Michael Kelley <mikelley@...rosoft.com>
To:     "ltykernel@...il.com" <ltykernel@...il.com>,
        KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Wei Liu <liuwe@...rosoft.com>
CC:     Tianyu Lan <Tianyu.Lan@...rosoft.com>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        vkuznets <vkuznets@...hat.com>
Subject: RE: [PATCH V2 5/6] x86/Hyper-V: Report crash register data when
 sysctl_record_panic_msg is not set

From: Tianyu Lan <Tianyu.Lan@...rosoft.com> Sent: Monday, March 23, 2020 6:09 AM
> 
> When sysctl_record_panic_msg is not set, kmsg will
> not be reported to Hyper-V. Crash register data should
> be reported via hyperv_report_panic() in such case.

Tweaking the wording:

When sysctl_record_panic_msg is not set, the panic will
not be reported to Hyper-V via hyperv_report_panic_msg().
So the crash should be reported via hyperv_report_panic().

> 
> Signed-off-by: Tianyu Lan <Tianyu.Lan@...rosoft.com>
> ---
>  drivers/hv/vmbus_drv.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index d73fa8aa00a3..00447175c040 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -48,6 +48,18 @@ static int hyperv_cpuhp_online;
> 
>  static void *hv_panic_page;
> 
> +/*
> + * Boolean to control whether to report panic messages over Hyper-V.
> + *
> + * It can be set via /proc/sys/kernel/hyperv/record_panic_msg
> + */
> +static int sysctl_record_panic_msg = 1;
> +
> +static int hyperv_report_reg(void)
> +{
> +	return !sysctl_record_panic_msg || !hv_panic_page;
> +}
> +
>  static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
>  			      void *args)
>  {
> @@ -60,7 +72,7 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long
> val,
>  	 * message is available, just report kmsg to crash buffer.
>  	 */
>  	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
> -	    && !hv_panic_page) {
> +	    && hyperv_report_reg()) {
>  		regs = current_pt_regs();
>  		hyperv_report_panic(regs, val);
>  	}
> @@ -77,7 +89,7 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long
> val,
>  	 * Crash notify only can be triggered once. If crash notify
>  	 * message is available, just report kmsg to crash buffer.
>  	 */
> -	if (!hv_panic_page)
> +	if (hyperv_report_reg())
>  		hyperv_report_panic(regs, val);
>  	return NOTIFY_DONE;
>  }
> @@ -1265,13 +1277,6 @@ static void vmbus_isr(void)
>  	add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR, 0);
>  }
> 
> -/*
> - * Boolean to control whether to report panic messages over Hyper-V.
> - *
> - * It can be set via /proc/sys/kernel/hyperv/record_panic_msg
> - */
> -static int sysctl_record_panic_msg = 1;
> -
>  /*
>   * Callback from kmsg_dump. Grab as much as possible from the end of the kmsg
>   * buffer and call into Hyper-V to transfer the data.
> --
> 2.14.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ