Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1015792rdb; Sat, 7 Oct 2023 08:13:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsQ36phSENbkkWwOiyjvSF0I2A6rXIDgyJdYz678sj2FUlBHxPMRqywltXX4VdIg3FII4S X-Received: by 2002:a05:6a20:8f0e:b0:16b:f8ef:f31e with SMTP id b14-20020a056a208f0e00b0016bf8eff31emr4545353pzk.5.1696691632570; Sat, 07 Oct 2023 08:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696691632; cv=none; d=google.com; s=arc-20160816; b=vMkN1C792AhMORQokBtzBsruiW/eXJo3t93NNdKenejRrBx6XLzkiJoW3KcFXws9R0 JZpcvEUoh+aN9Dh/FqOTI6ZeOKONnYuaQuo0a4kv016oyZUXeBa5y6AhUP3HrUEhbuTi XtnAh0b6vfX/1fstZEM144jH4RFdApAGlasgRilrritzwTG78mnCrlHanND1/+pWp1V1 VYKSgx5JnKXFq/cALh4+vlNAkwN9s649AjCI1Pt+qyLNfttPVFEUd/ulqnfdOOHDUVcI zXm+BFSJK8Kf2pouV5UHiEkVzZxkzQiwdyu2PMLZFd8BoAjCeDnrdTsXX3FBRJUVkN4+ 1bhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pLGCT6nzIXq1ojIAcOdbo8lCaLEQrbTq4AQgYnWuREc=; fh=p4lFTteQrj7QKkjZx5GrJF7UyFWlI0VbC1fwmWiOa58=; b=RUcpACiiuwiLFwGgIszysGj7CpyaPMvGgYL3y2fZJFOy65LiKdG3ljut5qEJazUPYM R5pq9s9R1dxrLke3kirPE9HBthVsvtvz1MIGcytWxFVgQqGudvZRC//dkB8iExpWpi0B b967iuW7MjJXwCtMUFx3AzV8dKyJQTr1FAnBsNGIbIPgoY0lnV+bbChyHCrgMvYfD/BH wUvjEamKfBeHhLlVKIr9+T6LmZDQyYFCw5a1THtRPBPolsimbUymVSZzO+svFmReNLiz Ze8rCoGYz1aovu3RFfhZL3Fc9Yc4AAy75S5EOsV7I4Bpq1HdyJxniFGK+J8M/4my4qf4 2uug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="YO9WG4/P"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id n5-20020a170903110500b001bb2093efb6si6521091plh.45.2023.10.07.08.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 08:13:52 -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=@kernel.org header.s=k20201202 header.b="YO9WG4/P"; 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=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2DD64807747A; Sat, 7 Oct 2023 08:13:50 -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 S1344012AbjJGPNg (ORCPT + 99 others); Sat, 7 Oct 2023 11:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344011AbjJGPNf (ORCPT ); Sat, 7 Oct 2023 11:13:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B372BA for ; Sat, 7 Oct 2023 08:13:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D111C433C7; Sat, 7 Oct 2023 15:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696691612; bh=m89gazFfrv75JcJMlTacH3tiK09irLU+A97u2aDkxBU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YO9WG4/P5pcHX0L59vCYD0VJkvi8oRSDh7oXwbRb66Emjoem3g9/VIEfrly7YtBqv BRzlfWtip+BGlVSHm9QV+n6NdBRIqBWH/6PdT35W4Kb0NKS0zfkdTw4h0/xfrXUTvz RJSlqtANVRhvktF5ylJVyf3631CdiGFxEzt494mxuCzzlxthftyfJ5A3xid+FPOnzF PjeKRNsdhaiEk5bFGgQqlVSXWWxSgDzMe8Yd3nWo45HPZiXdpwnWb7cr1ATx3fVkF9 cka8NB/Qou7tV8mUoo8g/11VzP8tQKlVfCjhLVDpPMvD+iWi/nQsB1M8PFxFRYGHQk tZWnkRmBe+8xQ== Date: Sat, 7 Oct 2023 17:13:28 +0200 From: Simon Horman To: Chengfeng Ye Cc: 3chas3@gmail.com, davem@davemloft.net, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] atm: solos-pci: Fix potential deadlock on &tx_queue_lock Message-ID: <20231007151328.GD831234@kernel.org> References: <20231005074917.65161-1-dg573847474@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231005074917.65161-1-dg573847474@gmail.com> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Sat, 07 Oct 2023 08:13:50 -0700 (PDT) X-Spam-Level: ** On Thu, Oct 05, 2023 at 07:49:17AM +0000, Chengfeng Ye wrote: > As &card->tx_queue_lock is acquired under softirq context along the > following call chain from solos_bh(), other acquisition of the same > lock inside process context should disable at least bh to avoid double > lock. > > > pclose() > --> spin_lock(&card->tx_queue_lock) > > --> solos_bh() > --> fpga_tx() > --> spin_lock(&card->tx_queue_lock) > > This flaw was found by an experimental static analysis tool I am > developing for irq-related deadlock. > > To prevent the potential deadlock, the patch uses spin_lock_irqsave() > on &card->tx_queue_lock under process context code consistently to > prevent the possible deadlock scenario. > > Fixes: 213e85d38912 ("solos-pci: clean up pclose() function") > Signed-off-by: Chengfeng Ye > --- > V2: add fix tag, and split into two patches Reviewed-by: Simon Horman