From patchwork Thu May 12 11:20:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 12847596 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E48ACC433F5 for ; Thu, 12 May 2022 11:21:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2B0771A98; Thu, 12 May 2022 13:20:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2B0771A98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652354500; bh=Lk9uj1xbHFDojk0Vz617wIxJ6WKhY/yj7alJ+ki14Rk=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=C0ZGZS/i2xG6ffhaBECb1/lRjIbkga1mSUOgJDqUmxsMHnD6zD1EVKDHKIoNrK0Ef 89keie1Kf+HSSEoKwkYHhNniLb/fb7TvoOCanvvnMGVQSvuzEKdbs3dkQAIOqySWS+ 2ueT6bQwswQcEPntTU61Z2ssuxgZRRcA7nOlUMVw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CB515F80154; Thu, 12 May 2022 13:20:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E85D3F80245; Thu, 12 May 2022 13:20:48 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C7022F8010B for ; Thu, 12 May 2022 13:20:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C7022F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="AtRQRrHw"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="rXIknwet" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5CCCC5C010D; Thu, 12 May 2022 07:20:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 12 May 2022 07:20:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1652354441; x=1652440841; bh=sY0qpOQXPg mJFgvkNCEQIW8UjRDURZNp7xYymx3dOoI=; b=AtRQRrHwTS+NvHV/uP+id/cHHq hNDx8pbwyo2UdyBlxttjzjI8gUSEWnWWrt2Jq68ogddYhJPy8klFDb2R8FlCY8Aj MDQ8McA8JNFQdHkXQHcgaRtGMy9RLX2W0oYGOu54722s23aygZJBzAT3d0pIkAL6 tIiY3MWbnvnYK7mcZVBgryBYDkd6xisJbnkA7XuKZoYCIHA2yu0AKWNjqT3FWl11 zCvECgcMuZ2QmZM7S9nPFcKn6Z+XVVHTnJpx2pfZPgaBMZ9fXFg5iyBBp7FjIn6B DJTZCJdpEe2jyM9EHfkCs3+iUK70s8Pp4NRpNuYiQZp5sCu1m7rLOAXc4GJg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1652354441; x=1652440841; bh=s Y0qpOQXPgmJFgvkNCEQIW8UjRDURZNp7xYymx3dOoI=; b=rXIknwetozsmqir+0 ljyIE4Har33F35h4sKqyWm/RjjDbQZlHB1rhF1qRxB1uQGTBI5bTEnqixLCVw3RL tzXaaRviqr2iU9+HlDKM2DnxmlaysUDf1GZNpIe7YeTCYTV9/9EHuVuhWd3dvSq0 AzsY1EEtD8FG5pkTHVYci/J9135+l78Ml44jq6JirKhdmeWb2Ofd9SrLMojoKMOG 2m+VPCd7QSZUXasTOfQab89/7rq4d7PMrxRkPON7hYynN9NRac5ocYpQ32ekam6b HkX7dxr2nG92bnMKUDPk60pOnJ7Qet85CLjuds2XhatrbRwLQkevsRgRHHDr7TIW vtTgQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgeejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghshhhi ucfurghkrghmohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhpqe enucggtffrrghtthgvrhhnpeffvdeuleffveekudfhteejudffgefhtedtgfeutdfgvdfg ueefudehveehveekkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 May 2022 07:20:39 -0400 (EDT) From: Takashi Sakamoto To: tiwai@suse.de, stefanr@s5r6.in-berlin.de Subject: [PATCH] firewire: cdev: fix potential leak of kernel stack due to uninitialized value Date: Thu, 12 May 2022 20:20:37 +0900 Message-Id: <20220512112037.103142-1-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, linux1394-devel@lists.sourceforge.net, Dan Carpenter X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Recent change brings potential leak of value on kernel stack to userspace due to uninitialized value. This commit fixes the bug. Reported-by: Dan Carpenter Fixes: baa914cd81f ("firewire: add kernel API to access CYCLE_TIME register") Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 8e9670036e5c..032ee56c34a3 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -1211,7 +1211,7 @@ static int ioctl_get_cycle_timer2(struct client *client, union ioctl_arg *arg) struct fw_cdev_get_cycle_timer2 *a = &arg->get_cycle_timer2; struct fw_card *card = client->device->card; struct timespec64 ts = {0, 0}; - u32 cycle_time; + u32 cycle_time = 0; int ret = 0; local_irq_disable();