Re: [PATCH v2] Documentation: KUnit: Update filename best practices

2024-07-23 Thread Marco Elver
On Tue, 23 Jul 2024 at 01:49, John Hubbard wrote: > > On 7/22/24 2:55 AM, Marco Elver wrote: > > On Sat, Jul 20, 2024 at 09:54AM -0700, Kees Cook wrote: > ... > > I'm more confused now. This is just moving tests further away from what > > they are testing for

Re: [PATCH v2] Documentation: KUnit: Update filename best practices

2024-07-22 Thread Marco Elver
On Sat, Jul 20, 2024 at 09:54AM -0700, Kees Cook wrote: > Based on feedback from Linus[1] and follow-up discussions, change the > suggested file naming for KUnit tests. > > Link: > https://lore.kernel.org/lkml/CAHk-=wgim6pNiGTBMhP8Kd3tsB7_JTAuvNJ=XYd3wPvvk=o...@mail.gmail.com/ > [1] >

Re: [PATCH v4] x86/traps: Enable UBSAN traps on x86

2024-07-11 Thread Marco Elver
On Thu, 11 Jul 2024 at 10:10, Peter Zijlstra wrote: > > On Wed, Jul 10, 2024 at 08:32:38PM +, Gatlin Newhouse wrote: > > Currently ARM architectures extract which specific sanitizer > > has caused a trap via encoded data in the trap instruction. > > Clang on x86 currently encodes the same

Re: [RFC][PATCH 0/4] slab: Allow for type introspection during allocation

2024-07-09 Thread Marco Elver
On Tue, 9 Jul 2024 at 22:28, Kees Cook wrote: > > On Tue, Jul 09, 2024 at 10:26:32AM -0700, Christoph Lameter (Ampere) wrote: > > On Mon, 8 Jul 2024, Kees Cook wrote: > > > > > > > >obj = kmalloc(obj, gfp); > > > > Could we avoid repeating "obj" in this pattern? > > > > F.e. > > > >

[clang] [llvm] [SanitizerBinaryMetadata] Fix multi-version sanitizer metadata (PR #97848)

2024-07-08 Thread Marco Elver via cfe-commits
https://github.com/melver closed https://github.com/llvm/llvm-project/pull/97848 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SanitizerBinaryMetadata] Fix multi-version sanitizer metadata (PR #97848)

2024-07-05 Thread Marco Elver via cfe-commits
multi-version sanitizer metadata, attach the version to section names and internal constructor and destructor names. The ABI remains unchanged. >From 8478cb8475785ad64523e81ebd89ba53b0bfa8f7 Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Thu, 4 Jul 2024 11:08:16 +0200 Subject: [PA

Re: [syzbot] [mm?] KCSAN: data-race in mtree_range_walk / rcu_segcblist_enqueue (2)

2024-06-24 Thread Marco Elver
On Fri, 21 Jun 2024 at 19:31, Liam R. Howlett wrote: > > * Marco Elver [240621 11:29]: > > [+Cc rcu folks] > > > > On Fri, 21 Jun 2024 at 15:29, syzbot > > wrote: > > > > > > Hello, > > > > > > syzbot found the following issue on

Re: [syzbot] [mm?] KCSAN: data-race in mtree_range_walk / rcu_segcblist_enqueue (2)

2024-06-21 Thread Marco Elver
[+Cc rcu folks] On Fri, 21 Jun 2024 at 15:29, syzbot wrote: > > Hello, > > syzbot found the following issue on: > > HEAD commit:50736169ecc8 Merge tag 'for-6.10-rc4-tag' of git://git.ker.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=164ec02a98 >

Re: [PATCH v4 00/10] Add support for synchronous signals on perf events

2024-06-11 Thread Marco Elver
On Thu, Apr 08, 2021 at 12:35PM +0200, Marco Elver wrote: [...] > Motivation and Example Uses > --- > > 1.Our immediate motivation is low-overhead sampling-based race > detection for user space [1]. By using perf_event_open() at > process

Re: [PATCH rcu 2/4] rcutorture: Fix rcu_torture_fwd_cb_cr() data race

2024-06-05 Thread Marco Elver
> WRITE_ONCE(*rfcpp, rfcp); > > Which is then a data race with rcu_torture_fwd_prog_cr(), specifically, > this statement: > > rfcpn = READ_ONCE(rfcp->rfc_next) > > KCSAN located this data race, which represents a real failure on powerpc. > > Sign

Re: [PATCH] x86/traps: Enable UBSAN traps on x86

2024-05-29 Thread Marco Elver
On Wed, 29 May 2024 at 20:17, Gatlin Newhouse wrote: > > On Wed, May 29, 2024 at 09:25:21AM UTC, Marco Elver wrote: > > On Wed, 29 May 2024 at 04:20, Gatlin Newhouse > > wrote: > > [...] > > > if (regs->flags & X86_EFLAGS_IF) &g

Re: [PATCH] x86/traps: Enable UBSAN traps on x86

2024-05-29 Thread Marco Elver
On Wed, 29 May 2024 at 04:20, Gatlin Newhouse wrote: [...] > if (regs->flags & X86_EFLAGS_IF) > raw_local_irq_enable(); > - if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN || > - handle_cfi_failure(regs) == BUG_TRAP_TYPE_WARN) { > -

Re: [PATCH] ubsan: Restore dependency on ARCH_HAS_UBSAN

2024-05-15 Thread Marco Elver
y: Masahiro Yamada > Closes: > https://lore.kernel.org/all/20240514095427.541201-1-masahi...@kernel.org > Fixes: 918327e9b7ff ("ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL") > Signed-off-by: Kees Cook Reviewed-by: Marco Elver > --- > Cc: Marco Elver > Cc: And

Re: [PATCH 0/3] kbuild: remove many tool coverage variables

2024-05-13 Thread Marco Elver
On Mon, 13 May 2024 at 20:48, Kees Cook wrote: > > In the future can you CC the various maintainers of the affected > tooling? :) > > On Mon, May 06, 2024 at 10:35:41PM +0900, Masahiro Yamada wrote: > > > > This patch set removes many instances of the following variables: > > > > -

Re: [PATCH 25/48] rcu: Mark writes to rcu_sync ->gp_count field

2024-05-13 Thread Marco Elver
On Fri, 10 May 2024 at 16:11, Paul E. McKenney wrote: [...] > > > Does this mean that KCSAN/etc treats the files in kernel/rcu/ > > > differently than the "Rest of Kernel"? Or what? > > > > > > And how is it enforced? > > > > I can only find the strnstr(buf, "rcu") checks in skip_report(), > >

Re: [PATCH] MAINTAINERS: Add ubsan.h to the UBSAN section

2024-04-24 Thread Marco Elver
On Wed, 24 Apr 2024 at 18:27, Kees Cook wrote: > > The "ubsan.h" file was missed in the creation of the UBSAN section. Add > it. > > Signed-off-by: Kees Cook Acked-by: Marco Elver > --- > Cc: Marco Elver > Cc: Andrey Konovalov > Cc: Andrey Ryabinin

[PATCH v2] tracing: Add sched_prepare_exec tracepoint

2024-04-11 Thread Marco Elver
sr/bin/tty filename=/usr/bin/tty pid=385 comm=bash <...>-389 [006] . 192.020147: sched_prepare_exec: interp=/usr/bin/dmesg filename=/usr/bin/dmesg pid=389 comm=bash Signed-off-by: Marco Elver --- v2: * Add more documentation. * Also show bprm->interp in trace. * Rename to sched_prepare_exe

Re: [PATCH] tracing: Add new_exec tracepoint

2024-04-10 Thread Marco Elver
On Wed, 10 Apr 2024 at 15:56, Masami Hiramatsu wrote: > > On Mon, 8 Apr 2024 11:01:54 +0200 > Marco Elver wrote: > > > Add "new_exec" tracepoint, which is run right after the point of no > > return but before the current task assumes its new exec ident

Re: [PATCH] tracing: Add new_exec tracepoint

2024-04-10 Thread Marco Elver
On Wed, 10 Apr 2024 at 01:54, Masami Hiramatsu wrote: > > On Tue, 9 Apr 2024 16:45:47 +0200 > Marco Elver wrote: > > > On Tue, 9 Apr 2024 at 16:31, Steven Rostedt wrote: > > > > > > On Mon, 8 Apr 2024 11:01:54 +0200 > > > Marco Elver wrote: &

Re: [PATCH] tracing: Add new_exec tracepoint

2024-04-09 Thread Marco Elver
On Tue, Apr 09, 2024 at 08:46AM -0700, Kees Cook wrote: [...] > > + trace_new_exec(current, bprm); > > + > > All other steps in this function have explicit comments about > what/why/etc. Please add some kind of comment describing why the > tracepoint is where it is, etc. I beefed up the

Re: [PATCH] tracing: Add new_exec tracepoint

2024-04-09 Thread Marco Elver
On Tue, 9 Apr 2024 at 16:31, Steven Rostedt wrote: > > On Mon, 8 Apr 2024 11:01:54 +0200 > Marco Elver wrote: > > > Add "new_exec" tracepoint, which is run right after the point of no > > return but before the current task assumes its new exec ident

[PATCH] tracing: Add new_exec tracepoint

2024-04-08 Thread Marco Elver
lename=/usr/bin/tty pid=385 old_pid=385 <...>-389 [006] . 192.020147: new_exec: filename=/usr/bin/dmesg pid=389 comm=bash bash-389 [006] . 192.021377: sched_process_exec: filename=/usr/bin/dmesg pid=389 old_pid=389 Signed-off-by: Marco Elver --- fs/exe

Re: [PATCH RFC rcu] Inform KCSAN of one-byte cmpxchg() in rcu_trc_cmpxchg_need_qs()

2024-03-19 Thread Marco Elver
On Tue, 19 Mar 2024 at 02:59, Paul E. McKenney wrote: > > On Mon, Mar 18, 2024 at 04:43:38PM +0100, Marco Elver wrote: > > On Mon, 18 Mar 2024 at 11:01, Marco Elver wrote: > > > > > > On Sun, 17 Mar 2024 at 22:55, Paul E. McKenney wrote: > > > > > &

Re: [PATCH RFC rcu] Inform KCSAN of one-byte cmpxchg() in rcu_trc_cmpxchg_need_qs()

2024-03-18 Thread Marco Elver
On Mon, 18 Mar 2024 at 11:01, Marco Elver wrote: > > On Sun, 17 Mar 2024 at 22:55, Paul E. McKenney wrote: > > > > On Fri, Mar 08, 2024 at 02:31:53PM -0800, Paul E. McKenney wrote: > > > On Fri, Mar 08, 2024 at 11:02:28PM +0100, Marco Elver wrote: > > > &

Re: [PATCH RFC rcu] Inform KCSAN of one-byte cmpxchg() in rcu_trc_cmpxchg_need_qs()

2024-03-18 Thread Marco Elver
On Sun, 17 Mar 2024 at 22:55, Paul E. McKenney wrote: > > On Fri, Mar 08, 2024 at 02:31:53PM -0800, Paul E. McKenney wrote: > > On Fri, Mar 08, 2024 at 11:02:28PM +0100, Marco Elver wrote: > > > On Fri, 8 Mar 2024 at 22:41, Paul E. McKenney wrote: > > > > >

Re: [PATCH] ubsan: Disable signed integer overflow sanitizer on GCC < 8

2024-03-13 Thread Marco Elver
. > > Reported-by: kernel test robot > Closes: > https://lore.kernel.org/oe-kbuild-all/202403110643.27jxevci-...@intel.com/ > Signed-off-by: Kees Cook Looks reasonable: Reviewed-by: Marco Elver Thanks, -- Marco > --- > Cc: Marco Elver > Cc: Andrey Konovalov > C

Re: [PATCH RFC rcu] Inform KCSAN of one-byte cmpxchg() in rcu_trc_cmpxchg_need_qs()

2024-03-08 Thread Marco Elver
s commit therefore encloses the cmpxchg() in a data_race() and adds > a single-byte instrument_atomic_read_write(), thus telling KCSAN exactly > what is going on so as to avoid the false positives. > > Signed-off-by: Paul E. McKenney > Cc: Marco Elver > > --- > > Is this

Re: [linux-next:master] [kasan] 187292be96: WARNING:suspicious_RCU_usage

2024-02-20 Thread Marco Elver
On Tue, 20 Feb 2024 at 08:35, kernel test robot wrote: > > > > Hello, > > we noticed this is a revert commit, below report is for an issue we observed > on this commit but not on its parent. just FYI. > > 113edefd366346b3 187292be96ae2be247807fac1c3 > ---

Re: [PATCH v7 3/3] overflow: Introduce wrapping_assign_add() and wrapping_assign_sub()

2024-02-15 Thread Marco Elver
tation. > > Add to the selftests to validate behavior and lack of side-effects. > > Signed-off-by: Kees Cook Reviewed-by: Marco Elver > --- > Cc: Rasmus Villemoes > Cc: Marco Elver > Cc: Eric Biggers > Cc: Mark Rutland > Cc: "Gustavo A. R. Silva" >

[PATCH] hardening: Enable KFENCE in the hardening config

2024-02-12 Thread Marco Elver
://lkml.kernel.org/r/79b9a832-b3de-4229-9d87-748b2cfb7...@kernel.org Cc: Matthieu Baerts Cc: Jakub Kicinski Signed-off-by: Marco Elver --- kernel/configs/hardening.config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/configs/hardening.config b/kernel/configs/hardening.config index

Re: KFENCE: included in x86 defconfig?

2024-02-08 Thread Marco Elver
On Thu, 8 Feb 2024 at 11:55, Borislav Petkov wrote: > > On Thu, Feb 08, 2024 at 08:47:37AM +0100, Marco Elver wrote: > > That's a good question, and I don't have the answer to that - maybe we > > need to ask Linus then. > > Right, before that, lemme put my user hat

Re: [PATCH bpf-next v2] bpf: Allow compiler to inline most of bpf_local_storage_lookup()

2024-02-08 Thread Marco Elver
On Thu, Feb 08, 2024 at 08:37AM +0100, Marco Elver wrote: > On Thu, 8 Feb 2024 at 00:58, Yonghong Song wrote: > > On 2/7/24 4:26 AM, Marco Elver wrote: > > > In various performance profiles of kernels with BPF programs attached, > > > bpf_local_storage_lookup() appea

Re: KFENCE: included in x86 defconfig?

2024-02-07 Thread Marco Elver
On Thu, 8 Feb 2024 at 00:33, Jakub Kicinski wrote: > > On Wed, 7 Feb 2024 20:04:44 +0100 Borislav Petkov wrote: > > On Wed, Feb 07, 2024 at 07:35:53PM +0100, Matthieu Baerts wrote: > > > Sorry, I'm sure I understand your suggestion: do you mean not including > > > KFENCE in hardening.config

Re: [PATCH bpf-next v2] bpf: Allow compiler to inline most of bpf_local_storage_lookup()

2024-02-07 Thread Marco Elver
On Thu, 8 Feb 2024 at 00:58, Yonghong Song wrote: > On 2/7/24 4:26 AM, Marco Elver wrote: > > In various performance profiles of kernels with BPF programs attached, > > bpf_local_storage_lookup() appears as a significant portion of CPU > > cycles spent. To enable the c

Re: KFENCE: included in x86 defconfig?

2024-02-07 Thread Marco Elver
On Wed, 7 Feb 2024 at 23:12, Matthieu Baerts wrote: > > On 07/02/2024 20:04, Borislav Petkov wrote: > > On Wed, Feb 07, 2024 at 07:35:53PM +0100, Matthieu Baerts wrote: > >> Sorry, I'm sure I understand your suggestion: do you mean not including > >> KFENCE in hardening.config either, but in

Re: [PATCH v5 2/3] overflow: Introduce wrapping_add(), wrapping_sub(), and wrapping_mul()

2024-02-07 Thread Marco Elver
In other words, these two calls will get very different results: > > wrapping_mul(int, 50, 50) == 2500 > wrapping_mul(u8, 50, 50) == 196 > > Add to the selftests to validate behavior and lack of side-effects. > > Cc: Rasmus Villemoes > Cc: Marco Elver >

Re: KFENCE: included in x86 defconfig?

2024-02-07 Thread Marco Elver
[Cc'ing a bunch more people to get input] Hi Matt, On Wed, 7 Feb 2024 at 17:16, Matthieu Baerts wrote: [...] > When talking to Jakub about the kernel config used by the new CI for the > net tree [1], Jakub suggested [2] to check if KFENCE could not be > enabled by default for x86 architecture.

[PATCH bpf-next v2] bpf: Allow compiler to inline most of bpf_local_storage_lookup()

2024-02-07 Thread Marco Elver
latency | 2481.190 ns/op | 2487.555 ns/op ( ~ ) | +- important_hits throughput | 0.102 M ops/s| 0.101 M ops/s ( ~ ) Signed-off-by: Marco Elver Cc: Martin KaFai Lau --- v2: * Inline most of bpf_local_storage_lookup(), which produces greater

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-07 Thread Marco Elver
On Tue, Feb 06, 2024 at 05:22PM -0800, Martin KaFai Lau wrote: > On 2/6/24 9:04 AM, Marco Elver wrote: > > On Mon, Feb 05, 2024 at 03:24PM -0800, Martin KaFai Lau wrote: > > [...] > > > > Or can you suggest different functions to hook to for the recursion > > >

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-06 Thread Marco Elver
mov%rbx,%rax pop%rbx pop%r14 cs jmp 82324ea0 <__x86_return_thunk> Could you suggest how we can fix up the tests? I'm a little stuck because there's not much we can hook to left. Thanks, -- Marco -- >8 -- From: Marco Elver Date: Tue, 30 Jan 2024 17

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-05 Thread Marco Elver
On Wed, 31 Jan 2024 at 20:52, Martin KaFai Lau wrote: [...] > > | num_maps: 1000 > > | local_storage cache sequential get: > > | | > > | hits throughput: 0.357 ± 0.005 M ops/s | 0.325 ± 0.005 M > > ops/s(-9.0%) > > | hits

Re: [PATCH v3 2/3] overflow: Introduce add_wrap(), sub_wrap(), and mul_wrap()

2024-02-05 Thread Marco Elver
On Mon, 5 Feb 2024 at 10:12, Kees Cook wrote: > > Provide helpers that will perform wrapping addition, subtraction, or > multiplication without tripping the arithmetic wrap-around sanitizers. The > first argument is the type under which the wrap-around should happen > with. In other words, these

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-05 Thread Marco Elver
On Mon, 5 Feb 2024 at 13:59, Kees Cook wrote: > > On Mon, Feb 05, 2024 at 01:54:24PM +0100, Andrey Ryabinin wrote: > > > > > > On 2/5/24 10:37, Kees Cook wrote: > > > > > --- > > > include/linux/compiler_types.h | 9 - > > > lib/Kconfig.ubsan | 14 +++ > > >

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-05 Thread Marco Elver
"UBSAN_WRAP_SIGNED := n" can be > used. > > Additionally keep these disabled under CONFIG_COMPILE_TEST for now. > > Link: https://github.com/KSPP/linux/issues/26 [1] > Cc: Justin Stitt > Cc: Marco Elver > Cc: Miguel Ojeda > Cc: Nathan Chancellor > Cc: P

Re: [PATCH v2] ubsan: Silence W=1 warnings in self-test

2024-02-05 Thread Marco Elver
01 | int val1 = 10; > | ^ > > Reported-by: kernel test robot > Closes: > https://lore.kernel.org/oe-kbuild-all/202401310423.xpcik6ko-...@intel.com/ > Signed-off-by: Kees Cook Reviewed-by: Marco Elver > --- > v2: > - add additional &quo

Re: [PATCH] ubsan: Silence W=1 warnings in self-test

2024-02-02 Thread Marco Elver
On Fri, 2 Feb 2024 at 11:41, Kees Cook wrote: > > On Fri, Feb 02, 2024 at 10:57:11AM +0100, Marco Elver wrote: > > On Fri, 2 Feb 2024 at 10:46, Kees Cook wrote: > > > > > > Silence a handful of W=1 warnings in the UBSan selftest, which set > > > va

Re: [PATCH] ubsan: Silence W=1 warnings in self-test

2024-02-02 Thread Marco Elver
On Fri, 2 Feb 2024 at 10:46, Kees Cook wrote: > > Silence a handful of W=1 warnings in the UBSan selftest, which set > variables without using them. For example: > >lib/test_ubsan.c:101:6: warning: variable 'val1' set but not used > [-Wunused-but-set-variable] > 101 | int val1 =

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-01-31 Thread Marco Elver
On Wed, 31 Jan 2024 at 20:52, Martin KaFai Lau wrote: > > On 1/31/24 6:18 AM, Marco Elver wrote: > > To allow the compiler to inline the bpf_local_storage_lookup() fast- > > path, factor it out by making bpf_local_storage_lookup() a static inline > > functio

[PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-01-31 Thread Marco Elver
throughput: 0.109 ± 0.002 M ops/s | 0.112 ± 0.002 M ops/s (+2.8%) Signed-off-by: Marco Elver --- include/linux/bpf_local_storage.h | 17 - kernel/bpf/bpf_local_storage.c | 14 -- .../selftests/bpf/progs/cgrp_ls_recursion.c | 2

Re: [PATCH] MAINTAINERS: Add UBSAN section

2024-01-30 Thread Marco Elver
On Wed, 31 Jan 2024 at 00:46, Kees Cook wrote: > > The kernel hardening efforts have continued to depend more and more > heavily on UBSAN, so make an actual MAINTAINERS entry for it. > > Cc: Andrey Ryabinin > Cc: Marco Elver > Cc: Andrey Konovalov > Signed-off-by:

Re: [PATCH] mm/sparsemem: fix race in accessing memory_section->usage

2024-01-18 Thread Marco Elver
On Thu, Jan 18, 2024 at 10:01AM +0100, Alexander Potapenko wrote: > > > > Hrm, rcu_read_unlock_sched_notrace() can still call > > __preempt_schedule_notrace(), which is again instrumented by KMSAN. > > > > This patch gets me a working kernel: > > [...] > > Disabling interrupts is a little heavy

Re: [PATCH] mm/sparsemem: fix race in accessing memory_section->usage

2024-01-17 Thread Marco Elver
On Mon, Jan 15, 2024 at 09:34PM +0100, Marco Elver wrote: > On Mon, 15 Jan 2024 at 19:44, Alexander Potapenko wrote: > > > > Cc: "Paul E. McKenney" > > Cc: Marco Elver > > Cc: Dmitry Vyukov > > Cc: kasan-...@googlegroups.com > > Cc: Ilya Leo

Re: [PATCH v3 1/3] kasan: switch kunit tests to console tracepoints

2023-12-12 Thread Marco Elver
On Tue, 12 Dec 2023 at 10:19, Paul Heidekrüger wrote: > > On 12.12.2023 00:37, Andrey Konovalov wrote: > > On Tue, Dec 12, 2023 at 12:35 AM Paul Heidekrüger > > wrote: > > > > > > Using CONFIG_FTRACE=y instead of CONFIG_TRACEPOINTS=y produces the same > > > error > > > for me. > > > > > > So >

Re: [PATCH v3 1/3] kasan: switch kunit tests to console tracepoints

2023-12-11 Thread Marco Elver
On Mon, 11 Dec 2023 at 23:48, Paul Heidekrüger wrote: > > On 11.12.2023 21:51, Andrey Konovalov wrote: > > On Mon, Dec 11, 2023 at 7:59 PM Paul Heidekrüger > > wrote: > > > > > > > Hi Paul, > > > > > > > > I've been successfully running KASAN tests with CONFIG_TRACEPOINTS > > > > enabled on

Re: [PATCH v2 3/3] selftest/bpf: Test a perf bpf program that suppresses side effects.

2023-12-08 Thread Marco Elver
On Fri, 8 Dec 2023 at 02:08, Kyle Huey wrote: > > On Thu, Dec 7, 2023 at 2:56 PM Kyle Huey wrote: > > > > On Thu, Dec 7, 2023 at 11:20 AM Marco Elver wrote: > > > > > > On Thu, 7 Dec 2023 at 20:12, Andrii Nakryiko > > > wrote: > > > >

Re: [PATCH v2 3/3] selftest/bpf: Test a perf bpf program that suppresses side effects.

2023-12-07 Thread Marco Elver
On Thu, 7 Dec 2023 at 20:12, Andrii Nakryiko wrote: > > On Thu, Dec 7, 2023 at 8:35 AM Kyle Huey wrote: > > > > The test sets a hardware breakpoint and uses a bpf program to suppress the > > side effects of a perf event sample, including I/O availability signals, > > SIGTRAPs, and decrementing

Re: [PATCH] slub: Introduce CONFIG_SLUB_RCU_DEBUG

2023-09-11 Thread Marco Elver
On Fri, 25 Aug 2023 at 23:15, 'Jann Horn' via kasan-dev wrote: > > Currently, KASAN is unable to catch use-after-free in SLAB_TYPESAFE_BY_RCU > slabs because use-after-free is allowed within the RCU grace period by > design. > > Add a SLUB debugging feature which RCU-delays every individual >

Re: [PATCH] powerpc/kcsan: Properly instrument arch_spin_unlock()

2023-05-30 Thread Marco Elver
) with kcsan_mb(). > > Signed-off-by: Christophe Leroy Acked-by: Marco Elver > --- > arch/powerpc/include/asm/simple_spinlock.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/powerpc/include/asm/simple_spinlock.h > b/arch/powerpc/include/asm/simple_spi

Re: [PATCH 0/3] Extend KCSAN to all powerpc

2023-05-12 Thread Marco Elver
/{32,book3e}: kcsan: Extend KCSAN Support Acked-by: Marco Elver

Re: [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures

2023-05-12 Thread Marco Elver
c builtins. Only > include DEFINE_TSAN_ATOMIC_OPS(64) on 64 bits architectures. > > Fixes: 0f8ad5f2e934 ("kcsan: Add support for atomic builtins") > Suggested-by: Marco Elver > Signed-off-by: Christophe Leroy Reviewed-by: Marco Elver Do you have your own tree to take

Re: [PATCH] mm: kfence: Fix false positives on big endian

2023-05-05 Thread Marco Elver
;mm: kfence: improve the performance of __kfence_alloc() > and __kfence_free()") > Signed-off-by: Michael Ellerman Reviewed-by: Marco Elver Andrew, is the Fixes enough to make it to stable as well or do we also need Cc: stable? Thanks, -- Marco > --- > mm/kfence/kfence.h | 2

[PATCH] D148694: [SanitizerBinaryMetadata] Respect no_sanitize("thread") function attribute

2023-04-19 Thread Marco Elver via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5f605e254a0f: [SanitizerBinaryMetadata] Respect no_sanitize(thread) function attribute (authored by melver). Repository: rG LLVM Github Monorepo

[clang] 5f605e2 - [SanitizerBinaryMetadata] Respect no_sanitize("thread") function attribute

2023-04-19 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-04-19T14:49:56+02:00 New Revision: 5f605e254a0f81a41fd69025c572d597f3059ebc URL: https://github.com/llvm/llvm-project/commit/5f605e254a0f81a41fd69025c572d597f3059ebc DIFF: https://github.com/llvm/llvm-project/commit/5f605e254a0f81a41fd69025c572d597f3059ebc.diff

[PATCH] D148694: [SanitizerBinaryMetadata] Respect no_sanitize("thread") function attribute

2023-04-19 Thread Marco Elver via Phabricator via cfe-commits
melver updated this revision to Diff 514871. melver added a comment. Fix test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148694/new/ https://reviews.llvm.org/D148694 Files: clang/lib/CodeGen/CodeGenFunction.cpp

[PATCH] D148694: [SanitizerBinaryMetadata] Respect no_sanitize("thread") function attribute

2023-04-19 Thread Marco Elver via Phabricator via cfe-commits
melver created this revision. melver added a reviewer: dvyukov. Herald added subscribers: Enna1, hiraditya. Herald added a project: All. melver requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. To avoid false positives,

[clang] 61ed649 - [SanitizerBinaryMetadata] Do not add to GPU code

2023-03-09 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-03-09T10:15:28+01:00 New Revision: 61ed64954b979df0d5bfdfbe54a7c27e20be9001 URL: https://github.com/llvm/llvm-project/commit/61ed64954b979df0d5bfdfbe54a7c27e20be9001 DIFF: https://github.com/llvm/llvm-project/commit/61ed64954b979df0d5bfdfbe54a7c27e20be9001.diff

[PATCH] D145519: [SanitizerBinaryMetadata] Do not add to GPU code

2023-03-09 Thread Marco Elver via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG61ed64954b97: [SanitizerBinaryMetadata] Do not add to GPU code (authored by melver). Repository: rG LLVM Github

[PATCH] D145519: [SanitizerBinaryMetadata] Do not add to GPU code

2023-03-08 Thread Marco Elver via Phabricator via cfe-commits
melver updated this revision to Diff 503326. melver marked an inline comment as done. melver added a comment. Simplify assert. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145519/new/ https://reviews.llvm.org/D145519 Files:

[PATCH] D145519: [SanitizerBinaryMetadata] Do not add to GPU code

2023-03-07 Thread Marco Elver via Phabricator via cfe-commits
melver created this revision. melver added a reviewer: dvyukov. Herald added subscribers: Enna1, hiraditya. Herald added a project: All. melver requested review of this revision. Herald added subscribers: llvm-commits, cfe-commits, MaskRay. Herald added projects: clang, LLVM.

Re: [PATCH mm] kasan, powerpc: Don't rename memintrinsics if compiler adds prefixes

2023-02-27 Thread Marco Elver
On Mon, 27 Feb 2023 at 23:16, Andrew Morton wrote: > > On Mon, 27 Feb 2023 10:47:27 +0100 Marco Elver wrote: > > > With appropriate compiler support [1], KASAN builds use __asan prefixed > > meminstrinsics, and KASAN no longer overrides memcpy/memset/memmove. > &

[PATCH mm] kasan, powerpc: Don't rename memintrinsics if compiler adds prefixes

2023-02-27 Thread Marco Elver
/ Reported-by: kernel test robot Signed-off-by: Marco Elver --- arch/powerpc/include/asm/kasan.h | 2 +- arch/powerpc/include/asm/string.h | 15 +++ arch/powerpc/kernel/prom_init_check.sh | 9 +++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/arch

Re: [PATCH 1/2] kcsan: xtensa: Add atomic builtin stubs for 32-bit systems

2023-02-16 Thread Marco Elver
: Max Filippov > > This series should also be addressed to KCSAN Maintainers, shouldn't it ? > > KCSAN > M:Marco Elver > R:Dmitry Vyukov > L:kasan-...@googlegroups.com > S:Maintained > F:Documentation/dev-tools/kcsan.rst > F:include/linux/kcsan

[PATCH] D143664: [SanitizerBinaryMetadata] Support ignore list

2023-02-10 Thread Marco Elver via Phabricator via cfe-commits
melver marked an inline comment as done. melver added inline comments. Comment at: clang/test/CodeGen/sanitize-metadata-ignorelist.c:11 +// ALLOW-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] !pcsections !5 { +// ALLOW-NEXT: entry: +// ALLOW-NEXT:[[TMP0:%.*]] = atomicrmw

[clang] dac423b - [SanitizerBinaryMetadata] Fix ignorelist test with -Assert

2023-02-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-02-11T00:33:13+01:00 New Revision: dac423bd571858a85f3b388904392f0e55421d7d URL: https://github.com/llvm/llvm-project/commit/dac423bd571858a85f3b388904392f0e55421d7d DIFF: https://github.com/llvm/llvm-project/commit/dac423bd571858a85f3b388904392f0e55421d7d.diff

[clang] bb8bd8c - [SanitizerBinaryMetadata] Fix ignorelist test under Windows

2023-02-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-02-10T11:24:25+01:00 New Revision: bb8bd8c232e893441937d057a8b32760065c6e1d URL: https://github.com/llvm/llvm-project/commit/bb8bd8c232e893441937d057a8b32760065c6e1d DIFF: https://github.com/llvm/llvm-project/commit/bb8bd8c232e893441937d057a8b32760065c6e1d.diff

[PATCH] D143664: [SanitizerBinaryMetadata] Support ignore list

2023-02-10 Thread Marco Elver via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG421215b919d0: [SanitizerBinaryMetadata] Support ignore list (authored by melver). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[clang] 421215b - [SanitizerBinaryMetadata] Support ignore list

2023-02-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-02-10T10:25:48+01:00 New Revision: 421215b919d037a912cd4fffa73242852da41fc0 URL: https://github.com/llvm/llvm-project/commit/421215b919d037a912cd4fffa73242852da41fc0 DIFF: https://github.com/llvm/llvm-project/commit/421215b919d037a912cd4fffa73242852da41fc0.diff

[PATCH] D143664: [SanitizerBinaryMetadata] Support ignore list

2023-02-10 Thread Marco Elver via Phabricator via cfe-commits
melver updated this revision to Diff 496353. melver marked an inline comment as done. melver added a comment. Make Driver test check that cc1 doesn't receive flag if not required. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143664/new/

[PATCH] D143664: [SanitizerBinaryMetadata] Support ignore list

2023-02-10 Thread Marco Elver via Phabricator via cfe-commits
melver marked an inline comment as done. melver added inline comments. Comment at: clang/test/Driver/fsanitize-metadata-ignorelist.c:6 +// RUN: %clang -target aarch64-linux-gnu -fexperimental-sanitize-metadata=all -fexperimental-sanitize-metadata-ignorelist=%t.good

[PATCH] D143664: [SanitizerBinaryMetadata] Support ignore list

2023-02-09 Thread Marco Elver via Phabricator via cfe-commits
melver created this revision. melver added reviewers: dvyukov, vitalybuka. Herald added subscribers: Enna1, ormris, hiraditya. Herald added a project: All. melver requested review of this revision. Herald added subscribers: llvm-commits, cfe-commits, MaskRay. Herald added projects: clang, LLVM.

[PATCH] D143634: [ModuleUtils] Assert correct linkage and visibility of structors' COMDAT key

2023-02-09 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. This is currently more an RFC - there might be other side-effects not yet accounted for, so please review carefully. Although I have been able to reproduce the issue with an LTO and ASan build quite easily. If this is a common usecase for us, we might potentially save a

[PATCH] D143634: [ModuleUtils] Assert correct linkage and visibility of structors' COMDAT key

2023-02-09 Thread Marco Elver via Phabricator via cfe-commits
melver created this revision. melver added reviewers: MaskRay, vitalybuka, fmayer, pcc. Herald added subscribers: luke, Enna1, kosarev, frasercrmck, kerbowa, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng,

[PATCH] D143484: [SanitizerBinaryMetadata] Emit constants as ULEB128

2023-02-08 Thread Marco Elver via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbf9814b70560: [SanitizerBinaryMetadata] Emit constants as ULEB128 (authored by melver). Changed prior to commit: https://reviews.llvm.org/D143484?vs=495442=495802#toc Repository: rG LLVM Github

[PATCH] D143482: [SanitizerBinaryMetadata] Optimize used space for features and UAR stack args

2023-02-08 Thread Marco Elver via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3d53b5273003: [SanitizerBinaryMetadata] Optimize used space for features and UAR stack args (authored by melver). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

Re: [PATCH v4 7/7] powerpc: kcsan: Add KCSAN Support

2023-02-08 Thread Marco Elver
On Wed, 8 Feb 2023 at 04:23, Rohan McLure wrote: > > Enable HAVE_ARCH_KCSAN on all powerpc platforms, permitting use of the > kernel concurrency sanitiser through the CONFIG_KCSAN_* kconfig options. > KCSAN requires compiler builtins __atomic_* 64-bit values, and so only > report support on

Re: [PATCH v3 1/7] kernel/fork: convert vma assignment to a memcpy

2023-02-07 Thread Marco Elver
On Tue, 7 Feb 2023 at 18:24, Suren Baghdasaryan wrote: > > On Tue, Feb 7, 2023 at 9:16 AM Marco Elver wrote: > > > > On Thu, Jan 26, 2023 at 09:27AM -0800, Paul E. McKenney wrote: > > > On Wed, Jan 25, 2023 at 05:34:49PM -0800, Andrew Morton wrote: > > >

Re: [PATCH v3 1/7] kernel/fork: convert vma assignment to a memcpy

2023-02-07 Thread Marco Elver
On Thu, Jan 26, 2023 at 09:27AM -0800, Paul E. McKenney wrote: > On Wed, Jan 25, 2023 at 05:34:49PM -0800, Andrew Morton wrote: > > On Wed, 25 Jan 2023 16:50:01 -0800 Suren Baghdasaryan > > wrote: > > > > > On Wed, Jan 25, 2023 at 4:22 PM Andrew Morton > > > wrote: > > > > > > > > On Wed, 25

[PATCH] D143484: [SanitizerBinaryMetadata] Emit constants as ULEB128

2023-02-07 Thread Marco Elver via Phabricator via cfe-commits
melver updated this revision to Diff 495442. melver added a comment. Move AsmPrinter LEB128 helpers to AsmPrinter.cpp and use them. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143484/new/ https://reviews.llvm.org/D143484 Files:

[PATCH] D143484: [SanitizerBinaryMetadata] Emit constants as ULEB128

2023-02-07 Thread Marco Elver via Phabricator via cfe-commits
melver created this revision. melver added a reviewer: dvyukov. Herald added subscribers: Enna1, pengfei, hiraditya. Herald added a project: All. melver requested review of this revision. Herald added projects: clang, Sanitizers, LLVM. Herald added subscribers: llvm-commits, Sanitizers,

[PATCH] D143482: [SanitizerBinaryMetadata] Optimize used space for features and UAR stack args

2023-02-07 Thread Marco Elver via Phabricator via cfe-commits
melver created this revision. melver added a reviewer: dvyukov. Herald added subscribers: Enna1, hiraditya. Herald added a project: All. melver requested review of this revision. Herald added projects: clang, Sanitizers, LLVM. Herald added subscribers: llvm-commits, Sanitizers, cfe-commits.

Re: kfence_protect_page() writing L1TF vulnerable PTE

2022-12-11 Thread Marco Elver
On Sun, 11 Dec 2022 at 22:34, Demi Marie Obenour wrote: > On Sun, Dec 11, 2022 at 01:15:06PM +0100, Juergen Gross wrote: > > During tests with QubesOS a problem was found which seemed to be related > > to kfence_protect_page() writing a L1TF vulnerable page table entry [1]. > > > > Looking into

[PATCH] D139276: [SanitizerBinaryMetadata] Use weak __start_/__stop_ instead of dummy empty section

2022-12-04 Thread Marco Elver via Phabricator via cfe-commits
melver accepted this revision. melver added a comment. This revision is now accepted and ready to land. Thanks - yes this looks better. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139276/new/ https://reviews.llvm.org/D139276

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-04 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. In D136078#3969061 , @MaskRay wrote: > ` SanitizerBinaryMetadata::createZeroSizedObjectInSection` creates > `__dummy_*`, but why is it needed? (There is no comment.) " // Create a 0-sized object in a section, so that the

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-02 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. In D136078#3966187 , @melver wrote: >>> Do you have any other ideas on how to dead with this? >> >> It's strange we've not encountered this elsewhere - this must be some >> special (old?) linker. I'll investigate... > > GNU ld <=

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-02 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. >> Do you have any other ideas on how to dead with this? > > It's strange we've not encountered this elsewhere - this must be some special > (old?) linker. I'll investigate... GNU ld <= 2.35 does not support mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER sections. This

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-01 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. In D136078#3964100 , @dvyukov wrote: > @melver Re this failure: > > TEST 'Clang :: > Instrumentation/SanitizerBinaryMetadata/uar.cpp' FAILED > Script: > -- > : 'RUN: at line 4';

[clang] b95646f - Revert "Use-after-return sanitizer binary metadata"

2022-11-30 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2022-11-30T23:35:50+01:00 New Revision: b95646fe7058471cc0ecda1efa25003009af0317 URL: https://github.com/llvm/llvm-project/commit/b95646fe7058471cc0ecda1efa25003009af0317 DIFF: https://github.com/llvm/llvm-project/commit/b95646fe7058471cc0ecda1efa25003009af0317.diff

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Marco Elver via Phabricator via cfe-commits
melver requested changes to this revision. melver added a comment. This revision now requires changes to proceed. AFAIK Windows bot will break: https://buildkite.com/llvm-project/premerge-checks/builds/124003#0184c872-af5b-47c0-938c-b31ee8808241 Need to restrict test to Linux only.

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-29 Thread Marco Elver via Phabricator via cfe-commits
melver added inline comments. Comment at: llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp:57 + // Assume it currently only has features. + assert(AuxMDs.size() == 1); + auto *Features = cast(AuxMDs.getOperand(0))->getValue(); Probably should be getNumOperands()?

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-29 Thread Marco Elver via Phabricator via cfe-commits
melver accepted this revision. melver added inline comments. Comment at: llvm/test/Instrumentation/SanitizerBinaryMetadata/uar.cpp:19 +void non_empty_function() { + // Completely empty functions don't get uar metadata. + volatile int x; dvyukov wrote: > melver

  1   2   3   4   5   6   7   8   9   10   >