Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2172954rdf; Mon, 6 Nov 2023 06:49:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHudruZJ6z3EeR1lYt7asCNK3biEUL6RM+OVJyeSVjoPyyAO5MbCrFShUH6qIZKI+50HQ4k X-Received: by 2002:a05:6a00:190b:b0:6bd:a8a3:cc59 with SMTP id y11-20020a056a00190b00b006bda8a3cc59mr32224573pfi.24.1699282197074; Mon, 06 Nov 2023 06:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699282197; cv=none; d=google.com; s=arc-20160816; b=YOHjM5kPoWQymMiG7L6WIEPlrEEb204Tgw5zq3yP/5kUCiY3BjAp0zYgFQbAVTISaH +7KwZLgIui+fNgzB7xgzbAPOk7GCqT/tZWWEafuG5+EuSFjJcz9+q+o8zhQF6CQUHXHp 4yVAwqOsWUIiACmMpOSUwUwDOvea6UaW93KzTpvPRgfLXPgFV/JbjPttDyIjRfII27j4 XslZVHu63Vc6S+wLM/9zhjEmvxb1b6WKt3d8khPZT7mBDOi+Vd3fPnAmHdJ+v0jzHLMb K2+dQ5dhDn0/1uxKOleG3/VvmHPjmHaz1DPDKWsd6o6CaDJGLyfq/RdasAklZpr9O9He OFrA== 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=h6TLWB9cdUKq7s1SXHoFgVVhZtXcumU4Vs0W88ItZxg=; fh=J+2+1vbe2QKJ61F+pm+qTQ42g1lLVufrDL4LIIdBYUE=; b=S2l8veyp0bzPrBxTCMmYq53Uhbumo8xpHd1VoFyLR6/FzmUSJuMLdRlFKsI8jG/do/ M0tQISCgUZ03a4S1NVDjGso4SHvy7gwMU8Bw7DREr9jQDX87kQcNOHNXAuU+iEdma9rX oPweqJokzUzn0eSWoWk1TYmDBQMa2VitDJ2DUOzYCt92Epj2KeVNE+7gd7qWUAm7X5Fo dlmbEIghBkI1gGMdIPd+VTo/koQS5rONvQD+w8ZhIeaodIUGi+MxrYWxwPq3hzAlmYUK MUBHUCiwGdGCLJtEk+GcQx+Z/qyolJwFH+XvVOe9i242hlRI7H2qs1IObL38DveiQKlC ShGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=ZPA7Oufn; 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 t27-20020a056a00139b00b006c0fe935fa1si8692512pfg.181.2023.11.06.06.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 06:49:56 -0800 (PST) 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=ZPA7Oufn; 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 1527680A8BB6; Mon, 6 Nov 2023 06:49:47 -0800 (PST) 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 S231920AbjKFOtM (ORCPT + 99 others); Mon, 6 Nov 2023 09:49:12 -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 ); 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 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 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=-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,T_SCC_BODY_TEXT_LINE 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]); Mon, 06 Nov 2023 06:49:47 -0800 (PST) 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(-) -- 2.25.1