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=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT 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 05C5BC282CE for ; Mon, 8 Apr 2019 08:31:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CC10C20880 for ; Mon, 8 Apr 2019 08:31:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A8jVIfYH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC10C20880 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.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=KT+6xqH6RZwx0+F/xl5wbAL064koSukJuZP2hz+aHRc=; b=A8jVIfYHRXxfToLGrVSh+lI8P AoFl7E79GA/1hBtVXka0/96kJzH1V2Xwalpc2KGpCL4IlhDssgpt+wyXrOQnY2SI0Y3QFNzzfLkDh 3vYLWLBvdiS6L4RScjS7LQYjx1IzenRJQVNHRoJxtSqD839izSFOksN4p9e1G03tOQaYNhYOvhhKf GHE2viTlmWNrDMc2AA0ftlTSitunM3dWVI3nchPzG6eGSdFOfFj3qDCEvClQ17Cojy7+HUTbQPdKp 3hezBttHHTfk/xeshvzeeYD4G2kxjMpGn9llaND9A8riqzL+A+yxgRgJozrcsvYgdwk7gy9fQqm86 03Vs8AQcQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDPgc-0005ws-A8; Mon, 08 Apr 2019 08:31:26 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDPgU-0005lp-Ck for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2019 08:31:22 +0000 X-Originating-IP: 90.88.30.125 Received: from localhost (aaubervilliers-681-1-89-125.w90-88.abo.wanadoo.fr [90.88.30.125]) (Authenticated sender: maxime.ripard@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 045A51BF20B; Mon, 8 Apr 2019 08:31:10 +0000 (UTC) Date: Mon, 8 Apr 2019 10:31:10 +0200 From: Maxime Ripard To: megous@megous.com Subject: Re: [PATCH] drm: sun4i: Fix NULL/invalid pointer dereference in sun8i_tcon_top_un/bind Message-ID: <20190408083110.iy3auc7ggindifbf@flea> References: <20190405233048.3823-1-megous@megous.com> MIME-Version: 1.0 In-Reply-To: <20190405233048.3823-1-megous@megous.com> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190408_013118_839016_DF584108 X-CRM114-Status: GOOD ( 11.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Chen-Yu Tsai , "open list:DRM DRIVERS FOR ALLWINNER A10" , open list , linux-sunxi@googlegroups.com, Daniel Vetter , "moderated list:ARM/Allwinner sunXi SoC support" Content-Type: multipart/mixed; boundary="===============4349716883636325008==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4349716883636325008== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5xzbmyv2nly3kyer" Content-Disposition: inline --5xzbmyv2nly3kyer Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Apr 06, 2019 at 01:30:48AM +0200, megous@megous.com wrote: > From: Ondrej Jirman > > There are two problems here: > > 1. Not all clk_data->hws[] need to be initialized, depending on various > configured quirks. This leads to NULL ptr deref in > clk_hw_unregister_gate() in sun8i_tcon_top_unbind() > 2. If there is error when registering the clk_data->hws[], > err_unregister_gates error path will try to unregister > IS_ERR()=true (invalid) pointer. > > For problem (1) I have this stack trace: > > Unable to handle kernel NULL pointer dereference at virtual > address 0000000000000008 > Call trace: > clk_hw_unregister+0x8/0x18 > clk_hw_unregister_gate+0x14/0x28 > sun8i_tcon_top_unbind+0x2c/0x60 > component_unbind.isra.4+0x2c/0x50 > component_bind_all+0x1d4/0x230 > sun4i_drv_bind+0xc4/0x1a0 > try_to_bring_up_master+0x164/0x1c0 > __component_add+0xa0/0x168 > component_add+0x10/0x18 > sun8i_dw_hdmi_probe+0x18/0x20 > platform_drv_probe+0x3c/0x70 > really_probe+0xcc/0x278 > driver_probe_device+0x34/0xa8 > > Problem (2) was identified by head scratching. > > Signed-off-by: Ondrej Jirman Changed the prefix to drm/sun4i: tcon top: and applied Thanks! Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --5xzbmyv2nly3kyer Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXKsGzgAKCRDj7w1vZxhR xQqGAP4kmLyFIOtPDf+pfIt6NhIgJZDBU/daZteokDJXU4w5BAEA9YB7hTNGj3lD pxQ4XGym/+JRqbdlTKZsfF/QFucnOAY= =V2sL -----END PGP SIGNATURE----- --5xzbmyv2nly3kyer-- --===============4349716883636325008== 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 --===============4349716883636325008==--