On Tue, 12 May 2020 at 10:18, Peter Zijlstra wrote:
>
> On Mon, May 11, 2020 at 09:41:32PM +0100, Will Deacon wrote:
> > Hi folks,
> >
> > (trimmed CC list since v4 since this is largely just a rebase)
> >
> > This is version five of the READ_ONCE() codegen improvement series that
> > I've
Signed-off-by: Marco Elver
---
A proposal to fix the problem with __READ_ONCE/__WRITE_ONCE and KCSAN
false positives.
Will, please feel free to take this patch and fiddle with it until it
looks like what you want if this is completely off.
Note: Currently __WRITE_ONCE_SCALAR seems to serve
On Tue, 12 May 2020 at 19:53, Marco Elver wrote:
>
> On Tue, 12 May 2020 at 10:18, Peter Zijlstra wrote:
> >
> > On Mon, May 11, 2020 at 09:41:32PM +0100, Will Deacon wrote:
> > > Hi folks,
> > >
> > > (trimmed CC list since v4 since this is large
On Tue, 12 May 2020 at 21:08, Peter Zijlstra wrote:
>
> On Tue, May 12, 2020 at 07:53:00PM +0200, Marco Elver wrote:
> > I just ran a bunch of KCSAN tests. While this series alone would have
> > passed the tests, there appears to be a problem with
> > __READ_ONCE/__WRITE_O
On Tue, 12 May 2020 at 23:15, Will Deacon wrote:
>
> On Tue, May 12, 2020 at 09:07:55PM +0200, Peter Zijlstra wrote:
> > On Tue, May 12, 2020 at 07:53:00PM +0200, Marco Elver wrote:
> > > I just ran a bunch of KCSAN tests. While this series alone would have
> > > p
.
>
> Let's wait for replies on that bug report before this gets applied,
> in case the feedback there changes the conclusion.
Waiting makes sense, if this is not very urgent.
Acked-by: Marco Elver
Thank you!
> ---
> lib/Kconfig.kcsan | 11 +++
> lib/Kconfig.ubsan |
table checksum verification disabled
> > BUG: kernel reboot-without-warning in boot stage
>
> I am having some difficulty believing that this commit is at fault given
> that the .config does not list CONFIG_KCSAN=y, but CCing Marco Elver
> for his thoughts. Especially given that I have
[+Cc clang-built-linux FYI]
On Mon, 18 May 2020 at 12:11, Marco Elver wrote:
>
> On Sun, 17 May 2020 at 05:47, Paul E. McKenney wrote:
> >
> > On Sun, May 17, 2020 at 09:17:32AM +0800, kernel test robot wrote:
> > > Greeting,
> > >
> > > FYI, we noti
On Mon, 18 May 2020 at 14:44, Marco Elver wrote:
>
> [+Cc clang-built-linux FYI]
>
> On Mon, 18 May 2020 at 12:11, Marco Elver wrote:
> >
> > On Sun, 17 May 2020 at 05:47, Paul E. McKenney wrote:
> > >
> > > On Sun, May 17, 2020 at 09:17:32AM +0800,
On Mon, 18 May 2020, 'Nick Desaulniers' via kasan-dev wrote:
> On Mon, May 18, 2020 at 7:34 AM Marco Elver wrote:
> >
> > On Mon, 18 May 2020 at 14:44, Marco Elver wrote:
> > >
> > > [+Cc clang-built-linux FYI]
> > >
> > > On Mon, 18 May 2020 a
t_array.0) is
> > being placed in '.init_array.0'
>
> As far as I can tell, this is a Clang bug. But I don't know the
> internals here, so I've opened:
> https://bugs.llvm.org/show_bug.cgi?id=46478
>
> and created a work-around patch for the kernel:
Thanks, minor comments below
r version")
Signed-off-by: Marco Elver
---
Documentation/dev-tools/kasan.rst | 7 ++-
lib/Kconfig.kasan | 24 +++-
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/Documentation/dev-tools/kasan.rst
b/Documentation/dev-tools/kasan
Turn 'KASAN' into a menuconfig, to avoid cluttering its parent menu with
the suboptions if enabled. Use 'if KASAN ... endif' instead of having
to 'depend on KASAN' for each entry.
Signed-off-by: Marco Elver
---
lib/Kconfig.kasan | 15 ---
1 file changed, 8 insertions(+), 7 deletions
On Tue, 9 Jun 2020 at 14:36, Martin Liška wrote:
>
> On 6/9/20 1:55 PM, Martin Liška wrote:
> > Works for me and I've just sent patch for that:
> > https://gcc.gnu.org/pipermail/gcc-patches/2020-June/547618.html
>
> The patch has landed into master.
Great, thank you for turning this around so
builtins with a call into the
runtime, and the runtime's job is to also execute the desired atomic
operation. We rely on the __atomic_* compiler builtins, available with
all KCSAN-supported compilers, to implement each TSAN atomic
instrumentation function.
Signed-off-by: Marco Elver
---
kernel
Adds test case to kcsan-test module, to test atomic builtin
instrumentation works.
Signed-off-by: Marco Elver
---
kernel/kcsan/kcsan-test.c | 63 +++
1 file changed, 63 insertions(+)
diff --git a/kernel/kcsan/kcsan-test.c b/kernel/kcsan/kcsan-test.c
index
Adds the new TSAN functions that may be emitted for atomic builtins to
objtool's uaccess whitelist.
Signed-off-by: Marco Elver
---
tools/objtool/check.c | 50 +++
1 file changed, 50 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
On Wed, 8 Jul 2020 at 01:01, Nick Desaulniers wrote:
>
> I'm trying to put together a Micro Conference for Linux Plumbers
> conference focused on "make LLVM slightly less shitty." Do you all
> plan on attending the conference? Would it be worthwhile to hold a
> session focused on discussing this
I was asked for input on this, and after a few days digging through some
history, thought I'd comment. Hope you don't mind.
On Thu, Jun 25, 2020 at 10:57AM +0200, Peter Zijlstra wrote:
> On Thu, Jun 25, 2020 at 10:24:33AM +0200, Peter Zijlstra wrote:
> > On Thu, Jun 25, 2020 at 10:03:13AM +0200,
On Tue, 30 Jun 2020 at 19:39, Will Deacon wrote:
>
> When building with LTO, there is an increased risk of the compiler
> converting an address dependency headed by a READ_ONCE() invocation
> into a control dependency and consequently allowing for harmful
> reordering by the CPU.
>
> Ensure that
On Wed, 1 Jul 2020 at 03:34, Stephen Rothwell wrote:
>
> Hi all,
>
> Today's linux-next merge of the rcu tree got a conflict in:
>
> kernel/kcsan/Makefile
>
> between commit:
>
> f7c28e224da6 ("kbuild: remove cc-option test of -fno-stack-protector")
Is it possible that this patch drops the
On Sat, Jun 27, 2020 at 03:59AM +0900, Masahiro Yamada wrote:
> Some Makefiles already pass -fno-stack-protector unconditionally.
> For example, arch/arm64/kernel/vdso/Makefile, arch/x86/xen/Makefile.
> No problem report so far about hard-coding this option. So, we can
> assume all supported
On Tue, 30 Jun 2020 at 22:30, Paul E. McKenney wrote:
> On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote:
> > On Tue, Jun 30, 2020 at 09:19:31PM +0200, Marco Elver wrote:
> > > First of all, I agree with the concerns, but not because of LTO.
> > >
&g
On Mon, 6 Jul 2020 at 20:35, Will Deacon wrote:
> On Mon, Jul 06, 2020 at 05:00:23PM +0100, Dave Martin wrote:
> > On Thu, Jul 02, 2020 at 08:23:02AM +0100, Will Deacon wrote:
> > > On Wed, Jul 01, 2020 at 06:07:25PM +0100, Dave P Martin wrote:
> > > > Also, can you illustrate code that can only
/lkml/CANpmjNOeXmD5E3O50Z3MjkiuCYaYOPyi+1rq=gzvekwbvlr...@mail.gmail.com/
Signed-off-by: Marco Elver
---
kernel/kcsan/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/kcsan/Makefile b/kernel/kcsan/Makefile
index fea064afc4f7..65ca5539c470 100644
--- a/kernel/kcsan
Simplify the set of compiler flags for the runtime by removing cc-option
from -fno-stack-protector, because all supported compilers support it.
This saves us one compiler invocation during build.
Signed-off-by: Marco Elver
---
kernel/kcsan/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2
-by: Marco Elver
Cc: Martin Liska
---
For anyone interested to try it out before GCC 11 is released, I'd
recommend building a stable GCC 10 with the patches applied:
git clone git://gcc.gnu.org/git/gcc.git && cd gcc
git checkout -b gcc-10-for-kcsan releases/gcc-10.1.0
gi
j$(nproc) && make install
Marco Elver (3):
kcsan: Re-add GCC as a supported compiler
kcsan: Simplify compiler flags
kcsan: Disable branch tracing in core runtime
Documentation/dev-tools/kcsan.rst | 3 ++-
kernel/kcsan/Makefile | 4 ++--
lib/Kconfig.kcsan
On Thu, 18 Jun 2020 at 16:50, Peter Zijlstra wrote:
>
> Marco crashed in bad_iret with a Clang11/KCSAN build due to
> overflowing the stack. Now that we run C code on it, expand it to a
> full page.
>
> Suggested-by: Andy Lutomirski
> Reported-by: Marco Elver
> Signe
bly implementation.
>
> Reported-by: Marco Elver
> Suggested-by: Marco Elver
> Signed-off-by: Peter Zijlstra (Intel)
KASAN no longer crashes, although the stack size increase appears to
be sufficient for the particular case I ran into.
Tested-by: Marco Elver
Thanks!
> ---
&
On Mon, 22 Jun 2020 at 11:49, Peter Zijlstra wrote:
>
> On Mon, Jun 22, 2020 at 02:37:12AM -0700, syzbot wrote:
> > Hello,
> >
> > syzbot found the following crash on:
> >
> > HEAD commit:27f11fea Add linux-next specific files for 20200622
> > git tree: linux-next
> > console output:
On Mon, 22 Jun 2020 at 13:06, Marco Elver wrote:
>
> On Mon, 22 Jun 2020 at 11:49, Peter Zijlstra wrote:
> >
> > On Mon, Jun 22, 2020 at 02:37:12AM -0700, syzbot wrote:
> > > Hello,
> > >
> > > syzbot found the following crash on:
> > >
gt; b398ace5d2ea ("compiler_types.h: Use unoptimized __unqual_scalar_typeof for
> sparse")
>
> Note: a recent version of sparse will be needed (minimum v0.6.2-rc2
>or later than 2020-05-28).
>
> Cc: Marco Elver
> Cc: Borislav Petkov
> Cc: Will Deacon
>
On Fri, Jun 19, 2020 at 02:57PM +0200, Sedat Dilek wrote:
> Commit 5cbaefe9743bf14c9d3106db0cc19f8cb0a3ca22
> ("kcsan: Improve various small stylistic details")
>
> ...forgot to improve a stylistic detail that was already done at
> another place in compiler-clang.h file.
>
> Fixes: 5cbaefe9743b
On Fri, 12 Jun 2020, Dmitry Vyukov wrote:
> On Thu, Jun 11, 2020 at 11:55 PM Peter Zijlstra wrote:
> >
> > On Mon, Jun 08, 2020 at 01:01:08PM +0200, Peter Zijlstra wrote:
> > > On Mon, Jun 08, 2020 at 09:57:39AM +0200, Dmitry Vyukov wrote:
> > >
> > > > As a crazy idea: is it possible to
11:04:17 +02:00
> >
> > READ_ONCE: Use data_race() to avoid KCSAN instrumentation
> >
> > Rather then open-code the disabling/enabling of KCSAN across the guts of
> > {READ,WRITE}_ONCE(), defer to the data_race() macro instead.
> >
> > Signed-off-by: Will Dea
On Thu, 21 May 2020 at 09:26, Borislav Petkov wrote:
>
> On Thu, May 21, 2020 at 12:30:39AM +0200, Marco Elver wrote:
> > This should be fixed when the series that includes this commit is applied:
> > https://lore.kernel.org/lkml/20200515150338.190344-9-el...@google.com/
&
On Fri, 15 May 2020 at 17:04, Marco Elver wrote:
>
> The volatile access no longer needs to be wrapped in data_race(),
> because we require compilers that emit instrumentation distinguishing
> volatile accesses.
>
> Signed-off-by: Marco Elver
> ---
> include/linux/compi
On Thu, 21 May 2020 at 11:47, Marco Elver wrote:
>
> On Fri, 15 May 2020 at 17:04, Marco Elver wrote:
> >
> > The volatile access no longer needs to be wrapped in data_race(),
> > because we require compilers that emit instrumentation distinguishing
> > volatil
expression in
response to apparent issues that compilers are having with nested
statement expressions.
Arnd Bergmann (1):
ubsan, kcsan: don't combine sanitizer with kcov on clang
Marco Elver (10):
kcsan: Avoid inserting __tsan_func_entry/exit if possible
kcsan: Support distinguishing volatil
/20200505142341.1096942-1-a...@arndb.de
Acked-by: Marco Elver
Signed-off-by: Arnd Bergmann
Signed-off-by: Marco Elver
---
This patch is already in -rcu tree, but since since the series is based
on -tip, to avoid conflict it is required for the subsequent patches.
---
lib/Kconfig.kcsan | 11 +++
lib
-by: Marco Elver
---
include/linux/compiler.h | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index e24cc3a2bc3e..17c98b215572 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -276,11 +276,9 @@ do
).
[1]
https://github.com/llvm/llvm-project/commit/5a2c31116f412c3b6888be361137efd705e05814
[2] https://gcc.gnu.org/pipermail/gcc-patches/2020-April/544452.html
This patch allows removing any explicit checks in primitives such as
READ_ONCE() and WRITE_ONCE().
Signed-off-by: Marco Elver
---
v2
-off-by: Marco Elver
---
v2:
* Add patch to series in response to above linked discussion.
---
include/linux/compiler.h | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 7444f026eead..1f9bd9f35368 100644
Signed-off-by: Marco Elver
---
scripts/Makefile.kcsan | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/Makefile.kcsan b/scripts/Makefile.kcsan
index 75d2942b9437..bd4da1af5953 100644
--- a/scripts/Makefile.kcsan
+++ b/scripts/Makefile.kcsan
@@ -13,6 +13,7 @@ endif
# of some options does
the volatile accesses. Finally, simplify
__READ_ONCE_SCALAR and remove __WRITE_ONCE_SCALAR.
Signed-off-by: Marco Elver
---
v2:
* Remove unnecessary kcsan_check_atomic*() in *_ONCE.
* Simplify __READ_ONCE_SCALAR and remove __WRITE_ONCE_SCALAR. This
effectively restores Will Deacon's pre-KCSAN version
Signed-off-by: Marco Elver
---
Documentation/dev-tools/kcsan.rst | 9 +
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/Documentation/dev-tools/kcsan.rst
b/Documentation/dev-tools/kcsan.rst
index f4b5766f12cc..ce4bbd918648 100644
--- a/Documentation/dev-tools/kcsan.rst
,exit}() insertion effectively disabled
tail-call optimization, there should be no observable change. [This was
caught and confirmed with kcsan-test & UNWINDER_ORC.]
Signed-off-by: Marco Elver
---
scripts/Makefile.kcsan | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff -
nel.org/r/CANpmjNMTsY_8241bS7=xafqvzhflrvekv_um4aduwe_kh3r...@mail.gmail.com
Signed-off-by: Marco Elver
---
lib/Kconfig.kcsan | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan
index a7276035ca0d..3f3b5bca7a8f 100644
--- a/lib/Kconfig.kcsan
Like is done for KCSAN, for KASAN we should also use __always_inline in
compilation units that have instrumentation disabled
(KASAN_SANITIZE_foo.o := n). Adds common documentation for KASAN and
KCSAN explaining the attribute.
Signed-off-by: Marco Elver
---
include/linux/compiler_types.h | 13
Cleanup and move the KASAN and KCSAN related function attributes to
compiler_types.h, where the rest of the same kind live.
No functional change intended.
Signed-off-by: Marco Elver
---
include/linux/compiler.h | 29 -
include/linux/compiler_types.h | 29
On Fri, 15 May 2020 at 17:03, Marco Elver wrote:
>
> This patch series is the conclusion to [1], where we determined that due
> to various interactions with no_sanitize attributes and the new
> {READ,WRITE}_ONCE(), KCSAN will require Clang 11 or later. Other
> sanitizers are la
On Thu, 21 May 2020 at 15:18, Will Deacon wrote:
>
> On Thu, May 21, 2020 at 01:08:46PM +0200, Marco Elver wrote:
> > In the kernel, volatile is used in various concurrent context, whether
> > in low-level synchronization primitives or for legacy reasons. If
> > suppo
On Thu, 21 May 2020 at 15:33, Will Deacon wrote:
>
> On Thu, May 21, 2020 at 01:08:50PM +0200, Marco Elver wrote:
> > Signed-off-by: Marco Elver
> > ---
> > Documentation/dev-tools/kcsan.rst | 9 +
> > 1 file changed, 1 insertion(+), 8 deletions(
On Thu, 21 May 2020 at 15:31, Will Deacon wrote:
>
> On Thu, May 21, 2020 at 01:08:52PM +0200, Marco Elver wrote:
> > It appears that compilers have trouble with nested statements
> > expressions, as such make the data_race() macro be only a single
> > statement expre
On Thu, 21 May 2020 at 15:36, Will Deacon wrote:
>
> On Thu, May 21, 2020 at 01:08:43PM +0200, Marco Elver wrote:
> > This patch series is the conclusion to [1], where we determined that due
> > to various interactions with no_sanitize attributes and the new
> > {R
nel.org/r/CANpmjNMTsY_8241bS7=xafqvzhflrvekv_um4aduwe_kh3r...@mail.gmail.com
Acked-by: Will Deacon
Signed-off-by: Marco Elver
---
lib/Kconfig.kcsan | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan
index a7276035ca0d..3f3b5bca7a8f 100644
/20200505142341.1096942-1-a...@arndb.de
Acked-by: Marco Elver
Signed-off-by: Arnd Bergmann
Signed-off-by: Marco Elver
---
This patch is already in -rcu tree, but since since the series is based
on -tip, to avoid conflict it is required for the subsequent patches.
---
lib/Kconfig.kcsan | 11 +++
lib
-by: Will Deacon
Signed-off-by: Marco Elver
---
include/linux/compiler.h | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index e24cc3a2bc3e..17c98b215572 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
):
ubsan, kcsan: don't combine sanitizer with kcov on clang
Marco Elver (10):
kcsan: Avoid inserting __tsan_func_entry/exit if possible
kcsan: Support distinguishing volatile accesses
kcsan: Pass option tsan-instrument-read-before-write to Clang
kcsan: Remove 'noinline' from __no_kcsan
-by: Marco Elver
---
v2:
* Reword Makefile comment.
---
kernel/kcsan/core.c| 43 ++
scripts/Makefile.kcsan | 5 -
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/kernel/kcsan/core.c b/kernel/kcsan/core.c
index a73a66cf79df..15f67949d11e
Like is done for KCSAN, for KASAN we should also use __always_inline in
compilation units that have instrumentation disabled
(KASAN_SANITIZE_foo.o := n). Adds common documentation for KASAN and
KCSAN explaining the attribute.
Acked-by: Will Deacon
Signed-off-by: Marco Elver
---
include/linux
the volatile accesses. Finally, simplify
__READ_ONCE_SCALAR and remove __WRITE_ONCE_SCALAR.
Acked-by: Will Deacon
Signed-off-by: Marco Elver
---
v2:
* Remove unnecessary kcsan_check_atomic*() in *_ONCE.
* Simplify __READ_ONCE_SCALAR and remove __WRITE_ONCE_SCALAR. This
effectively restores Will Deacon's
Document change in required compiler version for KCSAN, and remove the
now redundant note about __no_kcsan and inlining problems with older
compilers.
Acked-by: Will Deacon
Signed-off-by: Marco Elver
---
v3:
* Add missing commit message.
---
Documentation/dev-tools/kcsan.rst | 9 +
1
...@zn.tnic
Acked-by: Will Deacon
Signed-off-by: Marco Elver
---
v3:
* Fix for 'const' non-scalar expressions.
v2:
* Add patch to series in response to above linked discussion.
---
include/linux/compiler.h | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/linux
Cleanup and move the KASAN and KCSAN related function attributes to
compiler_types.h, where the rest of the same kind live.
No functional change intended.
Acked-by: Will Deacon
Signed-off-by: Marco Elver
---
include/linux/compiler.h | 29 -
include/linux
Acked-by: Will Deacon
Signed-off-by: Marco Elver
---
scripts/Makefile.kcsan | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/Makefile.kcsan b/scripts/Makefile.kcsan
index 75d2942b9437..bd4da1af5953 100644
--- a/scripts/Makefile.kcsan
+++ b/scripts/Makefile.kcsan
@@ -13,6 +13,7 @@ endif
,exit}() insertion effectively disabled
tail-call optimization, there should be no observable change. [This was
caught and confirmed with kcsan-test & UNWINDER_ORC.]
Acked-by: Will Deacon
Signed-off-by: Marco Elver
---
scripts/Makefile.kcsan | 11 ++-
1 file changed, 10 insertions(+
may recurse deep enough to cause kernel
reboots without warning.
To prevent similar issues in future, we should disable branch tracing
for the core runtime.
Link: https://lore.kernel.org/lkml/20200517011732.GE24705@shao2-debian/
Reported-by: kernel test robot
Signed-off-by: Marco Elver
---
v2
On Fri, 22 May 2020 at 00:11, Qian Cai wrote:
>
> On Tue, May 19, 2020 at 08:24:59PM +0200, 'Marco Elver' via kasan-dev wrote:
> > During early boot, while KASAN is not yet initialized, it is possible to
> > enter reporting code-path and end up in kasan_report(). While
On Fri, 22 May 2020 at 12:26, Borislav Petkov wrote:
>
> On Thu, May 21, 2020 at 04:20:39PM +0200, Marco Elver wrote:
> > diff --git a/scripts/Makefile.kcsan b/scripts/Makefile.kcsan
> > index 20337a7ecf54..75d2942b9437 100644
> > --- a/scripts/Makefile.kcsan
> >
You were a bit faster with the other patches ;-) I was still
experimenting the the patches, but let me briefly respond here.
On Tue, 2 Jun 2020 at 11:41, Peter Zijlstra wrote:
>
> On Mon, Jun 01, 2020 at 02:40:31PM +0200, Marco Elver wrote:
> > I think Peter wanted to send a
tps://lkml.kernel.org/r/20200602175859.gc2...@hirez.programming.kicks-ass.net
Suggested-by: Peter Zijlstra
Signed-off-by: Marco Elver
---
Apply after:
https://lkml.kernel.org/r/20200602173103.931412...@infradead.org
---
init/Kconfig | 3 +++
lib/Kconfig.kasan | 1 +
lib/Kconfig.kcsan | 1 +
+dc1fa714cb070b184...@syzkaller.appspotmail.com
Signed-off-by: Marco Elver
---
Note: __no_sanitize_coverage (for KCOV) isn't possible right now,
because neither GCC nor Clang support such an attribute. This means
going and changing the compilers again (for Clang it's fine, for GCC,
it'll take a while).
However
On Tue, 2 Jun 2020 at 19:34, Peter Zijlstra wrote:
>
> Hi all,
>
> Here's two KCSAN cleanups and the required noinstr change for x86.
Thank you!
Reviewed-by: Marco Elver
As promised, here are the patches that would take care of KASAN and
UBSAN, rebased on the patches
On Tue, 2 Jun 2020 at 20:49, 'Nick Desaulniers' via kasan-dev
wrote:
>
> On Tue, Jun 2, 2020 at 11:44 AM 'Marco Elver' via Clang Built Linux
> wrote:
> >
> > Adds the portable definitions for __no_sanitize_address, and
> > __no_sanitize_undefined, and subseque
On Tue, 2 Jun 2020 at 20:57, Nick Desaulniers wrote:
>
> On Tue, Jun 2, 2020 at 11:44 AM 'Marco Elver' via Clang Built Linux
> wrote:
> >
> > Adds config variable CC_HAS_WORKING_NOSANITIZE, which will be true if we
> > have a compiler that does not fail builds d
On Tue, 2 Jun 2020 at 20:53, Andrey Konovalov wrote:
>
> On Tue, Jun 2, 2020 at 8:44 PM Marco Elver wrote:
> >
> > Adds config variable CC_HAS_WORKING_NOSANITIZE, which will be true if we
> > have a compiler that does not fail builds due to no_sanitize functions.
&g
On Tue, 2 Jun 2020 at 21:19, Peter Zijlstra wrote:
>
> On Tue, Jun 02, 2020 at 11:57:15AM -0700, Nick Desaulniers wrote:
> > On Tue, Jun 2, 2020 at 11:44 AM 'Marco Elver' via Clang Built Linux
> > wrote:
> > >
> > > Adds config variable CC_HAS_WORKING_
On Tue, 2 Jun 2020 at 22:48, Paul E. McKenney wrote:
>
> On Tue, Jun 02, 2020 at 04:36:33PM +0200, Marco Elver wrote:
> > Instead of __no_kcsan_or_inline, prefer '__no_kcsan inline' in test --
> > this is in case we decide to remove __no_kcsan_or_inline.
> >
> >
On Wed, 3 Jun 2020 at 14:08, Peter Zijlstra wrote:
>
> On Wed, Jun 03, 2020 at 02:00:37PM +0200, Peter Zijlstra wrote:
> > On Wed, Jun 03, 2020 at 01:40:14PM +0200, Peter Zijlstra wrote:
> > > The first patch is a fix for x86/entry, I'm quicky runing out of brown
> > > paper bags again :/
> > >
On Wed, 3 Jun 2020 at 14:18, Peter Zijlstra wrote:
>
> On Wed, Jun 03, 2020 at 02:08:57PM +0200, Marco Elver wrote:
>
> > What is the .config you used? I somehow can't reproduce. I've applied
> > the patches on top of -tip/master.
>
> So tip/master, my patches
On Wed, 3 Jun 2020 at 15:32, Marco Elver wrote:
>
> On Wed, 3 Jun 2020 at 14:18, Peter Zijlstra wrote:
> >
> > On Wed, Jun 03, 2020 at 02:08:57PM +0200, Marco Elver wrote:
> >
> > > What is the .config you used? I somehow can't reproduce. I've applied
> &
On Wed, 3 Jun 2020 at 18:07, Peter Zijlstra wrote:
>
> On Wed, Jun 03, 2020 at 04:47:54PM +0200, Marco Elver wrote:
>
> > This is fun: __always_inline functions inlined into
> > __no_sanitize_undefined *do* get instrumented because apparently UBSan
> > passes must run b
On Wed, 3 Jun 2020 at 20:16, Peter Zijlstra wrote:
>
> On Wed, Jun 03, 2020 at 06:07:22PM +0200, Peter Zijlstra wrote:
> > On Wed, Jun 03, 2020 at 04:47:54PM +0200, Marco Elver wrote:
>
> > > With that in mind, you could whitelist "__ubsan_handle"-prefixed
On Wed, 03 Jun 2020, Borislav Petkov wrote:
> On Thu, May 14, 2020 at 12:05:38PM +0100, Will Deacon wrote:
> > Talking off-list, Clang >= 7 is pretty reasonable wrt inlining decisions
> > and the behaviour for __always_inline is:
> >
> > * An __always_inline function inlined into a
ter Zijlstra
Acked-by: Andrey Konovalov
Reviewed-by: Nick Desaulniers
Signed-off-by: Marco Elver
---
Apply after:
https://lkml.kernel.org/r/20200602173103.931412...@infradead.org
v2:
* No longer restrict UBSAN (and KCSAN), since the attributes behave
differently for different sanitizers. For UB
+dc1fa714cb070b184...@syzkaller.appspotmail.com
Acked-by: Miguel Ojeda
Signed-off-by: Marco Elver
---
Note: __no_sanitize_coverage (for KCOV) isn't possible right now,
because neither GCC nor Clang support such an attribute. This means
going and changing the compilers again (for Clang it's fine, for GCC,
it'll
On Wed, 3 Jun 2020 at 15:35, 'Andrey Konovalov' via kasan-dev
wrote:
>
> On Tue, Jun 2, 2020 at 8:44 PM Marco Elver wrote:
> >
> > Adds config variable CC_HAS_WORKING_NOSANITIZE, which will be true if we
> > have a compiler that does not fail builds due to no_sanitize
On Wed, 3 Jun 2020 at 21:10, Marco Elver wrote:
>
> On Wed, 3 Jun 2020 at 20:16, Peter Zijlstra wrote:
> >
> > On Wed, Jun 03, 2020 at 06:07:22PM +0200, Peter Zijlstra wrote:
> > > On Wed, Jun 03, 2020 at 04:47:54PM +0200, Marco Elver wrote:
> >
> > >
On Thu, 4 Jun 2020 at 05:34, Paul E. McKenney wrote:
>
> On Wed, Jun 03, 2020 at 07:13:20PM +0200, Peter Zijlstra wrote:
> > On Wed, Jun 03, 2020 at 09:46:00AM -0700, Paul E. McKenney wrote:
> >
> > > > --- a/kernel/rcu/tree.c
> > > > +++ b/kernel/rcu/tree.c
> > > > @@ -250,7 +250,7 @@ static
GCC and Clang.
Signed-off-by: Marco Elver
---
Note: There are a set of KCOV patches from Andrey in -next:
https://lkml.kernel.org/r/cover.1585233617.git.andreyk...@google.com --
Git cleanly merges this patch with those patches, and no merge conflict
is expected.
---
kernel/Makefile | 2
On Thu, 4 Jun 2020 at 08:00, Marco Elver wrote:
>
> On Wed, 3 Jun 2020 at 21:10, Marco Elver wrote:
> >
> > On Wed, 3 Jun 2020 at 20:16, Peter Zijlstra wrote:
> > >
> > > On Wed, Jun 03, 2020 at 06:07:22PM +0200, Peter Zijlstra wrote:
> > > >
On Thu, 4 Jun 2020 at 12:25, Peter Zijlstra wrote:
>
> Hai,
>
> Here's the remaining few patches to make KCSAN/KASAN and UBSAN work with
> noinstr.
Thanks for assembling the series!
For where it's missing (1,2,3 and last one):
Acked-by: Marco Elver
On Thu, 4 Jun 2020 at 13:09, Peter Zijlstra wrote:
>
> On Thu, Jun 04, 2020 at 11:50:57AM +0200, Marco Elver wrote:
> > The KCOV runtime is very minimal, only updating a field in 'current',
> > and none of __sanitizer_cov-functions generates reports nor calls any
> >
/202006060103.jscpnv1g%...@intel.com
Reported-by: kernel test robot
Signed-off-by: Marco Elver
---
kernel/kcsan/core.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/kernel/kcsan/core.c b/kernel/kcsan/core.c
index 15f67949d11e..1866bafda4fd 100644
--- a/kernel/kcsan/core.c
+++ b
Rename 'test.c' to 'selftest.c' to better reflect its purpose (Kconfig
variable and code inside already match this). This is to avoid confusion
with the test suite module in 'kcsan-test.c'.
No functional change.
Signed-off-by: Marco Elver
---
kernel/kcsan/Makefile | 2 +-
kernel
Minor KCSAN cleanups, none of which should affect functionality.
Marco Elver (4):
kcsan: Silence -Wmissing-prototypes warning with W=1
kcsan: Rename test.c to selftest.c
kcsan: Remove existing special atomic rules
kcsan: Add jiffies test to test suite
kernel/kcsan/Makefile
place to add special rules should the need arise in future.
Signed-off-by: Marco Elver
---
kernel/kcsan/atomic.h | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/kcsan/atomic.h b/kernel/kcsan/atomic.h
index be9e625227f3..75fe701f4127 100644
--- a/kernel/kcsan
Add a test that KCSAN nor the compiler gets confused about accesses to
jiffies on different architectures.
Signed-off-by: Marco Elver
---
kernel/kcsan/kcsan-test.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/kernel/kcsan/kcsan-test.c b/kernel/kcsan/kcsan-test.c
601 - 700 of 1015 matches
Mail list logo