Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp68661rdb; Tue, 31 Oct 2023 00:18:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3kaZqXLXCC7hEo0m6LYAb/eYX4JltJ/VXiuC90KkfKtXU5NoB7zvA7V3EZRkcSnE2B+Bf X-Received: by 2002:a17:90a:3c86:b0:27c:fb84:101a with SMTP id g6-20020a17090a3c8600b0027cfb84101amr10511021pjc.29.1698736695505; Tue, 31 Oct 2023 00:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698736695; cv=none; d=google.com; s=arc-20160816; b=ZWCVWnz1K5HUZGvQXYSXebv/xV8hoKv9LqpePSiP6oHNJJfv7AFTy0kVBbmGfn3ucb eikaQ8NImDfHEvy5j9ik8NtGwLLlMKOdu2quudDGSau+PR/zagKNu4PXX4HW9SY6EE4d fWtv0r2WHt0NaHj9pASmH1SMssEWgvtgq+EIbg0iR4ze/g/5tM781Aq8eURusmwfWch2 uspG3w2B/LGUzPZoQsHGpHM8MBlRrv46N+wjKpR3p6jBui03ACWyxiXBK5q2R9D8nVEP PHoUJJNA/qx9o3EGgERfQWNXYWSzmWZNiA7a/ndEPj9J/87E7isXNhRGT9VfpHJU22aD WGiA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SJWU5tnjso1vDAK736GkMoFEm3BXg8uhBy9G73LcJvU=; fh=BUOxERKiHMKNK1EXVoIyLQc16i4PhksEBSx6UgkZJ98=; b=yRfIReiXng3OX8+MZvfyJ4Otp0Zj5lEoWGDXlFdCUM/f1Hl888OKAgcnJkwjfK+qYJ 9+sXsGpfnTkUrGUmddWEekjLpHy7vlL0x4t03CfGAHQJLEwwXgwjfqebU8GWrcydkXct TiPvI6Dkdy/Eyq0DBWjF3thFS/nJW5INhWzA7NQGkgDKnhLZyIrls6eGESy7V8v2DIhP Amx1yJkzfQr+Q1lWLXpbs3J+D/jJ/q7UcSFEYsMFHqhfOxq/Gqb1VKUevCMXIe3F2/6y hSO/4I6l0vf1h8/nuhAyL99KGvYGbNnG+GG3t8UQHQfBsaT8sLTsaf2Y7EWxuwGE788N M5kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=atXhhDwU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id f15-20020a170902ff0f00b001cc1af09466si603690plj.125.2023.10.31.00.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 00:18:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=atXhhDwU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id C3A76809B6D1; Tue, 31 Oct 2023 00:18:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343625AbjJaHRs (ORCPT + 99 others); Tue, 31 Oct 2023 03:17:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343603AbjJaHRr (ORCPT ); Tue, 31 Oct 2023 03:17:47 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00058C1; Tue, 31 Oct 2023 00:17:43 -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=SJWU5 tnjso1vDAK736GkMoFEm3BXg8uhBy9G73LcJvU=; b=atXhhDwUyy89XVbCFZ8ia BSGTaJeLg4Fst7Xvz07DcCB3s2IveiCSNDwyx6ET5JKTU/mIL4uV1VdQNGgeu2uA ZwlUCsopSlc4U0e2wor87qqHUaR+9p3uJ22Hnln5J28XI8ZGlNmIQ60EbhDwijYQ OIA8q5oU/DwWKnhc1Od4f8= Received: from leanderwang-LC4.localdomain (unknown [111.206.145.21]) by zwqz-smtp-mta-g3-3 (Coremail) with SMTP id _____wBn3ojfqUBlwMj4AQ--.51864S3; Tue, 31 Oct 2023 15:16:49 +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 v2 1/3] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices Date: Tue, 31 Oct 2023 15:16:42 +0800 Message-Id: <20231031071644.20086-2-zyytlz.wz@163.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231031071644.20086-1-zyytlz.wz@163.com> References: <20231031071644.20086-1-zyytlz.wz@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wBn3ojfqUBlwMj4AQ--.51864S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zw4rtF48tF1UJF4fZr4xWFg_yoW8Gr45pF WfK348CrWUGF4qgryDAa47ZFy5Gwnaya40gr47uwn2q393XF47t34jya4FqFWxXF9rCFy3 tF1FvryfWF4jvFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0ziqQ6QUUUUU= X-Originating-IP: [111.206.145.21] X-CM-SenderInfo: h2113zf2oz6qqrwthudrp/1tbiXB8aU1Xl78YxZAAAsG 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 31 Oct 2023 00:18:13 -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 --- v2: - put the patches into a single series suggested by Dmitry --- 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