Message ID | 20240210125054.71391-1-remi@remlab.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-60405-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1450246dyd; Sat, 10 Feb 2024 04:57:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUyVVoAnMWbHLoSrlhWB/qwleaYagCYZTw3k3eutyRBADf/7Hx2WYArOyHg6dY4Q6RjLZtUBfMVRysGEi0nHCf4ky1uMQ== X-Google-Smtp-Source: AGHT+IGOju3Bk+O466eWy0gowevzX6SuxdTmsChHmifjlbbleFpsQtoejziWPNF90W+Pbs3OACP1 X-Received: by 2002:a05:6871:611:b0:219:7dc2:3092 with SMTP id w17-20020a056871061100b002197dc23092mr2119830oan.59.1707569840129; Sat, 10 Feb 2024 04:57:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707569840; cv=pass; d=google.com; s=arc-20160816; b=bDZld7DwQMt8WLqzzP2ekXGLKWktWgXFzdZWkm+CuMiicNC2uyIGoDJM8Tne3j6NCC cP6RKcNMJF9y8V2NbPQYhgPmFnfS9Hx8zCyAq5+vWT2NKPtvCpxJq81eRAjCs18zQSbM zvHJZLRglqsaBen1vbzvoTD8R0ps9x7Q1gjpc/jFBJWnHG3OOk/xcMh8T1lU3ljkNUG7 7rwV9/zV5pOtRUXy8/Qt/dIqtofetZy9SY8SP0Y6Ae4+1W2MZYtbZYW4opXwTO+2R1Rr dKon8pjL7AXxmOf3LcBVJWl3CgbGeo1k6wbunXYtMCBg6x3zMVHzGNt8r3PoeqFCC5IE d1jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=TKP8jSYeInEcUcVuK6dJE4HvbY/2xSYzKDCvgSqNHf8=; fh=r6lADe6wh14eLmJRaDpe3v2YTI5cxKlBxKQmxE2lyX4=; b=GXJM+peD9rjDMLUjHTHGh+TcPIz9VJT2ON+6d7LoN9V9RyUJAfyJ6xs8cEi2g6I0ER s83ZAuC5nLdHR+M3AL0gWRrSZcZxmuaK+ZthywN6hpmXNkML7E0MGI4STeo5JKeC3HnA 5G8tkPdNeB+LquPUsHfCIN5dLQ3xhd/kILPYklsRSExQ8qCZ44k1R3JmGgEyiI0M01QI e2u9cmlwp8nN6aJVQwxbkvmQV9NveGZE+zOJFAKbYYExo90bfra5YDcye+XkRZs0lj9T THC3nhYRs7Js5iWahjC4a1OZQPvcdt77Wt0tdk1kDHWsl35rCn6ysxRBbfu5jYkTphvx olQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=remlab.net); spf=pass (google.com: domain of linux-kernel+bounces-60405-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60405-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXMvdnSXdqtTA2dxIstdN61Yd/qBue0eATG4Ve+mvEPm8Sb4o7ntP3rgzjnOq2YsY69nt+FgcIWxzFFg0bcJzGcycNjLA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bq6-20020a056a02044600b005cd89d9fae3si3583507pgb.634.2024.02.10.04.57.19 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 04:57:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60405-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=remlab.net); spf=pass (google.com: domain of linux-kernel+bounces-60405-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60405-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 32451B20B8A for <ouuuleilei@gmail.com>; Sat, 10 Feb 2024 12:57:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C77944CB3D; Sat, 10 Feb 2024 12:56:45 +0000 (UTC) Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 732F03D554; Sat, 10 Feb 2024 12:56:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.75.19.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707569804; cv=none; b=tnwcoi/fGiJ6+t5nI5qQ4UOzLoG/RCrflB+nWcwrI7ajVAd9S9e0lA1kXYkj5Uzsv6oiGEIycxCwkMtT+xhgrXM7RBUJf9Kzx21BQqtrO30Ohn2qSLFBkwycUA9T9A8Nekm0H4RSGggHeXjxxIpEBNPkEcs2rbNCkAZAW4Hodww= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707569804; c=relaxed/simple; bh=tP5NgIL70LcknVWnXEpL1M5b/5gVZ6befjCl0rPG4bY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=uwo3zMMhRsRZrATpo+cXEIVU836CY2XDWtbA97pB8exmy0XRS2YSy5C1xYzU2b4JsiigL9C7C5uZXJ3LmWK35fRlbulyDPgKw/WsafLHI6zPiTMu1zSiEI7bLKQfHXNWQi7ZXQ5tshpm681tH86swORKirQEaHxVY6rxoeWholg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=remlab.net; spf=pass smtp.mailfrom=remlab.net; arc=none smtp.client-ip=51.75.19.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=remlab.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=remlab.net Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 48C07C01A3; Sat, 10 Feb 2024 14:50:54 +0200 (EET) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= <remi@remlab.net> To: courmisch@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] phonet: take correct lock to peek at the RX queue Date: Sat, 10 Feb 2024 14:50:53 +0200 Message-ID: <20240210125054.71391-1-remi@remlab.net> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790516752672231573 X-GMAIL-MSGID: 1790516752672231573 |
Series |
[1/2] phonet: take correct lock to peek at the RX queue
|
|
Commit Message
Rémi Denis-Courmont
Feb. 10, 2024, 12:50 p.m. UTC
From: Rémi Denis-Courmont <courmisch@gmail.com> Reported-by: Luosili <rootlab@huawei.com> Signed-off-by: Rémi Denis-Courmont <courmisch@gmail.com> --- net/phonet/datagram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Sat, Feb 10, 2024 at 1:50 PM Rémi Denis-Courmont <remi@remlab.net> wrote: > > From: Rémi Denis-Courmont <courmisch@gmail.com> > > Reported-by: Luosili <rootlab@huawei.com> > Signed-off-by: Rémi Denis-Courmont <courmisch@gmail.com> > --- > net/phonet/datagram.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Fixes: 107d0d9b8d9a ("Phonet: Phonet datagram transport protocol") Reviewed-by: Eric Dumazet <edumazet@google.com> Thanks.
On Sat, 2024-02-10 at 14:50 +0200, Rémi Denis-Courmont wrote: > From: Rémi Denis-Courmont <courmisch@gmail.com> > > Reported-by: Luosili <rootlab@huawei.com> > Signed-off-by: Rémi Denis-Courmont <courmisch@gmail.com> Looks good, but you need to add a non empty commit message. Even something quite similar to the one included in patch 2/2. you can retain Eric's ack when post v2. Pleas also include the correct fixes tag. Thanks Paolo
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c index 3aa50dc7535b..976fe250b509 100644 --- a/net/phonet/datagram.c +++ b/net/phonet/datagram.c @@ -34,10 +34,10 @@ static int pn_ioctl(struct sock *sk, int cmd, int *karg) switch (cmd) { case SIOCINQ: - lock_sock(sk); + spin_lock_bh(&sk->sk_receive_queue.lock); skb = skb_peek(&sk->sk_receive_queue); *karg = skb ? skb->len : 0; - release_sock(sk); + spin_unlock_bh(&sk->sk_receive_queue.lock); return 0; case SIOCPNADDRESOURCE: