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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4CBEC7EE23 for ; Tue, 2 May 2023 15:28:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234624AbjEBP2G (ORCPT ); Tue, 2 May 2023 11:28:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbjEBP1s (ORCPT ); Tue, 2 May 2023 11:27:48 -0400 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A95E2D5A for ; Tue, 2 May 2023 08:27:46 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id e06c2cb6-e8fd-11ed-b3cf-005056bd6ce9; Tue, 02 May 2023 18:27:41 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Tue, 2 May 2023 18:27:40 +0300 To: Xiaolei Wang Cc: aisheng.dong@nxp.com, festevam@gmail.com, shawnguo@kernel.org, ping.bai@nxp.com, kernel@pengutronix.de, linus.walleij@linaro.org, peng.fan@nxp.com, shenwei.wang@nxp.com, bartosz.golaszewski@linaro.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pinctrl: freescale: Fix a memory out of bounds when num_configs is 1 Message-ID: References: <20230501144139.985767-1-xiaolei.wang@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230501144139.985767-1-xiaolei.wang@windriver.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mon, May 01, 2023 at 10:41:39PM +0800, Xiaolei Wang kirjoitti: > The config passed in by pad wakeup is 1, When num_configs is 1, > configs[1] should not be obtained, which will generate the > following memory out-of-bounds situation: > BUG: KASAN: stack out of bounds in imx_pinconf_set_scu+0x9c/0x160 > Read size 8 at address ffff8000104c7558 by task sh/664 > CPU: 3 PID: 664 Communication: sh Tainted: G WC 6.1.20 #1 > Hardware name: Freescale i.MX8QM MEK (DT) > Call trace: Please, read this https://kernel.org/doc/html/latest/process/submitting-patches.html#backtraces-in-commit-messages and update accordingly. -- With Best Regards, Andy Shevchenko