Message ID | 0d23dfd380ba4466d8e6208dcbf40a250a734099.1684000646.git.mchehab@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5902517vqo; Sat, 13 May 2023 10:59:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70SuLVv4K9Ma6P1sST00501gWAm0xNUK7V8l1speljFEd0zAtmMdMzXkMRSo1m6R+PU7yn X-Received: by 2002:aa7:88ce:0:b0:646:74ce:a36c with SMTP id k14-20020aa788ce000000b0064674cea36cmr27464823pff.8.1684000765052; Sat, 13 May 2023 10:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684000765; cv=none; d=google.com; s=arc-20160816; b=N7I96ymSfPQ/+Mm24Bkkd9zVEbgAy8fCGTZTxEWXlQnjB3NXMrJnFYH6aor3oK5/N8 WFDtRwUkRwfqjLKygiywBFRIETw11gC6QgDzQOCxQwR81SpT8Io28FIIO0RG0Kczx/XU wa3idQfpuz9F0zeZmwHNx67Q2DQZMXxc65qKNPT1hBKi430jzy0hRszdyX8MqgTqsy2v bPTRg5aiJIL6so5Y4q0WE2cxf1zYvtpFaBSZxr3xz7myz6DvEeyQsgEKydnhjaL9Bkuf c3AxIklkCqnSQ8UCtLk/vay6Ep6zg1VfsdCRhwds8arY1aIqmuJbaWi8e3sCGX8Jxpfl 4Mgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=hYkd2d5K5kQ+0xBu26akOzDzwBP5hOTgjVSfOg4M+Z0=; b=ST+FHUAPY6lwayIhreJqRCUCqWsEjfTD/SCIeKJHQG/9MAbecTq9pLxqvd6zB4xukP s3/VVINrB3RhZxTloNSZwdcBAZW+g/eCjTXY9AEQYC6hmKv9XkemlbPYy02E9slCV7Ey 9xHSzM567vDQapwKYiXYgUBr8bRuSWVnsFz4Yqd2P77Kxik1vt9OKbyH2JP4BPmx8ZgN 8JvVoMx11SwXtW3qfwGhsjfwbAK5UbsJjvIrjAjBVVUDY7oaT3SVDqfh+3ydt3ZmlbCq 5VtKYjhzIluT9ZXpSKsd/lahZzjq4dxSo7U4p7uid9BBRvrLk57vZrgMA3tLTZQpml2p WL/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=Y5jYsmm9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h131-20020a636c89000000b0051f0d0d6343si11551641pgc.688.2023.05.13.10.59.09; Sat, 13 May 2023 10:59:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=Y5jYsmm9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236496AbjEMR6E (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Sat, 13 May 2023 13:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232629AbjEMR5t (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 13 May 2023 13:57:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DEA22133; Sat, 13 May 2023 10:57:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D8B2161BCB; Sat, 13 May 2023 17:57:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A783C4339C; Sat, 13 May 2023 17:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684000666; bh=17CypJr+LuSnQyYNvIQktRqRkHT7zYk/k1QXGCJ3q9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5jYsmm9xtSDqVJlFGyQ5KonuJ6Lz3Lc0k1c6mH18rxQgtEdpIhT1t9LsUbj6Pdco M5CFD9SKG2lvhd6kINZJ1TsRD1YGGvl3dtB4UO4imTDi/AvghUMX4Kyn/F5Iz7nTFu jfDAqXbHai1vbxChXJ63nskR78OxPIET0vJaAhvqq+GD4Pi+SeXaOvuwqOiumyuYki JJWWK/c1SaPASUCVBL+zubA227ghwvVWRe0CqRq9UJGAnLtbAWul9ZHFiv4cEK0ANv g4iwpjhZk3NQ/BlmpCQNs8Hq0Wqxinok/zqwBxwjYKfTLKOpU9pFdfspf0twKHLEEr XTY1pSSEubAxQ== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from <mchehab@kernel.org>) id 1pxtV1-001txY-0z; Sat, 13 May 2023 18:57:43 +0100 From: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: Duoming Zhou <duoming@zju.edu.cn>, Abylay Ospan <aospan@netup.ru>, Mauro Carvalho Chehab <mchehab@kernel.org>, Sergey Kozlov <serjk@netup.ru>, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 03/24] media: netup_unidvb: fix use-after-free bug caused by del_timer() Date: Sat, 13 May 2023 18:57:20 +0100 Message-Id: <0d23dfd380ba4466d8e6208dcbf40a250a734099.1684000646.git.mchehab@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <53558de2b5c4f4ee6bfcfbe34e27071c2d0073d5.1684000646.git.mchehab@kernel.org> References: <53558de2b5c4f4ee6bfcfbe34e27071c2d0073d5.1684000646.git.mchehab@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765802786217670056?= X-GMAIL-MSGID: =?utf-8?q?1765802786217670056?= |
Series |
[01/24] media: pvrusb2: fix DVB_CORE dependency
|
|
Commit Message
Mauro Carvalho Chehab
May 13, 2023, 5:57 p.m. UTC
From: Duoming Zhou <duoming@zju.edu.cn> When Universal DVB card is detaching, netup_unidvb_dma_fini() uses del_timer() to stop dma->timeout timer. But when timer handler netup_unidvb_dma_timeout() is running, del_timer() could not stop it. As a result, the use-after-free bug could happen. The process is shown below: (cleanup routine) | (timer routine) | mod_timer(&dev->tx_sim_timer, ..) netup_unidvb_finidev() | (wait a time) netup_unidvb_dma_fini() | netup_unidvb_dma_timeout() del_timer(&dma->timeout); | | ndev->pci_dev->dev //USE Fix by changing del_timer() to del_timer_sync(). Link: https://lore.kernel.org/linux-media/20230308125514.4208-1-duoming@zju.edu.cn Fixes: 52b1eaf4c59a ("[media] netup_unidvb: NetUP Universal DVB-S/S2/T/T2/C PCI-E card driver") Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> --- drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c index 8287851b5ffd..aaa1d2dedebd 100644 --- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c @@ -697,7 +697,7 @@ static void netup_unidvb_dma_fini(struct netup_unidvb_dev *ndev, int num) netup_unidvb_dma_enable(dma, 0); msleep(50); cancel_work_sync(&dma->work); - del_timer(&dma->timeout); + del_timer_sync(&dma->timeout); } static int netup_unidvb_dma_setup(struct netup_unidvb_dev *ndev)