Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3705716pxk; Tue, 29 Sep 2020 04:18:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP8cbmSIs+tOHtuXZ3MN7s0FWGajZRQc5vY4hsP9Cd0UNLdQydy5eHclaRLXFV6BLof+7B X-Received: by 2002:a17:906:a88a:: with SMTP id ha10mr3513627ejb.532.1601378337786; Tue, 29 Sep 2020 04:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601378337; cv=none; d=google.com; s=arc-20160816; b=ZIJfaBZR9cBo4PEsKDjEuGxF5dkkRmhx1rlZ6ZoSMYVgjipK0yAJFDq8IH8eXsiN2B +Hxrjw+yEeEvw/mpj/gI+qlO+SeLO/L+dbGJXcvNsD2b381Nd8tOZY/Orzevoadoy02l vZxrF0ZdFDznoFHYwDnEFqEhCJ8H5+XMUZoqOooF8C2bwX3vxCJQ5mWhbP1d6Iy7o/Zz zAwd9KV+S1Xpn+0uZKSpKR8mPZFKsw76WUO3QxXxYVc/nFrscikMbptfFxqUPSI7HPg+ 1D35xu3p/rkr4mfv0NO8ew/w+38TGuSvukCZw6diWoVY6oWTL5lYnfifJa4O2ndi86bT vp9g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7FXjkSiXtC4impZ86jPUCp6I3tMDOGkWAhb7rE5nx/8=; b=yKPwYG4ERzvVlQTXuYvqXi9KH5euFjiJqiomYg+AycjBVeitCM2pIKxml3LeFVRcwC IqrU38zhJWVxwA37G1d7tYdSK2Vj3TYwImFTB6WQu9Bdv1+JjU06vajC1MWXysK5XvTC p44ZL4cN6mNBHLXWa2BExgQRo+Ki6rUQ75hb0BCXES3knjJxye+By+kskqRB/yC+4mio G+7BM4qEiFI/qK8/8SbGsnJ9CXUSzVD/opal8YfAG3zL57ErYAIZNtzvu1Zkf1+dQIXj Kn1n2YWZKE6q3JtizwoPTC+K+iXQO8q0vwK18oWvSmf0uPHCsQxE5koAvE9UV55/M31q 3nPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CgDCKRO8; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si2560261edw.171.2020.09.29.04.18.35; Tue, 29 Sep 2020 04:18:57 -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=CgDCKRO8; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729498AbgI2LPH (ORCPT + 99 others); Tue, 29 Sep 2020 07:15:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:59028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728600AbgI2LO6 (ORCPT ); Tue, 29 Sep 2020 07:14:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F2F39208FE; Tue, 29 Sep 2020 11:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601378098; bh=6A+nGAFiW6DeJuMtAODfJ5UG5bnGiIAvGmKH2xsQoVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CgDCKRO8oQXc4CBJYL4sJiAZlc/YqgW6bPIJBGM+z6j72SNpX0B6w9Ue6so29+MPc ks9nYjQQSOFC6srN/GjuhhHXtillA9ToEBvpSO/EfuwHCi5Ay/PkDYf70ItQ2OvnG7 dXlSwbb+PKS/AoRPQUt8lDmF8km0+8s8GK0vO1h4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fuqian Huang , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 4.14 020/166] m68k: q40: Fix info-leak in rtc_ioctl Date: Tue, 29 Sep 2020 12:58:52 +0200 Message-Id: <20200929105936.199322276@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105935.184737111@linuxfoundation.org> References: <20200929105935.184737111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 71c0867ecf20f..7fdf4e7799bcd 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; -- 2.25.1