Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp70289rdb; Tue, 31 Oct 2023 00:23:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKPf34ufe/hyoMaUpstQXJMusyTGhdWSgpX5vzjXwlVx9ZgaFc5Oagg3/R4p/MnwxtgnIH X-Received: by 2002:a17:903:244d:b0:1cc:4d99:36f2 with SMTP id l13-20020a170903244d00b001cc4d9936f2mr4853750pls.56.1698737011397; Tue, 31 Oct 2023 00:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698737011; cv=none; d=google.com; s=arc-20160816; b=dULEGL220Wod5QlMg5py6LMl+ZmXGlESRt5wb0v1wd4wu+O85K0U28HAYRHkcJHYTn oPjtLXoGZScz5xxB+kja52HH7agznHjC9hOFtTJq1TfLDUR9+3dDH8h/ZMUV5B4X15dS yb5TQUAb+STNbri1fjJ4vqrX463jC71zHOFYGQ8g4k+G8FH9Lt32qmAsRcZ4H3rp27Ly 3v2vk7vR2pdc0DBeCJonXVSPa2iOck5NQK/nggSM3En0u+R6S/mqB284Bfb9tQS30Kdn S5BwPYISVuui0LZ1lF6qbzkQhcnZ5OcxlX3kDW2TIn/sY3pTEvXGwZB+NwrxFyywZgaR 1yPg== 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=6VOElouc2GMG6bSXp2UcAdff2CtTi6AX9Q0p7itVxKA=; fh=BUOxERKiHMKNK1EXVoIyLQc16i4PhksEBSx6UgkZJ98=; b=LbP6KYPDqHsjBycE+HUXmqLWJhlYBQWZtAOTccAayZrLJC/rYMh9qf6Yq9MMKeRRaY kOd3Cq1RliEvVCTHwdAO7xjgPySLxd7QEKBy5sl48LP/GyRkHDUSEMdYslhd9mhFWXoh d4JM/xdP1OEBjE+2uQAqj0zD8JysxOMD/ehmggNOscaKG64uM2Twzzeavd6PHNVWM1GO b+mSxN23sRj6fH1W/iCNzlkOjKmYPizeR+E1Z51606FTvFH6ciCgxcO1LscXuoUA62aO MR0FWmpMVsY6q6yLiqIM092aiXbaSo5xV2MRilW02o9PoEWWgQX0E6/jBMOlxttWrrij RCEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=YUV1ANsc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id jo13-20020a170903054d00b001b5589848absi616090plb.234.2023.10.31.00.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 00:23:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=YUV1ANsc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 EADBF80C3AAA; Tue, 31 Oct 2023 00:23:28 -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 S1343606AbjJaHXL (ORCPT + 99 others); Tue, 31 Oct 2023 03:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343618AbjJaHXK (ORCPT ); Tue, 31 Oct 2023 03:23:10 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.216]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2980D8F; Tue, 31 Oct 2023 00:23:06 -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=6VOEl ouc2GMG6bSXp2UcAdff2CtTi6AX9Q0p7itVxKA=; b=YUV1ANsczlmQDj/76ZA/F DxZ5wllI9YoGk7uy2OyCh3HhSLS1EPXApEobV6F25x9IaIfApQi8VjbHvOd617Kn 5gcsTup1Tl2Aw56cKWnnOloOPsYuHdUjzD8z3XQCKtqOtFJAv0p++IDe91sp5llo /MZQS072Fv79ssouXRSXIQ= Received: from leanderwang-LC4.localdomain (unknown [111.206.145.21]) by zwqz-smtp-mta-g5-3 (Coremail) with SMTP id _____wC3X7c_q0BlUkngBw--.14054S2; Tue, 31 Oct 2023 15:22:39 +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 0/3] Fix use-after-free bug in mtk_jpeg_dec_device_run and fix schedule error in mtk_jpegdec_worker Date: Tue, 31 Oct 2023 15:22:33 +0800 Message-Id: <20231031072236.21077-1-zyytlz.wz@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wC3X7c_q0BlUkngBw--.14054S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jw4xJry8Zw1DWryDtw4DCFg_yoWkArX_WF 9Y9wn7uw18G3srJF4ayFy5ZrW8GFy7KF45GFZ8KFs5JFy5XFZIqF1vyrZ3uan3Wa12vF43 Gr4FqF4UXw1j9jkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUxsqJUUUUU== X-Originating-IP: [111.206.145.21] X-CM-SenderInfo: h2113zf2oz6qqrwthudrp/xtbBzgAaU2I0bIoWkgAAsz 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:23:29 -0700 (PDT) Hello, This v2 series fixes the use-after-free bug in mtk_jpeg_dec_device_run. 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