Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2814441ybx; Fri, 8 Nov 2019 09:40:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxPG5+b6RY1RYf+TBX6zvRp4RPyeWOwAPLQN8vfRuYv8VW2WwmWqGF1EquCwXTNurjphPQj X-Received: by 2002:a17:906:d96e:: with SMTP id rp14mr9745415ejb.14.1573234831457; Fri, 08 Nov 2019 09:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573234831; cv=none; d=google.com; s=arc-20160816; b=uqIpx4LgJ8b9zcnxFXorL+/JRhpbN0rco7C8Oc5TNH/OtvNzbZBnCbOAJMtgCZK3MZ /Mxxjzt7v3rMXKf3G7kE4INhclCttYTLD2+1y0bXiBdYzovcAKt0szqDGcDJ7zcbdPUK tdapcGDv4fhSjt5LbaSNLWV9ZYKJY72xNnosjW0PAFfTZbCG3KlLvrbRLViLSXfGtian GU51zdt43x+0Mq8SCcGdTi4kwoVdN5Bh5aCv/14qZBzZmZR1oy3eMpZidGb7ycdh8KUQ 0ZT0o94yyqqeFdKk8hu27Vj+t7gmIewDptkiy7iKnbYHjNkXKhloXJb1Rjw6UE/QAYrC 2vgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=X0HyUPs5wRItBK7m6Cq2qgQoPBnwk/wYZPQ6kr3orrA=; b=hugZgyUHONlDOY3mokBMWdD/1pHUnS+fMZFyZmAf9+SxiaainGQOlTFruY1TVLaZHx jfnnKhgSi9cfeQTsdne+3Cbtbeom4hmwtIenYhdYFS8+9/uIzYh73Ty8xHUcpygxzxFu yiJpd0gbZgYx62dLaeb603z4HVypk8ET6G1xix4YN71qTVSbn1C3UzjLQmZotUTyh3Gl kAu7WAfQTu7TOv1GODedwOv+ALWsbg/VrwrZP2zFJzvtvKL/RRznjVBpauAesXOKwFd3 w9nq32y7a52+KqyB9Vm2gatvC+AzMnZ5KmDVy16tRRCpErTNv/YBFabzfwDzcmDWFGOo Jsng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cNIrikGe; 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 gw3si3941032ejb.385.2019.11.08.09.40.07; Fri, 08 Nov 2019 09:40:31 -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=@linux-foundation.org header.s=google header.b=cNIrikGe; 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 S1727148AbfKHRjO (ORCPT + 99 others); Fri, 8 Nov 2019 12:39:14 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37527 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfKHRjO (ORCPT ); Fri, 8 Nov 2019 12:39:14 -0500 Received: by mail-lf1-f65.google.com with SMTP id b20so5085279lfp.4 for ; Fri, 08 Nov 2019 09:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X0HyUPs5wRItBK7m6Cq2qgQoPBnwk/wYZPQ6kr3orrA=; b=cNIrikGewcX3TfzGA7DTIDVQAsE0zbz7keQN8vCX7RCd/Hv905PLymolBEW+BYQraJ sWDYisbWpxTssmp2D2YezzJf3kW7bs+FdM4VtnlBu+i15ynPCQAQkhBEXHKASRmGjNQF u2eTspzbiv17j9VBNXqDv9laIVCLfAQXMtCS8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X0HyUPs5wRItBK7m6Cq2qgQoPBnwk/wYZPQ6kr3orrA=; b=JKOGKYXtPuBmwLD+48tw6RG22hiHuj1jLB+JSHMP2tpHqwH2CSe6So4hc5Qj8ZBl8g ytGE//abWx+NOpDti2a++hzd6yck4Lx4HK8LpbGAsrK7urbtzu1j9eangYAaJ6de6yjy F2rRM+/xV2zcQFOoOumNh6+Q6V/anQMn5djyyu6ISvzYVMJ2PHGrxfqHahdHZW+AZixU m0Zg3Wwljn9JYk7DWsXvzcoXdsS/zFY7Bljcd+V/mj1obnQQrfEjL/hDHaj1jIKBXW1T eiwadYCiFUPxzQA+xvP9zDyTTkLnDKKGIq/BMAPtNmYd7CPLLbpP/b9DlhfA5WzNoDv2 Ue+w== X-Gm-Message-State: APjAAAW9WaJuRH+J/uSjfnM+84daDN/jo3dKjSTuO71iDZeeBI7Y+X1x MUdJdhmz6pR+mKv4/60EWDiJykTQz9Y= X-Received: by 2002:a19:fc1c:: with SMTP id a28mr7410747lfi.170.1573234752109; Fri, 08 Nov 2019 09:39:12 -0800 (PST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id w11sm5024953lji.45.2019.11.08.09.39.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 09:39:11 -0800 (PST) Received: by mail-lf1-f41.google.com with SMTP id j14so5064594lfb.8 for ; Fri, 08 Nov 2019 09:39:10 -0800 (PST) X-Received: by 2002:ac2:5587:: with SMTP id v7mr7485443lfg.79.1573234750371; Fri, 08 Nov 2019 09:39:10 -0800 (PST) MIME-Version: 1.0 References: <000000000000c422a80596d595ee@google.com> <6bddae34-93df-6820-0390-ac18dcbf0927@gmail.com> In-Reply-To: From: Linus Torvalds Date: Fri, 8 Nov 2019 09:38:54 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: KCSAN: data-race in __alloc_file / __alloc_file To: Eric Dumazet Cc: Eric Dumazet , syzbot , Marco Elver , linux-fsdevel , Linux Kernel Mailing List , syzkaller-bugs , Al Viro Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 8, 2019 at 9:22 AM Eric Dumazet wrote: > > Ok, so what do you suggest next ? > > Declare KCSAN useless because too many false positives ? I'd hope that there is some way to mark the cases we know about where we just have a flag. I'm not sure what KCSAN uses right now - is it just the "volatile" that makes KCSAN ignore it, or are there other ways to do it? "volatile" has huge problems with code generation for gcc. It would probably be fine for "not_rcu" in this case, but I'd like to avoid it in general otherwise, which is why I wonder if there are other options. But worst comes to worst, I'd be ok with a WRITE_ONCE() and a comment about why (and the reason being KCSAN, not the questionable optimization). Linus