Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1020629rdh; Fri, 27 Oct 2023 02:19:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcn9s0epzYSP1HCbJXO+ODvdsg18wXtvpMynFZN2xzjtnkaYVYPWPJ0tMz6tRtynszswK8 X-Received: by 2002:a05:620a:2cc8:b0:778:91f0:e559 with SMTP id tc8-20020a05620a2cc800b0077891f0e559mr1433141qkn.78.1698398340102; Fri, 27 Oct 2023 02:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698398340; cv=none; d=google.com; s=arc-20160816; b=jeDx80cCK0JIF7GbS2BON0QZV6L3it0qanzZDmNQcgCXPne2R7qajP1fRtcYONUqMV Wm9n5oeySDg52J32Woz01zYlj35M8vh6gGAaXhChcEddj3hkGQ3V6pvZLAte9tnpp9tX /uuHCf+Gg8iyI6PuwFlxMWR3HXZpICy4wZaKz4fo6kgx7nnoE2sazCNZraujBRRGswFj QWkco/Tv1CJhzreZ1NDWE0eDEA2rIdy1k3ohZR2EgIUWLhwQVduCSctl31zQrQeTz+gi n9ayilZKjKBB8vGpxLP0dRfQivj9nPIWxzY9XCMPkP+T0HS0cvjWmNCVjFld7vMOzcAo CqDA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ZYvJWf+GN8rYbJBn1IFT3mrdYzrKe6A0aYWfjBjhd6E=; fh=BUOxERKiHMKNK1EXVoIyLQc16i4PhksEBSx6UgkZJ98=; b=zLJiTuLU4iivhlSKLQFat/BEsd1BtxaNo8kKj+Tnv6zMWx4SGXw17W39i5vGj2RGH/ acVKHGXrFBEwNtYitzVKK4LxRBoDrIJ+MXHoFzkQvYwqMTXmf3lxkhBqJ2XffMmokQLh 0mPxVuEcN/2PiygSBrID0Rd0yVEpOLIHd08fwP3r1pJzmytdMCXi5N6aDcHJ1Lr4ByDh X7IBEkmGNwfBpkgXD1RcwELCYRbv3LcLWIBoBSZl/MI1AerBQn0E97N02bddDtt8BdcH sqEk6FqXyAKdwwErwbB9pZx/farU/60JN6w7RReLTob1ZEenVlH74FV2vA2LWeEOvUbL 0q+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=ckiM1oDv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id r201-20020a2576d2000000b00d9af2e13e72si2332830ybc.582.2023.10.27.02.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 02:19:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=ckiM1oDv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C96A780290CA; Fri, 27 Oct 2023 02:18:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345514AbjJ0JRw (ORCPT + 99 others); Fri, 27 Oct 2023 05:17:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbjJ0JRv (ORCPT ); Fri, 27 Oct 2023 05:17:51 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD04993; Fri, 27 Oct 2023 02:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=ZYvJW f+GN8rYbJBn1IFT3mrdYzrKe6A0aYWfjBjhd6E=; b=ckiM1oDvdwLrdawG2pc3M j9aLlD88UlfOYVRWSjhZpCCSWen0Y/Gdi/4cuyznANpvX3tHCIdQLdQ3zAlfQvHf ghzCLUPbQ7RZ4CkqeS41XbVAsM1Cz39zbLSc4k7BHTcDhNw3xhDYb2irI2texiHq OLQrhy/Jjs+krEm/NqNhQA= Received: from leanderwang-LC4.localdomain (unknown [111.206.145.21]) by zwqz-smtp-mta-g4-2 (Coremail) with SMTP id _____wDXnzDefztlgV6KBg--.4819S2; Fri, 27 Oct 2023 17:16:15 +0800 (CST) From: Zheng Wang To: dmitry.osipenko@collabora.com Cc: Kyrie.Wu@mediatek.com, bin.liu@mediatek.com, mchehab@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Irui.Wang@mediatek.com, security@kernel.org, hackerzheng666@gmail.com, 1395428693sheep@gmail.com, alex000young@gmail.com, amergnat@baylibre.com, wenst@chromium.org, Zheng Wang Subject: [PATCH 0/2] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices Date: Fri, 27 Oct 2023 17:16:12 +0800 Message-Id: <20231027091612.38896-1-zyytlz.wz@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDXnzDefztlgV6KBg--.4819S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zw4rtF48tF1UJF4fZr4xWFg_yoW8JF4Dpr WfK348CrWUWF4qgw4DJa47ZFyrGwnaya40gr47uwn2q393XFsrt34jya4FqFWxZF9FkFW3 tF1FvryfWF4jvFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zR1rWrUUUUU= X-Originating-IP: [111.206.145.21] X-CM-SenderInfo: h2113zf2oz6qqrwthudrp/1tbiXRAWU1WBq4ptKAAAs4 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 27 Oct 2023 02:18:03 -0700 (PDT) This patch reverts commit c677d7ae8314 ("media: mtk-jpeg: Fix use after free bug due to uncanceled work"). The job_timeout_work is initialized only for the single-core JPEG device so it will cause the crash for multi-core JPEG devices. Fix it by removing the cancel_delayed_work_sync function. Fixes: c677d7ae8314 ("media: mtk-jpeg: Fix use after free bug due to uncanceled work") Signed-off-by: Zheng Wang Signed-off-by: Dmitry Osipenko --- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c index 7194f88edc0f..60425c99a2b8 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1403,7 +1403,6 @@ static void mtk_jpeg_remove(struct platform_device *pdev) { struct mtk_jpeg_dev *jpeg = platform_get_drvdata(pdev); - cancel_delayed_work_sync(&jpeg->job_timeout_work); pm_runtime_disable(&pdev->dev); video_unregister_device(jpeg->vdev); v4l2_m2m_release(jpeg->m2m_dev); -- 2.25.1