From: Boris Ostrovsky Date: Thu, 12 Jul 2018 17:27:00 +0000 (-0400) Subject: xen/x86/vpmu: Zero struct pt_regs before calling into sample handling code X-Git-Tag: v4.19-rc5~2^2~1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=70513d58751d7c6c1a0133557b13089b9f2e3e66;p=uclinux-h8%2Flinux.git xen/x86/vpmu: Zero struct pt_regs before calling into sample handling code Otherwise we may leak kernel stack for events that sample user registers. Reported-by: Mark Rutland Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky Cc: stable@vger.kernel.org --- diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c index 7d00d4ad44d4..95997e6c0696 100644 --- a/arch/x86/xen/pmu.c +++ b/arch/x86/xen/pmu.c @@ -478,7 +478,7 @@ static void xen_convert_regs(const struct xen_pmu_regs *xen_regs, irqreturn_t xen_pmu_irq_handler(int irq, void *dev_id) { int err, ret = IRQ_NONE; - struct pt_regs regs; + struct pt_regs regs = {0}; const struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); uint8_t xenpmu_flags = get_xenpmu_flags();