Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4089012ybl; Mon, 3 Feb 2020 12:20:32 -0800 (PST) X-Google-Smtp-Source: APXvYqz5dX5VXEdGF0LIMDBgrB9vsWSSRYabPfLAORm0HN9edJ3bxV+NmjEzENBgdj2En9nHGst9 X-Received: by 2002:aca:d0a:: with SMTP id 10mr565112oin.50.1580761232059; Mon, 03 Feb 2020 12:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580761232; cv=none; d=google.com; s=arc-20160816; b=Ozgb/R4SNuYHI3xb8VfOS0R4rE1+/Y7sCQmidrUxA9e4Na+Rr7Nqtoa9Kg11lFvj+k VJQXCMfQR/meRWi9ke11qW0b0cwrCFJsToAmtA6fVIGiLRLt7ch+jIg2ASmxiXrYPJ9p N4L0vXAal8GMNH0NmC5tfEjXJlask8qMqltnC0wRRi4LGHSlacGwOkqKn4cE7vedm5wD 9V4iGOpTK1vX42+oUN+1rQd0jGfBR+KcmNPk39iYuYL1W4+/9k9tlC5vib4Z70jxiaTW Dh+oU5MrgDXijwy7R0otiR5mGG+xDjeB+kDIRIb6ZLvx3PV7YsKf2SzAEflXC6ScfRc5 q/ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=L+boqKbKcGQHWhU/kLnxNJ+iqCrMGC4AneBP/4KWpSY=; b=KC6AK6Sqjsf8UUb4hk4rn3YoiT2qZOjq2aHhDDyVijsUUN2H64BHH39BSeDKFMA+49 yaT8R7mh3qxvdQ6ryp+mVCjJLO0bxMIMXNn9VGg1krsGWhYBtMNCy4NnLvk+tNpFVH1b GMGYYOwXgFtMv/hJoqKpWbNZSjPrE+d24mmy8TQpGrQ7lh7nDCR/FR6ZAyB68RNpcCok PpO/KOffrpAXN28vmJDDw/2dD97hbiEdKZuU1fyZ5Pz3yF1WD4nW2r7cXWWr+T8Md6b+ WAmzhXwOvq0QfrG/lgiOZYERqNVQtwRSaX6hXcc9RzAF2xQcVihIOLVEgvtHdrWaLOw3 IwkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=pDQjF+l7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si8517998oiz.237.2020.02.03.12.20.20; Mon, 03 Feb 2020 12:20:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=pDQjF+l7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727164AbgBCUTT (ORCPT + 99 others); Mon, 3 Feb 2020 15:19:19 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:44285 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbgBCUTT (ORCPT ); Mon, 3 Feb 2020 15:19:19 -0500 Received: by mail-qk1-f193.google.com with SMTP id v195so15525781qkb.11 for ; Mon, 03 Feb 2020 12:19:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=L+boqKbKcGQHWhU/kLnxNJ+iqCrMGC4AneBP/4KWpSY=; b=pDQjF+l7/yF9Qv9JBfBZGEywuFBC1ZID02VaidULXZr6lWYTmOcAIBckQwqKEnT153 ud2Y3JuxGOGx1g6gPPpZzuymTWilHIF+kupZmvq4/OlzUMsnRDH+/+sMKAJxgXw9mjPQ 8nDWxSxVAVNBPQC9eJJ39BILLDQ9FwGXOKUUP/jUKsIQ+1s4y1rHv+nfDfh3RgXZ3tc0 Kt53QXbmh+dTzftme1dqa+HyQ6h6QufgkhZhJqNFVDVKLdqHZNA7iV1lpa29FfQMTUGa vrypjuyCMSRp0kzkLKddqeT4sStflPC0VODiVUYG594L0dZCxkSXpBoOj4MXKco3y398 Evzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=L+boqKbKcGQHWhU/kLnxNJ+iqCrMGC4AneBP/4KWpSY=; b=GUh0c41hcGeDaWwYJBazA0o3tFy64aZj5iwUtbKq80oZk4VlW63xozQIb8aCvGT/Q7 GuK32tH9XZspGu/ZGKeQp1ulxyLnjlnmlqMpdfKbZzlLMEFSK0JZEdaVqfwk/WWwYmq+ ncHYNOZMePUr2MiLju2Gxfe3Rc6UNHTp5/Avd4hLEmyrtHCJmkgyIt4+GzZkxFXq+CgB 2xpWkHtoyXn89crJoQRzFOjSxefGYIJYu8wFC8H1doRtSEL16CQUum1nJcq3IyKc7xGl 18k29IdwE+/LrT3sF9JpsPGhRJdCta/5wOS7mD2rWmD9qkWTz0xBHDXNiylhVfabTEsW hHag== X-Gm-Message-State: APjAAAUARlo4ykKMWXo8/GR5jsY8soIAtvJ7d7rpY8prHA4sBJAw3DWl en2MtzF2U5SkICu4SMLJIisRmg== X-Received: by 2002:a05:620a:6b6:: with SMTP id i22mr24157881qkh.301.1580761157010; Mon, 03 Feb 2020 12:19:17 -0800 (PST) Received: from ?IPv6:2600:1000:b048:97ac:a93a:b890:262:8b7b? ([2600:1000:b048:97ac:a93a:b890:262:8b7b]) by smtp.gmail.com with ESMTPSA id 199sm10041756qkj.47.2020.02.03.12.19.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Feb 2020 12:19:15 -0800 (PST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] skbuff: fix a data race in skb_queue_len() Date: Mon, 3 Feb 2020 15:19:13 -0500 Message-Id: References: <648d6673-bbd8-6634-0174-f9b77194ecfd@gmail.com> Cc: davem@davemloft.net, kuba@kernel.org, elver@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <648d6673-bbd8-6634-0174-f9b77194ecfd@gmail.com> To: Eric Dumazet X-Mailer: iPhone Mail (17C54) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Feb 3, 2020, at 2:42 PM, Eric Dumazet wrote: >=20 > We do not want to add READ_ONCE() for all uses of skb_queue_len() >=20 > This could hide some real bugs, and could generate slightly less > efficient code in the cases we have the lock held. Good point. I should have thought about that. How about introducing 2 new he= lpers. skb_queue_len_once() unix_recvq_full_once() which will have a READ_ONCE() there, and then unix_dgram_sendmsg() could use= that instead?=