Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp885227pxk; Thu, 17 Sep 2020 20:18:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyr/wRvQo7MjQSYrUoWBYldkq9EFSKMDk3V6V84O+efI/LZzCvWZx3PrlJH4N6AF3zbhUyk X-Received: by 2002:a17:906:a2d2:: with SMTP id by18mr33442267ejb.37.1600399099322; Thu, 17 Sep 2020 20:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600399099; cv=none; d=google.com; s=arc-20160816; b=rGqsAHT88MJSjiVF59GBPipsWAQSDCHv0cFylUYiaLAF12ZmsR0sbgJc0O7CtLSGxe 70iEGTmnFf2oDmQ/DIjvZSNyONYLWRohPMrdIatzO9TNaKymFv7NV7EFKl+cji4PaZg8 aoXD+0tiM/Tz5pYq6A5pbGU+aEY9ZwUjXBWIyS9fmzXsCIVo+nBfDcMvuldl2pkyaCmv hz4TzniJDKWBcS7qP03uCdlML/Rk8exbLk8+8hMrdPHJF6uz1wVOGXoozFnx+wMHwKRw 2rzmLi06DrCQ19C14TjNHXYlSy2wvHJI5TAu2S0RNc+PEDH2dsnFHHIPdMkZ7bJef7Go OeQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zrQtOrs0oh4lvGIc5Vj4v1Ppy6WLuvS4jREUDOKwsiI=; b=Trr1lgcRBzaicm0L1zUcfzQzyg6OE3mCDvJTMwWcfB8kQEnfYhWI8Ef3fK1zJR9w4N kXARYX4XLo1Xe5+IBW3VJmW8eXNZMYcEzwIp4zoDeNKTwiKRTt/ZFpber6hwZPjR1BbD yExACXeilUzaddAJ0GtEXf9Q3V1eD1/nb6wfEX++LUG6Mzwiu4hAYaxZ80Jcfzg940e7 HxA/kZcRyUm/Jzoqcb/eO4jp8YLe6RYrKyHlr6kvDYBcigTzoMmiqoLBdQmmNCLkejyi 0w/Xhceroya+uoix+xna0FpRlrVgkHZGzZCdbZQhsGJx8+4kKZgMCV6S8Spb1tjANf8w pG4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vWYfWDOR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y89si1177936ede.586.2020.09.17.20.17.56; Thu, 17 Sep 2020 20:18:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vWYfWDOR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728220AbgIRDPG (ORCPT + 99 others); Thu, 17 Sep 2020 23:15:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:45880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIRCBb (ORCPT ); Thu, 17 Sep 2020 22:01:31 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 31CD0221EC; Fri, 18 Sep 2020 02:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394490; bh=i8udMsq7B91YRlinCGJcAolZi31wX66Zkhx3F3Z/lnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vWYfWDOR9P6U3YzSzZRX8oAZbTcX3T/vTxj7wIH2m/tsmqW4tY3qztosNJD4YqMSJ IgVD2D/4wF11lv7s6SKMSG7ppZLkvGme8zJRKtf3H6ORj3lpcG8/qAFrBwhr67VtnB W41+ew04x+tjBLDP8B/QH8X07baNu/F8eD1AGz7A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Fuqian Huang , Geert Uytterhoeven , Sasha Levin , linux-m68k@lists.linux-m68k.org Subject: [PATCH AUTOSEL 5.4 016/330] m68k: q40: Fix info-leak in rtc_ioctl Date: Thu, 17 Sep 2020 21:55:56 -0400 Message-Id: <20200918020110.2063155-16-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuqian Huang [ 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 Link: https://lore.kernel.org/r/20190927121544.7650-1-huangfq.daxian@gmail.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- arch/m68k/q40/config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index e63eb5f069995..f31890078197e 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -264,6 +264,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; -- 2.25.1