[RESEND,v2,0/3] Fix use-after-free bug in mtk_jpeg_dec_device_run and fix schedule error in mtk_jpegdec_worker
Message ID | 20231106144811.868127-1-zyytlz.wz@163.com (mailing list archive) |
---|---|
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 1r00ua-000vWD-DK; Mon, 06 Nov 2023 14:49:08 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbjKFOtI (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Mon, 6 Nov 2023 09:49:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231792AbjKFOtG (ORCPT <rfc822;linux-media@vger.kernel.org>); Mon, 6 Nov 2023 09:49:06 -0500 Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.219]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C304F4; Mon, 6 Nov 2023 06:49:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=h6TLW B9cdUKq7s1SXHoFgVVhZtXcumU4Vs0W88ItZxg=; b=ZPA7OufnOu36o5kXXHolF yHmqXp6ZOcgHEsclhhnuF4IXQ9/p5EpzgU603j7f+uYDb89cUabY7AFYi+rS5UWC asp5dZ/d38Q5NhDcz0+OO/J1GO/sdZysYrs3YaD4UCJzWFtHQpM/Gb/r6JX+UZ2A 3SPNGLoWv8CwvY4yJwV9SM= Received: from leanderwang-LC4.localdomain (unknown [111.206.145.21]) by zwqz-smtp-mta-g2-2 (Coremail) with SMTP id _____wAXH5Gu_Ehl9FmbBw--.1952S2; Mon, 06 Nov 2023 22:48:14 +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, amergnat@baylibre.com, wenst@chromium.org, stable@vger.kernel.org, Zheng Wang <zyytlz.wz@163.com> Subject: [RESEND PATCH v2 0/3] Fix use-after-free bug in mtk_jpeg_dec_device_run and fix schedule error in mtk_jpegdec_worker Date: Mon, 6 Nov 2023 22:48:08 +0800 Message-Id: <20231106144811.868127-1-zyytlz.wz@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wAXH5Gu_Ehl9FmbBw--.1952S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jw45ury8KFyktr4DCry7GFg_yoWktrX_WF 9Y9w1kuw18G3s8JF4ayFy5ZrW8KF9FgF45GFZ8KFs5JFy5XFZIqF1vy393uan3Wa1avF43 Gr4FqF45Xw1j9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_rWrJUUUUU== X-Originating-IP: [111.206.145.21] X-CM-SenderInfo: h2113zf2oz6qqrwthudrp/xtbBmwggU1etjJUS8wAAsi 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_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 |
Series |
Fix use-after-free bug in mtk_jpeg_dec_device_run and fix schedule error in mtk_jpegdec_worker
|
|
Message
Zheng Wang
Nov. 6, 2023, 2:48 p.m. UTC
Hello, This v2 series fixes the use-after-free bug in mtk_jpeg_dec_device_run. This patch fixes the security bug in chrome-os. It inclues reverting the incomplete fix before and make the right fix. Also,it fixes the error of timeout-worker-schedule in multiple-core devices. 1. Remove cancel worker in mtk_jpeg_remove for the worker is only registered in single-core device but we try to cacnel it in both single-core and multiple-core devices. 2. Fix use-after-free bug by delay the schedule_delayed_work only if mtk_jpeg_set_dec_dst runs successfully. 3. Delay the schedule_delayed_work in mtk_jpegdec_worker as it has same code logic in mtk_jpeg_dec_device_run. version 2 changes -put the patches into on series suggested by Dmitry Zheng Wang (3): media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run media: mtk-jpeg: Fix timeout schedule error in mtk_jpegdec_worker. .../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
Comments
On 06/11/2023 15:48, Zheng Wang wrote: > Hello, > > This v2 series fixes the use-after-free bug in mtk_jpeg_dec_device_run. > This patch fixes the security bug in chrome-os. > It inclues reverting the incomplete fix before and make the right fix. > Also,it fixes the error of timeout-worker-schedule in multiple-core > devices. > > 1. Remove cancel worker in mtk_jpeg_remove for the worker is only > registered in single-core device but we try to cacnel it in both > single-core and multiple-core devices. > > 2. Fix use-after-free bug by delay the schedule_delayed_work only if > mtk_jpeg_set_dec_dst runs successfully. > > 3. Delay the schedule_delayed_work in mtk_jpegdec_worker as it has same > code logic in mtk_jpeg_dec_device_run. > > version 2 changes > > -put the patches into on series suggested by Dmitry > > Zheng Wang (3): > media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the > crash of multi-core JPEG devices > media: mtk-jpeg: Fix use after free bug due to error path handling > in mtk_jpeg_dec_device_run > media: mtk-jpeg: Fix timeout schedule error in mtk_jpegdec_worker. > > .../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > Please don't resend. If it is in patchwork.linuxtv.org then it is good. Fixes (unless they fix something really nasty) can take several weeks before they are picked up. I usually schedule 2 or 3 rounds per kernel cycle where I go through all the pending patches with fixes. Regards, Hans
Hans Verkuil <hverkuil@xs4all.nl> 于2023年11月7日周二 18:14写道: > > On 06/11/2023 15:48, Zheng Wang wrote: > > Hello, > > > > This v2 series fixes the use-after-free bug in mtk_jpeg_dec_device_run. > > This patch fixes the security bug in chrome-os. > > It inclues reverting the incomplete fix before and make the right fix. > > Also,it fixes the error of timeout-worker-schedule in multiple-core > > devices. > > > > 1. Remove cancel worker in mtk_jpeg_remove for the worker is only > > registered in single-core device but we try to cacnel it in both > > single-core and multiple-core devices. > > > > 2. Fix use-after-free bug by delay the schedule_delayed_work only if > > mtk_jpeg_set_dec_dst runs successfully. > > > > 3. Delay the schedule_delayed_work in mtk_jpegdec_worker as it has same > > code logic in mtk_jpeg_dec_device_run. > > > > version 2 changes > > > > -put the patches into on series suggested by Dmitry > > > > Zheng Wang (3): > > media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the > > crash of multi-core JPEG devices > > media: mtk-jpeg: Fix use after free bug due to error path handling > > in mtk_jpeg_dec_device_run > > media: mtk-jpeg: Fix timeout schedule error in mtk_jpegdec_worker. > > > > .../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 13 ++++++------- > > 1 file changed, 6 insertions(+), 7 deletions(-) > > > > Please don't resend. If it is in patchwork.linuxtv.org then it is good. > Fixes (unless they fix something really nasty) can take several weeks before > they are picked up. I usually schedule 2 or 3 rounds per kernel cycle where > I go through all the pending patches with fixes. > Oh Sorry for my rudeness. And I'm deeply appreciative of your contributions to the community. Best regards, Zheng > Regards, > > Hans