From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4156E606A334 for ; Fri, 4 Dec 2026 17:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=C6X0RTds; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=IhLzp00e DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=SDcmleAuKjhYeTzSP2qzoasRBdJosqyCLsDDreDi9c8=; b=C6X0RTdsNVLMxBqG8xK+9Snvae gAgVp7W+tJAmc6L9IaxrMQGMGQvd3zJSvQnkHkr/4UaIWY6C7zJb2ih5Rw/+XkODjYbulOwlWwqbE yh1DK6m6T2HEQ4qh8OUB2/b/M12Sop52xTSBPm1erEQFaBjbBEBfhkqWnz09xYZZkNfx3Df/BGZ/y GITkGWF90bdZKbmBzxsmgD5lDfjrpdLJdOtcVSuWE4fkRFJqhlaRNvNzld9i3TSA+KV744rlD+twy 7VSy72B9Pm8liQTG5+1OTuV9uXEHVGNFw//3Nmk0MBQ7FSLW8Kq/x1l6Lo5kTBzUCfgLK13DRItHm pir2gkXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZWmN-000000010zi-0cfU; Fri, 04 Dec 2026 17:09:06 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZWlz-000000010sj-0UBx for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 17:08:58 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-3b41e5a1719so593886a91.3 for ; Fri, 04 Dec 2026 09:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796404114; x=1797008914; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=SDcmleAuKjhYeTzSP2qzoasRBdJosqyCLsDDreDi9c8=; b=IhLzp00elHMQdo0MQnKxk66MDFXSMK5ULPQO+DJFMAab/41EBETIwosF+spF94bAN1 ZMd2QZYijbLPuso22PsSRwsjkGTE10ozvAR1raAwlZ4j+1pFEZqKvIJsTdkBBrIpY4Ml kTXNYhORyocVMSNy7W0rRN5GLDHQYAzF4e7WFtU3Gw8ASyVejGiY1hOI2F55mUliNjTp ccIHBFZ1APrCEVak9+KWuzF0ra6SZB22bYm0/A87QsdaXbKwaFAhCoWvbhnIvo+lYD/U zgUx3tdAbdA+g0vBz+u0B3vdG6tmfYn52pv9n4P9I27U3NKgkplKZjdJGaDpzHmSFyCR KtqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796404114; x=1797008914; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=SDcmleAuKjhYeTzSP2qzoasRBdJosqyCLsDDreDi9c8=; b=xU/3/7kV0/TNJTC545HNc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HcaOKAKCr0WtR2qcCDhe90aspoLy lg10+6AlNvI+vLUDFAgadFrYLB6LRMr42BCqMLoa+7xzbvRhxWYbu7pB6cXMEYjj2dRcY9HaW5V XCL0XeSQJ0j4dd+/cybFmLflBc7q78ailv5w X-Received: by 2002:a17:90b:560e:b0:3b0:a757:e372 with SMTP id 98e67ed59e1d1-3b5e068db22mr2292346a91.47.1796404114271; Fri, 04 Dec 2026 09:08:34 -0800 (PST) Received: from dell ([58.246.183.50]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d7a6b5sm10144560a91.14.2026.12.04.09.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 09:08:33 -0800 (PST) From: Yuansheng Yang <0xbeac@gmail.com> To: Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] media: xilinx-vipp: fix double fwnode_handle_put() in xvip_graph_parse_one() Date: Sat, 5 Dec 2026 01:07:16 +0800 Message-ID: <20261204170716.1294557-1-0xbeac@gmail.com> X-Mailer: git-send-email 2.53.0 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_090839_528809_31768E94 X-CRM114-Status: GOOD ( 10.65 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 fwnode_graph_get_next_endpoint() already drops the reference on its previous endpoint `ep`, and the `err_notifier_cleanup:` path also calls fwnode_handle_put(ep). Calling fwnode_handle_put(ep) inside the loop body therefore drops `ep`'s reference a second time both on the next iteration and on the v4l2_async_nf_add_fwnode() error path. On OF graphs this underflows the endpoint node's refcount on overlay teardown or repeated probes (deadlocking on devtree_lock when of_node_release() formats %pOF from inside of_get_next_child()): refcount_t: underflow; use-after-free. Call Trace: kobject_put of_changeset_destroy free_overlay_changeset of_overlay_remove Call Trace: of_get_parent ... of_node_release of_get_next_child of_graph_get_next_endpoint xvip_graph_parse_one xvip_composite_probe Drop the redundant fwnode_handle_put(ep) inside the loop. Fixes: d079f94c9046 ("media: platform: Switch to v4l2_async_notifier_add_subdev") Cc: stable@vger.kernel.org Signed-off-by: Yuansheng Yang <0xbeac@gmail.com> --- Compiled with W=1 on x86_64 (0 warnings) and verified on v7.4-rc5 with a DT overlay probing xilinx-video: before the fix, a single probe + overlay removal hit refcount_t underflow and repeated rebinds hit the devtree_lock stall inside xvip_composite_probe(); after the fix, 10 overlay cycles x 5 probes passed with 0 errors or warnings. drivers/media/platform/xilinx/xilinx-vipp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c index 786e4f2e6..d997fed57 100644 --- a/drivers/media/platform/xilinx/xilinx-vipp.c +++ b/drivers/media/platform/xilinx/xilinx-vipp.c @@ -353,8 +353,6 @@ static int xvip_graph_parse_one(struct xvip_composite_device *xdev, goto err_notifier_cleanup; } - fwnode_handle_put(ep); - /* Skip entities that we have already processed. */ if (remote == of_fwnode_handle(xdev->dev->of_node) || xvip_graph_find_entity(xdev, remote)) { -- 2.53.0