[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191008204745.12040-1-yzhai003@ucr.edu>
Date: Tue, 8 Oct 2019 13:47:44 -0700
From: Yizhuo <yzhai003@....edu>
To: unlisted-recipients:; (no To-header on input)
Cc: Yizhuo <yzhai003@....edu>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] x86/hpet: Fix uninitialized use in hpet_msi_resume()
Inside function hpet_msi_resume(), variable "msg" could be
uninitialized if irq_chip_compose_msi_msg() returns -ENOSYS.
However, it is directly used in hpet_msi_write(), which is
potentially unsafe.
Signed-off-by: Yizhuo <yzhai003@....edu>
---
arch/x86/kernel/hpet.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index c6f791bc481e..5bc76819dd32 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -501,6 +501,7 @@ static int hpet_clkevt_msi_resume(struct clock_event_device *evt)
struct irq_data *data = irq_get_irq_data(hc->irq);
struct msi_msg msg;
+ memset(&msg, 0, sizeof(struct msi_msg));
/* Restore the MSI msg and unmask the interrupt */
irq_chip_compose_msi_msg(data, &msg);
hpet_msi_write(hc, &msg);
--
2.17.1
Powered by blists - more mailing lists