Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2029770rwb; Fri, 2 Dec 2022 04:41:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf5vvMK8e+AwP8bxszzsKnh1oNYy8O+7BPs4vDzREOfVJ/j6olpanGegVUWE+P5pA4JYXuOJ X-Received: by 2002:a17:902:be18:b0:188:b6e0:6a96 with SMTP id r24-20020a170902be1800b00188b6e06a96mr51720738pls.167.1669984907187; Fri, 02 Dec 2022 04:41:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669984907; cv=none; d=google.com; s=arc-20160816; b=xv4ceoK4YaZEJNs3YRQaD7/TVeKMOMqt/qOLSoZrZp8mfQe4yn8YiNbTf4bp5XIVNz dCCGXsP68ySfgID2FdDHbyrFMZ8b1n/jQ4PnuvaFD8l0JB3zGShsJHG3gL4iyqw77oPc yzfGgRH64O77idSZHaqlvJgewIiw6IYi3OdAuE6DPjEdXGQ/qriU2i4o3JsXxZi1nr1F gOmCpuBM+8iZqgXAJJxA6J4k9tKu3jMdgGeKcYx1OOrblhQtMDQ8k8N/BfrVyywcB4MN vnut6lXtd/XvjTaNn7qwa+1HEMkk6ncwR3AnRLE5kzRnFSUBDk9ixFQ0Xar6AMaAA93V +FdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QL08V1CblNQ344sEitshQJpL3YPFWoVO6Z8OdfPPB0U=; b=MLZvlz5p6W0bUJ9KV1PGK4PMP0s9GLxYqjz9OgDsCU/KLPuuyLXNy48ahj1ZgW6FId Q3x67EG49mDv/TvhF89RelP1j/zCf0lImCmlDar7EfX7VsaslEWpjEiinom55BwAL5TH S1Mpxu0UzaQgEiAwTh+fNrhcblPA8gf0Y3CN0hYV94scf7ZvF+a1jvPaKZnJZbvlmwwG bLa26+Rz8RtpHe08/NSe1azDSZgGrbvKGjrdMHwINipaVCLnv4twbQE+IFjWBGklPsFW 5oOI2lbqUepBUoN/pp2fmqt1DsD4Usr7VNQRPgjRtwH6wFT2/bE9+q4Qzt0Uez/2gbZd fFGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RJrww0dS; 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 a18-20020a630b52000000b0047760609a73si7137480pgl.57.2022.12.02.04.41.36; Fri, 02 Dec 2022 04:41:47 -0800 (PST) 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=RJrww0dS; 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 S232896AbiLBMH5 (ORCPT + 83 others); Fri, 2 Dec 2022 07:07:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232364AbiLBMHz (ORCPT ); Fri, 2 Dec 2022 07:07:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A20F621E3C for ; Fri, 2 Dec 2022 04:07:54 -0800 (PST) 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 3416462289 for ; Fri, 2 Dec 2022 12:07:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E96C7C433C1; Fri, 2 Dec 2022 12:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669982873; bh=QL08V1CblNQ344sEitshQJpL3YPFWoVO6Z8OdfPPB0U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RJrww0dSL0LWtWKJq6omLZUVF6wGmYVGbogyRMVshRt/x+pnUwtssR0yJkJKxqpKm HP+5vkWiQpUpW9x1aawnO7AwhG3XHsEIOYFoHqDdpi+BZX3Pk8wc7wtmiMHu0QQdaY 6ORvwdx+l3rFedkeLdV8rPt9Gn9wTOZL0dYiLZ3EMvsRIPt+7USWmML33zxgu28s1E h0pDAZcoJM6XBThoRykOUc61HmEEOyCOvv+svsklTUAtT5dgBzp6hl0HE1m8tuvc1w edRdZDhGCZ83dzoW3/HGWG53G4m4cERrA10RyxtFh+T2iFawEiC65oKz6+pecbQjVG +uwcYuOFnwu7g== Date: Fri, 2 Dec 2022 12:08:13 +0000 From: Mark Brown To: ChiYuan Huang Cc: lgirdwood@gmail.com, lee@kernel.org, matthias.bgg@gmail.com, yangyingliang@huawei.com, chiaen_wu@richtek.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, ChiYuan Huang Subject: Re: [PATCH 1/2] regulator: mt6370: Fix potential UAF issue Message-ID: References: <1669797463-24887-1-git-send-email-u0084500@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IykTNXYspChJUhfV" Content-Disposition: inline In-Reply-To: X-Cookie: Ego sum ens omnipotens. 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 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 --IykTNXYspChJUhfV Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 02, 2022 at 11:35:35AM +0800, ChiYuan Huang wrote: > Mark Brown =E6=96=BC 2022=E5=B9=B412=E6=9C=881=E6=97= =A5 =E9=80=B1=E5=9B=9B =E6=99=9A=E4=B8=8A7:43=E5=AF=AB=E9=81=93=EF=BC=9A > > > The original code uses i2c dev as the parent in order to reuse > > > the 'regulator_of_get_init_data'. But this will cause regulation > > > constraint devres attached to i2c dev, not the mfd cell platform > > > device. > > This is a general issue which will affect a lot of MFDs, we would be > > better to fix this by changing the API to provide a device to be used > > for the devres allocations separately to the one used for looking up the > > DT. > Not to affect too much, the better way may change the 'regulator_register= ' API. > Append it as regulator_register(dev, ..... > This could separate device object with devres allocation and DT lookup. Yes, I think so - a new optional argument. --IykTNXYspChJUhfV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmOJ6qwACgkQJNaLcl1U h9BboQf/fkr05047bYXQZwnpRvQs/KoEOmkQQY7wZUDoqQSBwDGwjV8wi2Z2sAo3 lq4q5n1FW9Qtbk26Ui68g9Zt7hIUZFUOm8af//67agU/fvV8fKwNa/haBywcp8yw cwKyW6Ih4LOTSOPJtukyx9Jm0Qu+gZHYh/p4YGq8Lw4C5bUjQDPvr2HeMVhl8oc1 uCphypPS/RV46dFBIM714iq7Hpb3w9ted0qh2+LrGchXYq43SQPeK6auKlu+xVcT 3MhEYJVohvXkIAnvZ5WYu3EUgi5KG6zHmWW6f69wW6gjoo+9zuytnJQBHjgq/zRJ x1c5vobZCCUD0YkFLG5tlq4ZobYw9Q== =wnjD -----END PGP SIGNATURE----- --IykTNXYspChJUhfV--