Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3744385pxk; Tue, 29 Sep 2020 05:20:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4o+P7aH4sKwug24bNXQxcGq6TE/QRqXsr4HPNXBaTG0z/QPrIKUewjHmXJuq7BCDDR7sz X-Received: by 2002:a05:6402:b72:: with SMTP id cb18mr2818557edb.299.1601382004343; Tue, 29 Sep 2020 05:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601382004; cv=none; d=google.com; s=arc-20160816; b=iwnQ3MWTBM69NGKk8eNW/jb0I0O2nvk3ecpeJbDmtAnwq9rmG17XJKUGxafVnkURlJ pZHTYLEAhOZybc00WZy+RXpAm7SWmCbUjoIHtme38RmrlWlnBHj2Hw+AsGTj6d+IGnW3 9y1B/e/vvIgWxy1e8dSQDDKVPba4pNEfpY3BvDW6pKqCd/nlqwMSQP/BgPlq4+cUY8zz vhbv+/tCGyF+j7agUpPMVrwkUUHt/Id3iA5Y/RHN/alH8OPoBPkH5EIk+2528LvsVV3M TiqWrMBNHGoc/nNNtWKWP+kslfmu2ILg7JOQ/jEFppjWjHl2Z8Rw1PwH9ZAZBQ6IMsTr WaAg== 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=zrQtOrs0oh4lvGIc5Vj4v1Ppy6WLuvS4jREUDOKwsiI=; b=TEZ303/OjahmhTQMYtzle07OBzZSUuonphK/mkzABjK6s1fv2zlYFOUXdCqMLqQyYC HDAL15FlOfSn4OkWZIs4U3PqZyyzqWniqupOu9jIkJh8yv60XTHcTmhcvR/vBXoUPyQP SFTpN2GKtl3My1cHGKxbGO7FZg314Cz4FsXuXMixOd3bMJxBRd0NIHZK1KO2gj1SOq3+ nbonCJZM4qVBWqOjZZWfUy64tgGFw5Fk552IMk2exnqy8jVOxHZ3jt7QZ92wb5ozuujN ozbxzohNeZGJB0x11sPIESA2FshOmpdjZiw+TMMnLkU5SyWj4p32j8X2/V6XZgIaBhSO F//A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BL958Mcy; 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 k4si2627451edq.351.2020.09.29.05.19.41; Tue, 29 Sep 2020 05:20:04 -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=BL958Mcy; 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 S1731975AbgI2MSI (ORCPT + 99 others); Tue, 29 Sep 2020 08:18:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:54450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729901AbgI2Lgv (ORCPT ); Tue, 29 Sep 2020 07:36:51 -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 65BE623A6C; Tue, 29 Sep 2020 11:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379101; bh=i8udMsq7B91YRlinCGJcAolZi31wX66Zkhx3F3Z/lnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BL958McyL7WvUd2nL3LZ8LVBn9PZMJx5xOamPlLklUglj/wNuUGklln18FNh6GAQk dZAHvbzXF7ZZhwOcX927BnehaxxyJ8f2d9ygFAqN9gMuWMYbSwENI8Dd5UKUSPqgz1 Kl7teJqXrqV3FWwAxDLLDtVLFfYBInHN3QkHb3Xg= 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 5.4 015/388] m68k: q40: Fix info-leak in rtc_ioctl Date: Tue, 29 Sep 2020 12:55:46 +0200 Message-Id: <20200929110011.220784133@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@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 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