Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1028441rdb; Sat, 7 Oct 2023 08:44:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+TK4bzxohO8Qk+Uq3R0BN6aA6medZvxDSxc6hW1xxLSAsPc0gChS1Lymv0qLn4bvfnoqC X-Received: by 2002:a05:6a20:8f0c:b0:13f:9cee:ff42 with SMTP id b12-20020a056a208f0c00b0013f9ceeff42mr13931310pzk.41.1696693459817; Sat, 07 Oct 2023 08:44:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696693459; cv=none; d=google.com; s=arc-20160816; b=bQC81dqcf/7gFwNwjKPMIOfG4fXmFn/3/1MuSn1CwYdYll4Cl60+w87Qx+e6t/oC9D 8EorJFNJ++17jZ1T4r/4fPB/rN60GpDoYpKFQ84N6dW6sjwy5T5v71298iexCcSlWqlC LQkaL5cMzoSVCPfq/00cz3FvlL1q2VBTdtPLJHR1L3V27IJzopXhRGzcvaYRwMxXxsxj kySd0DLOtcAK2wiVFJ1U/+aC66zHIGh4ze14EZxOJ9x+UxTgr4SD1etiFlRrAtlqbVIN WnXuC3cfgclmi2osN8RSUXxlQDhoL3Gc4Vyay50ZftRjQWccrRam4i2Q8HChvtTC+oz0 4joA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=V6Z5TerGNyehqM1iknsGWSFNCfXFAQQJnxB4zmAfJjM=; fh=9PtqI2JhjsEEUF61N+KBeYlRhAWWzcX0C5+j/kUaa1U=; b=xPBt0uLgxP1IX2m2DE9PfHiTaRauuoizlEuHmHwajiPKKx+C3MkMaLXkcIx/MuJjCD +tG6JnyT6P3mmRaMW8PHRwM5lHbnCKbmvvHlt+PMDWzYdPJxdwOqzWQQS3iH+s2B2OiW L9vZOFNZMJUnwH1Km9YaX2Sy10P0RGOpT4PqDK+BpuV3FEPvtdA8A7soxvpfZuf/sO6A E0mzM15W13M4GmB5+HYpkdnjv26jfsuQA9mFMJAyvM/HsQlsaFrZ9I/cQLOLEh3HZfku xSN80j+mtjpBtQS6kskNjRVlS1pExfytsh2whfHoucVqVS0kpZZz5ZsxW29VvwvJXKDA LVVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k5o+pEhe; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b14-20020a056a00114e00b0068a85532963si3815803pfm.160.2023.10.07.08.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 08:44:19 -0700 (PDT) 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=@gmail.com header.s=20230601 header.b=k5o+pEhe; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D38898077992; Sat, 7 Oct 2023 08:44:18 -0700 (PDT) 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 S1344017AbjJGPoP (ORCPT + 99 others); Sat, 7 Oct 2023 11:44:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233364AbjJGPoO (ORCPT ); Sat, 7 Oct 2023 11:44:14 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81F0EBC; Sat, 7 Oct 2023 08:44:13 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40675f06f1fso24945295e9.1; Sat, 07 Oct 2023 08:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696693452; x=1697298252; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=V6Z5TerGNyehqM1iknsGWSFNCfXFAQQJnxB4zmAfJjM=; b=k5o+pEhe2v7ld13voD6aXTw093Y9u/bgNjH3D7YLy+fDBVoIVbc7G3jacWV1ma9SLP y9Nsypuzk6DNbU2nY8GFGJ3m92TkMPkUNkpjv5h5AziFAHBnK+YZIgr1CVt8La2/HXgm RRx2azwfuYZifg21PSSL8fVEawQ6OljjSc8b/FsH2jwb+dnM9tkA9JItJesrMGSAb/tb KSUcHSLeBkHT4BDvtMRr9W2EjURO5M7ShgN2sdggZIdvvBxiZPGfDFbl7CzxXrF2JNn4 Q/PNWXl/RbaZBLXxco5uxu3XTg8fdPjFcJZleVg9f8n9mENhxt047pMO5h5Wkv4D9DUh Q+8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696693452; x=1697298252; h=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=V6Z5TerGNyehqM1iknsGWSFNCfXFAQQJnxB4zmAfJjM=; b=BWFxgWPTkQSwM6lq5Fvo2nR9CFy/RQ2MQL3SxmTyIML7XJWR1WJo1CvrfKXtHjAYFf Vu84ebfe7pkDggRnSG0z/F81tPy3w8k70TVKzeS8rFfpnWMEfbJharjEzlTHxPEMdhXK 3WyMuVop+/JIQbrI3rZLUdlQVaPDbznrgVQBSdsicFMCumF9d3+XMa0MOlgUKwl8CB61 6Cbw43z3B9l4UAJayKMIAlu/bfhAQoQQ0ZIs8/GRua+exnk9ERbG/V3xyt/8dUqHlTxA k7CvOVnUM2AjltOnLWg8/IdHe9Uv0uf/6XwxjzFPOiymNDH18++Bls2h9t9uwRFA/RL3 682A== X-Gm-Message-State: AOJu0Yz+5dvVg/Vtc5rPwL5mPu1dvbVA5PUYp4xAaqdFluBfoUqQDTqh v/3rIzo+1cBo8Y1biCnWDZNhdjcYNv1wVPAThPM= X-Received: by 2002:a5d:428b:0:b0:323:3b45:c452 with SMTP id k11-20020a5d428b000000b003233b45c452mr5978552wrq.14.1696693451518; Sat, 07 Oct 2023 08:44:11 -0700 (PDT) MIME-Version: 1.0 References: <20231005072349.52602-1-dg573847474@gmail.com> <20231007151021.GC831234@kernel.org> In-Reply-To: <20231007151021.GC831234@kernel.org> From: Chengfeng Ye Date: Sat, 7 Oct 2023 23:43:59 +0800 Message-ID: Subject: Re: [PATCH V2] ax25: Fix potential deadlock on &ax25_list_lock To: Simon Horman Cc: jreuter@yaina.de, ralf@linux-mips.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-hams@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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]); Sat, 07 Oct 2023 08:44:19 -0700 (PDT) Hi Simon Horman, I think maybe not. My static analysis tool only reported this function, I also just manually checked the spin_lock(&ax25_list_lock) in other functions, and it looks like they are basically under rcv callback or timer, which already have BH disabled. I think the developers who wrote the code should be aware of this so they used spin_lock() instead of spin_lock_bh(). But the fixed function is a bit different, as it could be called from .ioctl(), which is from userland syscall and executes under the process context, and along the call chain BH is also not disabled explicitly. That's the reason why only at this place I change to spin_lock_bh(). Thanks, Chengfeng