Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2172583rdf; Mon, 6 Nov 2023 06:49:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3RiXO+87qkeQlMWj5manLr4SOSvR+JDA4gWa+jWVq2VaQpyv8kssjEyjnZEG2Oidx1hDl X-Received: by 2002:a05:6871:220f:b0:1f0:1b67:3685 with SMTP id sc15-20020a056871220f00b001f01b673685mr20699926oab.30.1699282157561; Mon, 06 Nov 2023 06:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699282157; cv=none; d=google.com; s=arc-20160816; b=Gw2yBTXBMpIWPsxnxBX1scl5l2AcAWY/ySiteWD5KmNg5yFIwMjyILXyyZ1gUo3j5f El2xoPG5HO5ibMP5prJtSUWgXjoHr4aEuSoZ6qd60zD8lanXMwNEnnweaOw36OX1m8qv ZbZedAZh4l0mTXyG0YK88AZFM+qKll3pvFuTlPA4qmXsopnJCpZlp4T9fMyz8NeZ38RI ASKDeRPCdtkncxvFaRZswD3J/BNaHxqA+RbbCmVDY99o+S6JjV64Uw1Xc5EcbHKliRMe KYkuXPCSZy+vu4qGprLVW9dm8PbUL7tOhKaik99JfQPAhpbl4oGQkbJx7V4jQT8KH1Jt HKVQ== 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=J+2+1vbe2QKJ61F+pm+qTQ42g1lLVufrDL4LIIdBYUE=; b=M+8ehrWU9j24wsLTUqPmiDqfVD2xNJhQnIhyGOhcpO3bp9BLEHYbvkMLrtWhNlYzWc BZHg/OhjC2TE67sT3uNe2/NJsImIXcMXyOx6wLBwjUIJQKAeMsz4oC+/Ob0OICpM5vaZ K5HEYtLW8HSHs2UEdYICcvj0bmvOY4KGoBSrq8lk9DoIk2ZqjtUGffNxhzGIiVavS3ZS 6zEV1D5iQAT7ivQBOXl4yTGTO852o5V6c1MFtcZzcTBcUIchhYOYYnnwIARJJbvqm15o iOZILNOcb4RHk4KruWEZe1R5xcnBxCDmbrhb8woQcGvWP0sYacbTfL+7B5eXrMyW2kPl MQYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=jalQRBQ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id r136-20020a632b8e000000b005b9293dea1bsi7679186pgr.645.2023.11.06.06.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 06:49:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=jalQRBQ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 597578027942; Mon, 6 Nov 2023 06:49:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231881AbjKFOtJ (ORCPT + 99 others); Mon, 6 Nov 2023 09:49:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjKFOtG (ORCPT ); Mon, 6 Nov 2023 09:49:06 -0500 Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5966EBB; Mon, 6 Nov 2023 06:49:01 -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=SJWU5 tnjso1vDAK736GkMoFEm3BXg8uhBy9G73LcJvU=; b=jalQRBQ7hEMBcmB2u/d4h hTXq48fz6pmTEoH02MLLdSC0ZmaoDKXUaZgnED5hil+Tqn5DHuAYJ9LVN0nSk8GE mTSSlA0vGYZJOoOWVPCTQQNTtR39ldoB5lyHTt5AeUqunIbRLQJUIPm3egtlW4MH LhW9HpC33En1Nrmj4YZmLE= Received: from leanderwang-LC4.localdomain (unknown [111.206.145.21]) by zwqz-smtp-mta-g2-2 (Coremail) with SMTP id _____wAXH5Gu_Ehl9FmbBw--.1952S3; Mon, 06 Nov 2023 22:48:21 +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 1/3] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices Date: Mon, 6 Nov 2023 22:48:09 +0800 Message-Id: <20231106144811.868127-2-zyytlz.wz@163.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231106144811.868127-1-zyytlz.wz@163.com> References: <20231106144811.868127-1-zyytlz.wz@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wAXH5Gu_Ehl9FmbBw--.1952S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zw4rtF48tF1UJF4fZr4xWFg_yoW8Gr45pF WfK348CrWUGF4qgryDAa47ZFy5Gwnaya40gr47uwn2q393XF47t34jya4FqFWxXF9rCFy3 tF1FvryfWF4jvFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0ziBbyJUUUUU= X-Originating-IP: [111.206.145.21] X-CM-SenderInfo: h2113zf2oz6qqrwthudrp/xtbBzhYgU2I0bOKhsAAAsi 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,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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 06:49:16 -0800 (PST) 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