Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp612871rdg; Tue, 10 Oct 2023 23:30:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErCGYOoJzsCxuEj24fghUIytYpmi59YvNrRBiKdXWHJ4Ndns7rl4EsJdN5+soaT6VQKIwv X-Received: by 2002:a05:6358:52c2:b0:143:1063:d1ed with SMTP id z2-20020a05635852c200b001431063d1edmr22603679rwz.26.1697005849907; Tue, 10 Oct 2023 23:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697005849; cv=none; d=google.com; s=arc-20160816; b=fOVSjgEn1XL1XmKXMKJz+CYDd8Z6M4zCMOxsQnd4jGKZqioAWJ0iQv8uh+VRssxN48 R8IfpFuOQ7XTyl1zZO5/tYZi9R4vKtBszuMG+UVxlVDIr6r626d2vYbrhuz//fd1H2IG IYXSwFihhnzNZnB7leCqI8vjx1MR5ckbX2Z5+w03ARgw82km983KmrgTdUeAbzmOwJcf tuK16DmJH9MuPJzWru1LPNvBH9L79xlMRTk8zXZpTyubMthxNhyPLaqbqfTHXZefX2E6 Ge9mb0p0Mh9RFDxCY8qi8jaxin8IwjAtgObkjBQVKYessdTKWYV0vy5Ay11qc6qOC2KY kIfg== 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=44rt4uohU3tXKbOWRH2meApUabKHkPeJOWssUJIevZg=; fh=G0deS2P9e5Xy/Oac4Ey80WkGrjbDxFBCaKWr1O0rzXw=; b=sPJv5TQPb+j4QQR8UbyjYo7qZETd/Y+w6Haha3oLjBYsRG/q+O+YOpPMoyF828Q4j8 +aDs+wJ6p3ir+c6dZjZYoLCSTrfa/yfFTLygiExZn7NsSLIV/VuRmnT1+IvJd8fdJbVV i1d/7H4CZavqOxqbpKDVbm9ZM9RlwSyKGG06yOk3f+kdTYYFdzWZ2x46Oa20dJ1ITnjD wBrlCrr4APcIK+Bqq9vF/sQx1fZJqVueSOCqNODEwx0/rAK8Bm4DNZtII9h53NozFd8W qm654PL5vdlEL0FkxtDytZnZTsFSCLIqHdZD61fGiBZs2ejNvOGeEJdYJidnt/+SmOgF GyBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wT4buVgU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id k17-20020a056a00169100b0068a5752a049si899408pfc.96.2023.10.10.23.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 23:30:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wT4buVgU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id BA96483C75A6; Tue, 10 Oct 2023 23:30:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbjJKGa1 (ORCPT + 99 others); Wed, 11 Oct 2023 02:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbjJKGaZ (ORCPT ); Wed, 11 Oct 2023 02:30:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5715F93 for ; Tue, 10 Oct 2023 23:30:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43E06C433C7; Wed, 11 Oct 2023 06:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697005823; bh=cOfTkY43H2nW587bRbrhIWOL7GLGr7wMPsVn9tjAmW0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wT4buVgUFRsybw4xiRLI0LgTqeVc7oFuas3/Y5EtgAlXJfXTG2Bn/LrQ4zN5W+gyo 93GacY0ieRvY5wmyPmzX0Lf4ly56RkkjmEm5q0aOccBGmvYUIdIV7cg/rdiww5exmR tqMdWp9VVKmvolYBfYeWBF2CWiKZ/I1GP1vp07c0= Date: Wed, 11 Oct 2023 08:30:19 +0200 From: Greg KH To: Abhinav Singh Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Remove extra unlock for the mutex Message-ID: <2023101136-irritate-shrine-cde6@gregkh> References: <20231010224630.238254-1-singhabhinav9051571833@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231010224630.238254-1-singhabhinav9051571833@gmail.com> 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, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 23:30:40 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 11, 2023 at 04:16:30AM +0530, Abhinav Singh wrote: > There is a double unlock on mutex. This can cause undefined behaviour. > > 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); How was this tested? And where is the now-needed unlock of the head->lock? How was this change found? And your subject line needs a lot of work... thanks, greg k-h