summaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorFuqian Huang <huangfq.daxian@gmail.com>2019-09-27 20:15:44 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 11:11:50 +0200
commit46f387de6a3cb4a5b619bfdb9915b5d4200b7d4d (patch)
tree05708fcbaa2c0ed179d0b927cf9768a39ae3dc65 /arch/m68k
parent1d7e1b1fd11c4217833810948b617672bca5f563 (diff)
downloadlinux-stable-46f387de6a3cb4a5b619bfdb9915b5d4200b7d4d.tar.gz
linux-stable-46f387de6a3cb4a5b619bfdb9915b5d4200b7d4d.tar.bz2
linux-stable-46f387de6a3cb4a5b619bfdb9915b5d4200b7d4d.zip
m68k: q40: Fix info-leak in rtc_ioctl
[ Upstream commit 7cf78b6b12fd5550545e4b73b35dca18bd46b44c ] When the option is RTC_PLL_GET, pll will be copied to userland via copy_to_user. pll is initialized using mach_get_rtc_pll indirect call and mach_get_rtc_pll is only assigned with function q40_get_rtc_pll in arch/m68k/q40/config.c. In function q40_get_rtc_pll, the field pll_ctrl is not initialized. This will leak uninitialized stack content to userland. Fix this by zeroing the uninitialized field. Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com> Link: https://lore.kernel.org/r/20190927121544.7650-1-huangfq.daxian@gmail.com Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/q40/config.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index e90fe903613e..4e5f04d33318 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -303,6 +303,7 @@ static int q40_get_rtc_pll(struct rtc_pll_info *pll)
{
int tmp = Q40_RTC_CTRL;
+ pll->pll_ctrl = 0;
pll->pll_value = tmp & Q40_RTC_PLL_MASK;
if (tmp & Q40_RTC_PLL_SIGN)
pll->pll_value = -pll->pll_value;