Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp71172rdb; Tue, 31 Oct 2023 00:26:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2NUSJ3cX1hheLjdq9hS2tkgk3Y1mNZZwAQkUjhapdZnSMoqfkQuTtro8/o6MHxEuaOBWf X-Received: by 2002:a17:90a:db92:b0:27f:df1a:caab with SMTP id h18-20020a17090adb9200b0027fdf1acaabmr10509302pjv.21.1698737190013; Tue, 31 Oct 2023 00:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698737190; cv=none; d=google.com; s=arc-20160816; b=VOCpdkv4BBHrn4lvwsAdisupdIvNa87+ZJ0FswDxl3IuALhNtaHsk8u03bNotZARGv DWch+2GmTA8Q+8cI+fCCGszqdsKx+xpsDA77XvU7BWgy50Bj5QrlNAAThzvDwmn8z4w5 bp0Pppb07quVp4Q78TM2RO6OWKQC/O79BvKAF6O9z1o8SD0WGspR9yiWirgyEpMaLlQr fEDp6N6LNkHJfuhG9t0s3evSpC2/EJ3mX/un9zp/2HhMLHDmln4Z8gUU0pZVjf5gFmJz jYr1CpIkFUefwKiVLPJZXRPbJGwgnsFSI1/rKnqHCk3z8kU+2grfFOH3ponpz/fyS8E4 xSgw== 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=ASsXEcbteU4GPfEVnI2TPvygnLuDvg60JpuRJpPgpQCv5lQTeeVnNraymEcMikafMR lYWyA+Wg2L4mv0TCQS08+sy1FjoPbOER+ZdgeUfqFrklEh53z6Z1TYEbiV/pjboQIHH1 4OYeQLmEkL6wQnh2ZlCg9/J3y4T1oBZGcUvpfZJjAPpoPgpxv0iGQney9k6YF6P+2LQi u1z8QCsUFhSAyHXloWqzpstKW+9c7mVnXNqjbeYzM/yN5cz0K7Ob4zkvioPdCzjPG4vB 9TvO3m6i+iw6vLr3dpA6E9P7mB4I0v+noGgdql6PG6ccypnyHS+JGjCheUnRPgCFT1mB FInA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=J9Q0LIki; 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 89-20020a17090a09e200b002801b7112f5si582481pjo.86.2023.10.31.00.26.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 00:26:29 -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=J9Q0LIki; 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 5F92C80A49B9; Tue, 31 Oct 2023 00:26:26 -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 S1343732AbjJaHZx (ORCPT + 99 others); Tue, 31 Oct 2023 03:25:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343781AbjJaHZk (ORCPT ); Tue, 31 Oct 2023 03:25:40 -0400 X-Greylist: delayed 459 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 31 Oct 2023 00:25:21 PDT Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.214]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B87AFD69; Tue, 31 Oct 2023 00:25:21 -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=J9Q0LIkiiwv/VssVaKp3e vXr/+9DXZSnlshaZwntbXD0UtypAGWdOLzJG001ilaLfHUIT9x+pGVNED2Aei0fJ HZWPhCNKzECaAxBQT9tYmDejmv2RA+Qq0n4htosaxWi9BAqlfv1M/pW+PdpJHUhd 9TTo8OhyXPGGXNrMwXD1iI= Received: from leanderwang-LC4.localdomain (unknown [111.206.145.21]) by zwqz-smtp-mta-g5-0 (Coremail) with SMTP id _____wDXP+6wq0Blv5KVAQ--.8863S3; Tue, 31 Oct 2023 15:24:32 +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:24:27 +0800 Message-Id: <20231031072429.21448-2-zyytlz.wz@163.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231031072429.21448-1-zyytlz.wz@163.com> References: <20231031072429.21448-1-zyytlz.wz@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDXP+6wq0Blv5KVAQ--.8863S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zw4rtF48tF1UJF4fZr4xWFg_yoW8Gr45pF WfK348CrWUGF4qgryDAa47ZFy5Gwnaya40gr47uwn2q393XF47t34jya4FqFWxXF9rCFy3 tF1FvryfWF4jvFJanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRNBMNUUUUU= X-Originating-IP: [111.206.145.21] X-CM-SenderInfo: h2113zf2oz6qqrwthudrp/xtbBzhQaU2I0bIocowAAsc 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]); Tue, 31 Oct 2023 00:26:26 -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