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-next>] [day] [month] [year] [list]
Date:   Mon, 26 Jun 2023 19:21:34 +0200
From:   Dmitry Vyukov <dvyukov@...gle.com>
To:     clang-built-linux <clang-built-linux@...glegroups.com>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, Marco Elver <elver@...gle.com>
Subject: Thread-safety annotations for irq/rcu/atomic contexts

Hi,

Previous Lukas' attempt to apply clang thread-safety annotations to the kernel:
https://clangbuiltlinux.github.io/CBL-meetup-2020-slides/lukas/tsa.pdf

I am thinking if the annotations can be used to check for functions
that must/must not be called from irq/atomic/rcu_read/etc contexts.
Namely, we create global fake locks that denote these contexts, then
annotate spin_lock_irqsave/irqrestore/etc as taking releasing these
locks, and finally annotate functions are requiring/excluding these
contexts:

void foo() require(irq_context);
void bar() exclude(irq_context);
void baz() require(rcu_read_context);

This may help to catch "suspicious RCU usage", "scheduling while
atomic" and similar bug types statically. I suspect it may also be
simpler (?) to do rather than annotating all normal locks.

Does it make any sense?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ