Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp495564rdg; Tue, 10 Oct 2023 17:29:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9Cr94HKn3YofQx2BdTsl1FuuidGeMUxINbgfKLJGCOJkrP6Eq6hqlwfaiodCzilxh4dHP X-Received: by 2002:a17:90b:3e8d:b0:277:68c3:64b9 with SMTP id rj13-20020a17090b3e8d00b0027768c364b9mr23413703pjb.5.1696984174479; Tue, 10 Oct 2023 17:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696984174; cv=none; d=google.com; s=arc-20160816; b=ih+cvMLtmjamVXINd2ucFJwjsTsFaBQkKDqPKuqjx4DMNOf6Ch9FiseQaQDwxUKMEl BCzN9EM5/Y3n+mA67JvHAAoCfzGDj6oXs30CVSwT4c/8HbAV8edrBBWjkOnku36J/5mR l5JZCu3zBub2M4Ky4ZNeVJH9VItJas1n1doJaHeZhNGwynC8lLV1qNOvIqu21MfDlLHF dNm71xLCR4LgsWFGe+JqpULSPUlbLZK6DWmncI+F3mRDiqHlgsPwL01j5tIf558Ol3pA mLy1ztDOc6mhAEOhw9Ntg4wurGI1JdnIUKpVgMs3H6jLUyptwnCFt9cKQJNLhLu+ht2D li+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xuZcVqG1Y38jX5g59zUv7HtsOiRZ/8gim6olwT/sCKY=; fh=256+1RD9glCm58dQV3LTle32yqQogtGfZgDSIFpRjQU=; b=yzQ3N1osrMOOtC8B4J+YbfnVhNnHNeMtJ3YUJ+pnsxfg38CCQ93nqQzN+fEn3SM8Xx 7wnVIreHq1ebl7FQdjX/Njy9dHzt6tUYmBk9VJkPrV16tIC0xMrtyMK720vEkvob3rVt jy2SC1cBcpK29x+EE23qD/l+zjUz3fMt46D/3nyVrYgQh23e+S5Do0j2Wt31oGYsXhgP ffclukuRxJ0BgGlGJEDHWw7A1W1pqBSVcuF+gki7Tjoba6u1tG2Imet+xxqayj7+lxbM WOhP+833xq1z9WrhVMhiODORple0JihvvLkN4ieutdtHiDtma6BmHqjyXUpbCOHmiEzp jGXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ZSBua0an; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q7-20020a170902788700b001c574110eecsi12335787pll.341.2023.10.10.17.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 17:29:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ZSBua0an; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 92CD080C9A4C; Tue, 10 Oct 2023 17:29:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344450AbjJKA2w (ORCPT + 99 others); Tue, 10 Oct 2023 20:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344418AbjJKA2v (ORCPT ); Tue, 10 Oct 2023 20:28:51 -0400 Received: from smtp-fw-80008.amazon.com (smtp-fw-80008.amazon.com [99.78.197.219]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86DDA184; Tue, 10 Oct 2023 17:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1696984109; x=1728520109; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xuZcVqG1Y38jX5g59zUv7HtsOiRZ/8gim6olwT/sCKY=; b=ZSBua0anw1DmE5gSi/cZwOywlNHud/6p+0of1xlFIHDzkoGIzh2TWgM6 JcYye8+VIpsNXEBDsoG89P1WAw+a/MfAV8dzUi8zd/dPyrTYz/j23pOQg 5lVHHb20i11KQayPmS+BR+fbEg09Cowuk3VkrbT+ayP2MwWsrBuolB01S Q=; X-IronPort-AV: E=Sophos;i="6.03,214,1694736000"; d="scan'208";a="34964492" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1a-m6i4x-edda28d4.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-80008.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 00:28:26 +0000 Received: from EX19MTAUWC002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-iad-1a-m6i4x-edda28d4.us-east-1.amazon.com (Postfix) with ESMTPS id 7A7708047B; Wed, 11 Oct 2023 00:28:25 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWC002.ant.amazon.com (10.250.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 11 Oct 2023 00:28:25 +0000 Received: from 88665a182662.ant.amazon.com.com (10.187.171.21) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 11 Oct 2023 00:28:22 +0000 From: Kuniyuki Iwashima To: CC: , , , , , , , , , Subject: Re: [PATCH] Remove extra unlock for the mutex Date: Tue, 10 Oct 2023 17:28:14 -0700 Message-ID: <20231011002814.77527-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.187.171.21] X-ClientProxiedBy: EX19D039UWB001.ant.amazon.com (10.13.138.119) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 17:29:30 -0700 (PDT) X-Spam-Level: ** From: Florian Fainelli Date: Tue, 10 Oct 2023 15:51:13 -0700 > On 10/10/23 15:46, Abhinav Singh wrote: > > There is a double unlock on mutex. This can cause undefined behaviour. > > Where is the double unlock of head->lock (which is a spinlock and not a > mutex, btw)? Maybe head is just confused with the preceding head2 as the two are the same type of struct. They are pointers of different hash tables though. bind()ing two sockets to the same 2-tuple will easily trigger hung task. > > > > > Signed-off-by: Abhinav Singh > > --- > > net/ipv4/inet_connection_sock.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c > > index aeebe8816689..f11fe8c727a4 100644 > > --- a/net/ipv4/inet_connection_sock.c > > +++ b/net/ipv4/inet_connection_sock.c > > @@ -597,7 +597,6 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum) > > } > > if (head2_lock_acquired) > > spin_unlock(&head2->lock); > > - spin_unlock_bh(&head->lock); > > return ret; > > } > > EXPORT_SYMBOL_GPL(inet_csk_get_port);