[0/2] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices
Message ID | 20231027091612.38896-1-zyytlz.wz@163.com (mailing list archive) |
---|---|
State | Superseded |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1qwIyW-008d30-Gn; Fri, 27 Oct 2023 09:17:52 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345352AbjJ0JRw (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); 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 <rfc822;linux-media@vger.kernel.org>); 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 <zyytlz.wz@163.com> 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 <zyytlz.wz@163.com> 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L4, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.8 (----) X-LSpam-Report: No, score=-4.8 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,FREEMAIL_FORGED_FROMDOMAIN=0.001,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no |
Commit Message
Zheng Wang
Oct. 27, 2023, 9:16 a.m. UTC
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 <zyytlz.wz@163.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> --- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 1 - 1 file changed, 1 deletion(-)
Comments
On 10/27/23 12:16, Zheng Wang wrote: > 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 <zyytlz.wz@163.com> > Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> > --- > 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); Please send all three patches as a single series and version it with v2. Add cover letter with changelog. # git format-patch --cover-letter -v2 -3
Dmitry Osipenko <dmitry.osipenko@collabora.com> 于2023年10月31日周二 13:49写道: > > On 10/27/23 12:16, Zheng Wang wrote: > > 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 <zyytlz.wz@163.com> > > Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> > > --- > > 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); > > Please send all three patches as a single series and version it with v2. > Add cover letter with changelog. > > # git format-patch --cover-letter -v2 -3 > Thanks for your kind reminder. Will do right now. Best regards, Zheng Wang > -- > Best regards, > Dmitry >
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);