lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191112224441.2kxmt727qy4l4ncb@ast-mbp.dhcp.thefacebook.com>
Date:   Tue, 12 Nov 2019 14:44:43 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Alan Stern <stern@...land.harvard.edu>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Marco Elver <elver@...gle.com>,
        Eric Dumazet <eric.dumazet@...il.com>,
        syzbot <syzbot+3ef049d50587836c0606@...kaller.appspotmail.com>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
        Al Viro <viro@...iv.linux.org.uk>,
        Andrea Parri <parri.andrea@...il.com>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        LKMM Maintainers -- Akira Yokosawa <akiyks@...il.com>
Subject: Re: KCSAN: data-race in __alloc_file / __alloc_file

On Tue, Nov 12, 2019 at 02:07:03PM -0800, Eric Dumazet wrote:
> 
> I would prefer some kind of explicit marking, instead of a comment.
> 
> Even if we prefer having a sane compiler, having these clearly
> annotated can help
> code readability quite a lot.

Annotating every line where tsk->min_flt is used with a comment
or explicit macro seems like a lot of churn.
How about adding an attribute to a field ?
Or an attribute to a type?

clang attributes can be easily exteneded. We add bpf specific attributes
that are known to clang only when 'clang -target bpf' is used.
There could be x86 or generic attributes.
Then one can do:
typedef unsigned long __attribute__((ignore_data_race)) racy_u64;
struct task_struct { 
   racy_u64 min_flt;
};

Hopefully less churn and clear signal to clang.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ