Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp628487rwe; Thu, 25 Aug 2022 06:38:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR47eK37I/NNVuWnvdEQcR9wycOdozGxeks7TNYfSlp9MOflBkfuui2xtcd/hu6XOhkRNzec X-Received: by 2002:a17:906:c2d3:b0:73d:ac2e:662a with SMTP id ch19-20020a170906c2d300b0073dac2e662amr2529336ejb.498.1661434731010; Thu, 25 Aug 2022 06:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661434731; cv=none; d=google.com; s=arc-20160816; b=yABOgwQDCxr59OwB8ZpDlc39enyQEIZzgwi3qw3aqRF2UDvYJVvky3sNc1d5D8bPXA MbCUjK/9UfAbPjrtskIZwYQOiMKjrUV3YmsYwYVwYB2/3xV3WmxeQhWLBiWq+S2SkcoC N11mcg8WEPSZ2I1CnTq8JZzQ4Hustgn9wY4JBGinBwcpBGFSBbj+QiRI8Y12ij6F1sge EZdDAD/wHjBRH6OC/6XBNpZabF1zhmOiosI039pI4x/nW241NjZapIP87Bo2mzwm7qWt 9B/JNJAT6BCmB2At1tBGMNudY9pCRb1D/z1JK91CCUSamR1l0qLjFJ23wc5YBJg8ReYn LOrA== 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:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=I61fCrCO18DJJJsAZWR8pS4WSdua7yHwH42dx5Jtmqg=; b=vEReSeK4AOgt6uh8QbK9XCorK+/3fFUE0f/XO0g+bQdcC0014HwHYu6fmvKXBvehuF o2vwoCF1vfQ39j8z2T6mGGM9Zg8ztwStwo1+0UOyJiGg+T6x43Zrp2x7TZw9zV/532KW 3FoTKOb+tJXcFhHezkACPnhhF2gv4xkexclRq1+fCpWUX2yn+E2V/sDhoxUp/55Ok7W/ +W1ZJJCszNRJjW5cG9FAucYvtHM9y8ikmOh1v6d41a7hd2xmcxIsCHojLilr3NzhjAqn 7tkT7uN+dI1neBHG+vGVAd2AAmR6WaAv395UBX3S8/HkqSPr7p1vhFtHeR5bP/nuo2IK Qm+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GB2nBwzb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a50998e000000b00445f2dfacaasi5874321edb.614.2022.08.25.06.38.16; Thu, 25 Aug 2022 06:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GB2nBwzb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242249AbiHYNJi (ORCPT + 99 others); Thu, 25 Aug 2022 09:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242207AbiHYNJ3 (ORCPT ); Thu, 25 Aug 2022 09:09:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F9AA2218 for ; Thu, 25 Aug 2022 06:09:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0E6EF61CB5 for ; Thu, 25 Aug 2022 13:09:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD0F1C433D6; Thu, 25 Aug 2022 13:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661432967; bh=4an2Zm5Z7L3zqjMAq0Mm+lIubANUcp1jxvvwxCkhBqQ=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=GB2nBwzbLyFl6QV4T5ea0q8+U1cvh6HcD7X+45UFPCvEjDsIc2cLyeIss1f/XMq1l 0WDNk3LxpfGkYyAf2Z2J4gOQynnRqkXMdAG6TQbUbYnV4VI27fFLjIjAH4vEXYqH44 lAkAwMYfmu5wVkHzJaMFr2105H3JSN9NK/soOCv+NFuLYVneALSJTu3SBqD4WXREg7 fzNZgrZFT2ZyK/2qvZwyfZQIOb74VToxdlMYZVlnCOmkN4WFp5Q1uW5NFvyrtcQ8ln /+DcZg9p1qvlykCQ3d7QxyINzUBOGd8hwEU/Q3M2C+/2RH4s1Rjy5HnOngKsl82WEH lAPslG9jHgJRQ== From: Mark Brown To: lgirdwood@gmail.com, Xiaolei Wang Cc: linux-kernel@vger.kernel.org In-Reply-To: <20220825111922.1368055-1-xiaolei.wang@windriver.com> References: <20220825111922.1368055-1-xiaolei.wang@windriver.com> Subject: Re: [v2][PATCH] regulator: pfuze100: Fix the global-out-of-bounds access in pfuze100_regulator_probe() Message-Id: <166143296648.103302.14963549343050177347.b4-ty@kernel.org> Date: Thu, 25 Aug 2022 14:09:26 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: b4 0.10.0-dev-0c1df X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Aug 2022 19:19:22 +0800, Xiaolei Wang wrote: > The pfuze_chip::regulator_descs is an array of size > PFUZE100_MAX_REGULATOR, the pfuze_chip::pfuze_regulators > is the pointer to the real regulators of a specific device. > The number of real regulator is supposed to be less than > the PFUZE100_MAX_REGULATOR, so we should use the size of > 'regulator_num * sizeof(struct pfuze_regulator)' in memcpy(). > This fixes the out of bounds access bug reported by KASAN. > BUG: KASAN: global-out-of-bounds in pfuze100_regulator_probe+0x380/0x8b8 > Read of size 3968 at addr c3390640 by task swapper/0/1 > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next Thanks! [1/1] regulator: pfuze100: Fix the global-out-of-bounds access in pfuze100_regulator_probe() commit: 78e1e867f44e6bdc72c0e6a2609a3407642fb30b All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark