Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp39315rdb; Mon, 30 Oct 2023 22:51:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZPswPk5+tfBZP/QWEAaUMDLuV1bNbnON3RYSaMQCeYru/YrdSa0nKKmT+EpaQhFCbaX3V X-Received: by 2002:a50:8d12:0:b0:53d:7be0:4a88 with SMTP id s18-20020a508d12000000b0053d7be04a88mr74402eds.22.1698731490443; Mon, 30 Oct 2023 22:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698731490; cv=none; d=google.com; s=arc-20160816; b=Mog/RgUWQ0pKinA03OJpKIzTi92pS+Fh7UCbse1pjVzzHV7bN2sFPQI8hDEzjXhemy 6pc1pHyCdPuxf1uGpnro2ygxBhh7gRpz/QxmsHvLItZ9E7HyhTZvRY1lH1u/GcAsxB7S xDaH+pFkWC88jv5t9O4v0RpZihfnV94SIwR46sF3ybqCrkiJ5d8mJEbDY9WXlIA7vi0c 4t+tEC4XS0i1kufvr7+GUO4efvxlTZiSuAFQgbL5oRuEBV9RHiSMfzOaHGK7PT2ycQ6l 5cSeBeyYqHcUkxPHoud8Sg4NOc1f+eJK8OzubrKRpcT/oihnJ+W/MV6Wz4A8NN98XMhn kc5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=w2axISbsw723dKU4BEgqutDQIWsYQsGKvmhqOnKx/Gk=; fh=FhshzpFHaGF7oODbf/VEEXTsiLGdateRgO7T3MfreyM=; b=HntBjap6bJlMDiMGQ4pCH1Lr55lRCj3Rr2wD7IvVIEssC8/EMbCV//Y1mm+BuHaEm8 eza9uyy7+rUUWsPnYqjjVYwN5qpiHkezY4prdEk+QjagXe8WKLGa2U6snW+RHA0bdryy 67Aj0cPkmpgyWCrje96DldfZ2dNoz2QdS6pPcGrq0VM1Tjx+SpO7KS8LAXPlmCyYOMq/ 6Z2e8f4ZadMc7FVgmOpdXnNajIfZ37STP/3Arh6QYTjLfHW7MKndylI9FxDo7lFryFRm FGNY46/dcKwLvmAwbZ2i0rVEQ1Z2ROdDwAKjQJeEmfLfiO6SnbliNjNvZ/8Lnlpb/Vbm mrKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UpybmT78; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q20-20020a50cc94000000b00533dc4e225csi315684edi.679.2023.10.30.22.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 22:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UpybmT78; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8181480412C7; Mon, 30 Oct 2023 22:50:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234987AbjJaFt5 (ORCPT + 99 others); Tue, 31 Oct 2023 01:49:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjJaFt4 (ORCPT ); Tue, 31 Oct 2023 01:49:56 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3ED7BD; Mon, 30 Oct 2023 22:49:53 -0700 (PDT) Received: from [192.168.2.70] (109-252-153-31.dynamic.spd-mgts.ru [109.252.153.31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 3F99B6607377; Tue, 31 Oct 2023 05:49:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698731391; bh=dI0wOQPLuDm+aGKLEQyqzfOoUl5FiiF7FA+cauBzgdI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=UpybmT78QGHVrCgg20nLAL3XcfXO1e6trAm3Jw2dbBTne1Y5BvyDo2y1cP7kPalgB HNQwjuhPQBTcwyR+U4lPwsgTXt55QC6Njb2oO8lrcTNztb3P7kLRCM/29XJnRJPOab kfZIYegagYS5bBsWjLkvbeiNgO9vf0vmVUlUdeHe74RezqP7Pev5Bfi/Ce1VGXLpaA Kd/vSEgq04rQlq0XltIgjzFasUMsJ9BRUjtKQ3/OQ2cSFOBjBi6v5UbDSNPPuVhMd/ N44Fi1OVEi2Rb5QP0jZ975gZFtefVvNHgsOCop+GkRPwHCaxIHBc2vaG7qo6DZng1h x4UKILASZMQgQ== Message-ID: Date: Tue, 31 Oct 2023 08:49:47 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 0/2] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices To: Zheng Wang 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 References: <20231027091612.38896-1-zyytlz.wz@163.com> Content-Language: en-US From: Dmitry Osipenko In-Reply-To: <20231027091612.38896-1-zyytlz.wz@163.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 30 Oct 2023 22:50:52 -0700 (PDT) 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 > Signed-off-by: Dmitry Osipenko > --- > 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 -- Best regards, Dmitry