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 X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E379C433DB for ; Thu, 21 Jan 2021 16:43:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B05E523A22 for ; Thu, 21 Jan 2021 16:43:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B05E523A22 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MmhVP+Wxewc6r5xFb8NY/gxSlIlPKZwdY6C/nnpryAA=; b=Gd5GYJ3KUjdXUaiDCS5/OeNRn U9yHYRweuvmE1JpYab5n2v9fqq2WmWLEydvzY3WRMclpWxGfwB0Sn97u+/W0KWeqMkyuIZQfpCx6Z /bk9JnnRIF1L+1h4psvA/Zqjy7VH2ikmrbldFiDaswO5XtqtCjtz293Zh+qNQad3YmWXP0LyqC/bJ ebbR41GEIOCZQtxSUYd9Gr65x10aEJ90xvZLpHKOIHLNXeqBBzUKO77rkfkxwCIUwOjNceHFAnLro yKMVSlch5dAhkQNR9qEVM7DJpXhvqhgB2JE0uTorcpV4JJIo7T/9xPRJV4z7J1ElL5AfRY4iD52Wo btRjb95+g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2d1S-0003W8-GL; Thu, 21 Jan 2021 16:41:26 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2d0L-00038J-FH for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 16:40:19 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 3EF415C01D2; Thu, 21 Jan 2021 11:40:16 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 21 Jan 2021 11:40:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=juHRcEeMVZKNRFcN4WekqTV/Dka fl+ufNPbmU8vMOGw=; b=qGMe4HLldxJ5tL009Da+FS+uVADr9ftMfdaaEX/A5XG mue+IkCUkCty5PfN1O7c4MIGFJMGX6H/28ineJBaHkpqLk7tRU169iO0oVhdNHku btScS7P7FU1pKRU1MUVwEHnxqEO9F+4HR32FpakSDInB0WvNJaT0ulStCcnYimvc UF9hDcLANaEsUX6YoSX1c4fh9afSMUU2CUCwS4UQI+d4+oYOjx0vuCJVHWy6bkvE WGGWM4Wb+V157HoUmgTTMQu01N4rSG188ziBdturiX6cunRKh1z9oVqCUxiEKtS1 vGVHTyUbRKRvCXoYEzDh4uESEzsxvQ8pNJRaTLgBgKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=juHRcE eMVZKNRFcN4WekqTV/Dkafl+ufNPbmU8vMOGw=; b=Lisa+IU7N9cYgUBSEatDPy zx0J9y4G/ZNe1dJ7I9Sd2tYA4MkRF2RNh33UEWGGOyIlKlAp79HBzIBvpfBI31Bd gOJcWRALArycbJDEvcnK62y7uKQM4E/nsUHntWywhyKMms1KoHl7cb41pDYFERiV y4j8gjcmna1oYSD+boz/mqkxGLKJZ2OeTQEWGj75Zj+DJn1w3Ix4KJ2UFnDds609 z+MtrPZ/Y9L1iD0oDVhcN4/8NaL90r8GtTG5J+EZhmLO8Teq5oCkMY0pJRWSv21O AHmoyK/zYWR1fGGqmpHQntJhpEYP7DLY6F6BSkvpf0F77Y5pF5RY+NytQCors0NA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeggdelhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeelkeeghefhuddtleejgfeljeffheffgfeijefhgfeufefhtdevteegheeiheeg udenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 5FF2E1080069; Thu, 21 Jan 2021 11:40:14 -0500 (EST) Date: Thu, 21 Jan 2021 17:40:13 +0100 From: Maxime Ripard To: Liu Xiang Subject: Re: [PATCH] pinctrl: sunxi: fix use-after-free in sunxi_pmx_free() Message-ID: <20210121164013.cqfxvach4ugkohm7@gilmour> References: <20210119062908.20169-1-liu.xiang@zlingsmart.com> MIME-Version: 1.0 In-Reply-To: <20210119062908.20169-1-liu.xiang@zlingsmart.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_114017_591399_6D9100A8 X-CRM114-Status: GOOD ( 12.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, liuxiang_1999@126.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, wens@csie.org, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============6869917930518636725==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6869917930518636725== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7o5h6w6sna7w4xki" Content-Disposition: inline --7o5h6w6sna7w4xki Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Jan 19, 2021 at 02:29:08PM +0800, Liu Xiang wrote: > When CONFIG_REGULATOR is not set, sunxi_pmx_request() always return > success. Even a group of pins call sunxi_pmx_request(), the refcount > is only 1. This can cause a use-after-free warning in sunxi_pmx_free(). > To solve this problem, go to err path if regulator_get() return NULL > or error. >=20 > Signed-off-by: Liu Xiang Is there any drawback to depending on CONFIG_REGULATOR? Given that we need those regulators enabled anyway, I guess we could just select or depends on it Maxime --7o5h6w6sna7w4xki Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYAmubQAKCRDj7w1vZxhR xYLnAQCoVnvqgYNOCD7XrY/g88dCWcaLLFceHcAeb/60OCJd2wD/deGbhmb9+die jeRU+To65zPfDYtY61jzRQjFPv2odQw= =VCdd -----END PGP SIGNATURE----- --7o5h6w6sna7w4xki-- --===============6869917930518636725== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6869917930518636725==--