From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 43FD8C05027 for ; Sun, 12 Feb 2023 21:12:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G9KuIgRSIX5ZvzRpzBKSETgMQhn5sk8nu5GjchdIX7M=; b=O1bo2bc6ly2x8x LWgyaiBtTgdESknl9Nm9l8+O68+KvA0P3Y6PeP9+UVUzp+QEEUKVpoWNal64n3nTvJRfq6T1U7yVH WP0miWpRJxZkZX2wFTx+I/+D9n+bC9tbxCJohTumS3t3ch1DyapWw8VYOQWb3fW7XHPU7qyGg3zy0 tnl7tKAuv7UqHQi/E0ulJw5GI7+ZXuKGsicS6zvvoipo6p8T06FRic6SsPcN+FhcaeBZZjw+H31kM Yly5EWpkDvffAYchRK0/+NaxIr6HGoZ68hmQwNi/7FNUvasBfmI/v3Xd06Rbkj+alwlE/0Le5xGmE d92hOzy/tLFn0hM5yLOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRJdC-00CLk1-UO; Sun, 12 Feb 2023 21:11:31 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRJd9-00CLjE-DP for linux-arm-kernel@lists.infradead.org; Sun, 12 Feb 2023 21:11:28 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B74E75C00C8; Sun, 12 Feb 2023 16:11:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 12 Feb 2023 16:11:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1676236286; x= 1676322686; bh=/BkqxOtXcZA548SCvbOvOHi/XeQIUpilhd0t/wMeQnw=; b=K uLKSf3DtAmqKfbtNpo3a5/dMq4CUYH5ZaBNBvGZA1tTwEKbZBMTD+h1i4s6Wi7Bq +YPYUjmGk7gHmHn+/GxrlwHlPUD6a6V0G5tC4Zgg0IelnvWWNqCcS1/5IoBroNGh l8vZyEp+XjPhsfOPflDUszUlzyCobhLnnoM34RMnsvIMfwgI0oI1X//wW/f0tXE+ wUhIECoaOZ5jPe37BfMCEVrOg7IM77my2cL0sRp9g26m692yInvc6K+qzh2FXLF5 qYkI6JnrjcOa+v1AlLYmqYTjPEi9sVosIgeltRRMl7NtC/mewJIgVQBYNMLOFxdi gnu68yDbaNXQ3lzFVeLSA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :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=1676236286; x= 1676322686; bh=/BkqxOtXcZA548SCvbOvOHi/XeQIUpilhd0t/wMeQnw=; b=t dyMqsPxMjdYBCd6+tf5abiJwml3YyRuaaTYNS8eaYPLB40W+Hfnxj0lsM+U0S1rP H+PG+VOtR2VVaCpwb4TJSNikPMorNEXjjQlndGrHhQie+wRCV2nDbbLtPwVpx5G0 HNmiQnOpb924Bgu4WUrpnZP6YbABiDFQev0aXxomtQaWp+EpOzrL+KXjqnfsOrET HrYk/TcTQduUqhybRNzgKSF8W9JTAfh42c4tIpfYQ2mJau3/AKudxkS7BIhTmO2q 3IzqDe6hLPATOuAG/6qKuRJwQa7HIGHvH2y0ccrX+YB+DiadsT3rl7HVy420337u audEIiyuJfqBauD1zcczw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehledgudegiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepufgr mhhuvghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqne cuggftrfgrthhtvghrnhepkeejleelfeeitdfhtdfgkeeghedufeduueegffdvhfdukeel leeftdetjeehuddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 12 Feb 2023 16:11:25 -0500 (EST) Message-ID: Date: Sun, 12 Feb 2023 15:11:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH 1/2] rtc: sun6i: Prevent an out-of-bounds read Content-Language: en-US To: Alexandre Belloni Cc: Alessandro Zummo , Chen-Yu Tsai , Jernej Skrabec , linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev References: <20221229184011.62925-1-samuel@sholland.org> From: Samuel Holland In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230212_131127_556206_13C8FE70 X-CRM114-Status: GOOD ( 18.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/9/23 16:49, Alexandre Belloni wrote: > Hello, > > What should I do with this series, I'm not sure you came to an > agreement. > Also, 2/2 doesn't apply so you'd have to rebase. I will send v2 after the merge window, possibly including only patch 2. Regards, Samuel > On 29/12/2022 12:40:10-0600, Samuel Holland wrote: >> If there is more than one parent clock in the devicetree, the >> driver sets .num_parents to a larger value than the number of array >> elements, which causes an out-of-bounds read in the clock framework. >> >> Fix this by coercing the parent count to a Boolean value, like the >> driver expects. >> >> Fixes: 3855c2c3e546 ("rtc: sun6i: Expose the 32kHz oscillator") >> Signed-off-by: Samuel Holland >> --- >> >> drivers/rtc/rtc-sun6i.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c >> index ed5516089e9a..a22358a44e32 100644 >> --- a/drivers/rtc/rtc-sun6i.c >> +++ b/drivers/rtc/rtc-sun6i.c >> @@ -294,7 +294,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node, >> >> init.parent_names = parents; >> /* ... number of clock parents will be 1. */ >> - init.num_parents = of_clk_get_parent_count(node) + 1; >> + init.num_parents = !!of_clk_get_parent_count(node) + 1; >> of_property_read_string_index(node, "clock-output-names", 0, >> &init.name); >> >> -- >> 2.37.4 >> > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel