Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp46750rdb; Mon, 30 Oct 2023 23:13:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKXjx5IxwyP6hoHZLFw9MncAsIeDX1TTcBPCLanNSt7aJa2ZgfQsTRQNO5GTLZU0y8NT9V X-Received: by 2002:aa7:d70f:0:b0:543:5364:33b4 with SMTP id t15-20020aa7d70f000000b00543536433b4mr2239965edq.11.1698732825770; Mon, 30 Oct 2023 23:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698732825; cv=none; d=google.com; s=arc-20160816; b=F9wZ8dq8LPsSpotOItGSSaUQbqm8+Q/Ji0B9bqNDLPVPeFHgOArhYQ01Tpy6ega5hk rGt7Ewz/T2FThsY4vIqyL592lxQbIdQBEaejE5om/Kxg5fvi5+hbje1DWW8ncVLAlDs8 72V0TpO2KkajE/oObVAmIgnl1/YAiJHSY5B/VRfNq1/k/FczxYRqxcY7AHewNMpTRRnM kQ0vU7otkIeleSb+vAyDCCgWI1D2tDwgLRTPbX/jWATLCrSaom7tH9OuQbogUkSsydDS ThwKYJlkYG+KL65Ed8xQKAvnVzWvhvklPblK7KFy6ik/dtMgwyd279qk2bsm4vxvRb3V Xm/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=CnsBwc25XTCfMAo0+GI5roZ5GuLTSammQf7P8YSq7yM=; fh=6ZC2xuKM40NMaBq+K4yJnkfUhQqxWu2kRbOuTXrzt04=; b=aerxhwrHTqqf6K9VpkZZRFRuOiJ7M17jUb7P9kxiHknUb7l9JDcHDOkJ4SHKbf6jgv fUa5OMn6iJTebZ5HDQ6wnIGkHG5rYutThepioc2A851hkecuJVIyEZlTKWAP0sSN7C5L 0SdwHAiBWc8xXbREW2a4h2FWoEecbIq/nXeqbMu/hvMCYFX8RXFnCZvQJkNNqpbBZy02 0KGeA2OJ54XeReZUpqMx0q/k6H3Eqyu1rNuwkWpJyDffNksKNqjmqs5n0J73Ewa8Jwm7 V6yAPtTcYUp52CcUkEYtlo/VAGPLKui+3x6q+Zl8bmqv1m9D52jQEnelaGfdt4hdyzpI hCIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hgxBa98J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id h28-20020a056402095c00b005435682c948si340417edz.558.2023.10.30.23.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 23:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hgxBa98J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 47AA080A4989; Mon, 30 Oct 2023 23:13:42 -0700 (PDT) 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 S235993AbjJaGNa (ORCPT + 99 others); Tue, 31 Oct 2023 02:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235999AbjJaGN0 (ORCPT ); Tue, 31 Oct 2023 02:13:26 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D82C183; Mon, 30 Oct 2023 23:13:24 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3b2e44c7941so3643677b6e.2; Mon, 30 Oct 2023 23:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698732803; x=1699337603; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CnsBwc25XTCfMAo0+GI5roZ5GuLTSammQf7P8YSq7yM=; b=hgxBa98JlaXFcN+0XX3f8evRH6M/3T1boCKIw/x+zNzesPxRa4y2m7mtE27CT95vge oZjjUERKpTfCrI/r9LjOdksYvyiTt3D1/Iokrvre23eo/rds6SJ1dfde+A9IMYwqtGe/ 3EG+1oOyd+mbLRauZo5ln9XJHwpyYE8SAe7C+dy32Pt6eOygR+Xj4XLmksiMmK5mNAj5 lP4zrGleSqh8B6d/6uspB0hNftfyCQYRemxGNolY3t3AbcDeeu84c+YxlzI7hzKDnwd8 Bzn3fRyDtKItQuhXA9EOo/n8I5TXmgrxPZK2EqZvw0fXWpy7qA5aA/lxbeoLHIJdV0GF +Zrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698732803; x=1699337603; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CnsBwc25XTCfMAo0+GI5roZ5GuLTSammQf7P8YSq7yM=; b=rBqa/7OJ1UxZGnEVWaoLK25zaU/+28WhAlGu37wswiLjRd0KbYUZaiPawILGLRPo+6 zToFaufyQqpmg5aqWIxVmytDUSvTisi1tisVtyydrVtZGHBJzOBxWh/nJUpus5l6c+b3 FUZNHYqFeExL8MXP2leo8wImuM3urTBX2yQxtOWk04lnXNuVoMTWDKm+Pqo5CiJX9thv olnKGZVptTOGu/LysxgCaKs9vbuAmAtSLfOv2EikNp2etqz9DjNOio6WSv000FnUFFQ2 CsfZwMDM65HU+43ucW8bdlDGC56HTmabvA4GlxredSlzbdmNqlhkxKCkEXGp6ayZpT+z Vtqw== X-Gm-Message-State: AOJu0YxzoAv2VcSmkdzZAeHiTV3+HL2aa2DaVQPd0tZ6oQ3HUQqVeKMB zMLrvUbBCpRDtPT4mS31LAi9bhLkNKsB9kPEx2o= X-Received: by 2002:a05:6808:646:b0:3b2:d8c8:7bfa with SMTP id z6-20020a056808064600b003b2d8c87bfamr13000899oih.8.1698732803133; Mon, 30 Oct 2023 23:13:23 -0700 (PDT) MIME-Version: 1.0 References: <20231027091612.38896-1-zyytlz.wz@163.com> In-Reply-To: From: Zheng Hacker Date: Tue, 31 Oct 2023 14:13:12 +0800 Message-ID: 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: Dmitry Osipenko Cc: Zheng Wang , 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, 1395428693sheep@gmail.com, alex000young@gmail.com, amergnat@baylibre.com, wenst@chromium.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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, 30 Oct 2023 23:13:42 -0700 (PDT) Dmitry Osipenko =E4=BA=8E2023=E5=B9=B410=E6= =9C=8831=E6=97=A5=E5=91=A8=E4=BA=8C 13:49=E5=86=99=E9=81=93=EF=BC=9A > > 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 un= canceled 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/dri= vers/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_devic= e *pdev) > > { > > struct mtk_jpeg_dev *jpeg =3D 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 > Thanks for your kind reminder. Will do right now. Best regards, Zheng Wang > -- > Best regards, > Dmitry >