Re: [PATCH v3 1/2] kcsan: Rewrite kcsan_prandom_u32_max() without prandom_u32_state()

2020-12-01 Thread Marco Elver
Hi Paul, On Tue, 24 Nov 2020 at 12:02, Marco Elver wrote: > Rewrite kcsan_prandom_u32_max() to not depend on code that might be > instrumented, removing any dependency on lib/random32.c. The rewrite > implements a simple linear congruential generator, that is sufficient > for our p

Re: [PATCH v9 1/2] kunit: Support for Parameterized Testing

2020-11-23 Thread Marco Elver
summarizes > > TAP-compliant success or failure of all parameter runs. In future, when > > supported by kunit-tool, these can be turned into subsubtest outputs. > > > > Signed-off-by: Arpitha Raghunandan <98.a...@gmail.com> > > Co-developed-by: Marco Elver > > Signe

[PATCH v2] kcsan: Avoid scheduler recursion by using non-instrumented preempt_{disable,enable}()

2020-11-23 Thread Marco Elver
Fixes: cd290ec24633 ("kcsan: Use tracing-safe version of prandom") Signed-off-by: Marco Elver --- v2: * Update comment to also point out preempt_enable(). --- kernel/kcsan/core.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/kernel/kcsan/core.c b/kernel/kcs

Re: [PATCH v2] kcsan: Avoid scheduler recursion by using non-instrumented preempt_{disable,enable}()

2020-11-23 Thread Marco Elver
On Mon, 23 Nov 2020 at 14:55, Peter Zijlstra wrote: > On Mon, Nov 23, 2020 at 02:23:00PM +0100, Marco Elver wrote: > > When enabling KCSAN for kernel/sched (remove KCSAN_SANITIZE := n from > > kernel/sched/Makefile), with CONFIG_DEBUG_PREEMPT=y, we can observe >

Re: [PATCH] kfence: Avoid stalling work queue task without allocations

2020-11-23 Thread Marco Elver
On Fri, Nov 20, 2020 at 02:27PM -0500, Steven Rostedt wrote: > On Thu, 19 Nov 2020 13:53:57 +0100 > Marco Elver wrote: > > > Running tests again, along with the function tracer > > Running tests on all trace events: > > Testing all events: > > BUG: workqueue

Re: [PATCH v2] kcsan: Avoid scheduler recursion by using non-instrumented preempt_{disable,enable}()

2020-11-23 Thread Marco Elver
On Mon, Nov 23, 2020 at 04:17PM +0100, Marco Elver wrote: > On Mon, 23 Nov 2020 at 14:55, Peter Zijlstra wrote: > > On Mon, Nov 23, 2020 at 02:23:00PM +0100, Marco Elver wrote: > > > When enabling KCSAN for kernel/sched (remove KCSAN_SANITIZE := n from > > > k

Re: [PATCH v2] kcsan: Avoid scheduler recursion by using non-instrumented preempt_{disable,enable}()

2020-11-23 Thread Marco Elver
On Mon, 23 Nov 2020 at 17:08, Peter Zijlstra wrote: > On Mon, Nov 23, 2020 at 04:57:46PM +0100, Marco Elver wrote: > > Let me know what you prefer. > > > > > @@ -288,27 +288,19 @@ static u32 kcsan_prandom_u32_max(u32 ep_ro) > > u32 res; > > > >

Re: [PATCH v9 1/2] kunit: Support for Parameterized Testing

2020-11-24 Thread Marco Elver
On Tue, 24 Nov 2020 at 08:25, David Gow wrote: > > On Mon, Nov 23, 2020 at 9:08 PM Marco Elver wrote: > > > > On Tue, 17 Nov 2020 at 08:21, David Gow wrote: > > > On Mon, Nov 16, 2020 at 1:41 PM Arpitha Raghunandan <98.a...@gmail.com> > > > wrote: >

[PATCH v3 2/2] random32: Re-enable KCSAN instrumentation

2020-11-24 Thread Marco Elver
Re-enable KCSAN instrumentation, now that KCSAN no longer relies on code in lib/random32.c. Signed-off-by: Marco Elver --- v3: * Add patch to series, since KCSAN no longer needs lib/random32.c. --- lib/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/Makefile b/lib/Makefile

[PATCH v3 1/2] kcsan: Rewrite kcsan_prandom_u32_max() without prandom_u32_state()

2020-11-24 Thread Marco Elver
x27;d be good to keep a KCSAN kernel working when KCSAN_SANITIZE := n is removed from kernel/sched/Makefile to permit testing scheduler code with KCSAN if desired. Fixes: cd290ec24633 ("kcsan: Use tracing-safe version of prandom") Signed-off-by: Marco Elver --- v3: * Rewrite kcsan_

Re: linux-next: stall warnings and deadlock on Arm64 (was: [PATCH] kfence: Avoid stalling...)

2020-11-24 Thread Marco Elver
On Mon, Nov 23, 2020 at 07:32PM +, Mark Rutland wrote: > On Fri, Nov 20, 2020 at 03:03:32PM +0100, Marco Elver wrote: > > On Fri, Nov 20, 2020 at 10:30AM +, Mark Rutland wrote: > > > On Thu, Nov 19, 2020 at 10:53:53PM +, Will Deacon wrote: > > > > F

Re: [PATCH] genksyms: Ignore module scoped _Static_assert()

2020-12-04 Thread Marco Elver
On Tue, 1 Dec 2020 at 21:00, Nick Desaulniers wrote: > On Tue, Dec 1, 2020 at 7:21 AM Marco Elver wrote: > > The C11 _Static_assert() keyword may be used at module scope, and we > > need to teach genksyms about it to not abort with an error. We currently > > hav

Re: [PATCH] kfence: fix implicit function declaration

2020-12-04 Thread Marco Elver
On Fri, Dec 04, 2020 at 01:18PM +0100, Anders Roxell wrote: > When building kfence the following error shows up: > > In file included from mm/kfence/report.c:13: > arch/arm64/include/asm/kfence.h: In function ‘kfence_protect_page’: > arch/arm64/include/asm/kfence.h:12:2: error: implicit declaratio

Re: BUG: KCSAN: data-race in tick_nohz_next_event / tick_nohz_stop_tick

2020-12-04 Thread Marco Elver
On Fri, 4 Dec 2020 at 20:04, Naresh Kamboju wrote: > LKFT started testing KCSAN enabled kernel from the linux next tree. > Here we have found BUG: KCSAN: data-race in tick_nohz_next_event / > tick_nohz_stop_tick Thank you for looking into KCSAN. Would it be possible to collect these reports in a

Re: BUG: KASAN lib/test_kasan.c

2020-12-04 Thread Marco Elver
On Fri, 4 Dec 2020 at 19:56, Jeffrin Jose T wrote: > hello, > > detected KASAN BUG > > [ related information ] > > ---x---x> > [ 43.616259] BUG: KASAN: vmalloc-out-of-bounds in > vmalloc_oob+0x146/0x2c0 > > (gdb) l *vmalloc_oob+0x146/0

Re: [PATCH][next] arm64: fix the mm build error in mm/kfence/core.c

2020-12-06 Thread Marco Elver
On Sun, 6 Dec 2020 at 22:23, Stephen Rothwell wrote: > > Hi all, > > [Cc'd Andrew Morton] > > On Sun, 6 Dec 2020 01:22:07 +0800 Hui Su wrote: > > > > When I build kernel with ARCH=arm64, the building errors came out like > > this: > > CC mm/kfence/core.o > > In file included from ../mm/kfe

Re: linux-next: stall warnings and deadlock on Arm64 (was: [PATCH] kfence: Avoid stalling...)

2020-11-25 Thread Marco Elver
On Tue, Nov 24, 2020 at 07:30PM +, Mark Rutland wrote: [...] > > > I've just updated that branch with a new version which I hope covers > > > kernel<->kernel transitions too. If you get a chance, would you mind > > > giving that a spin? > > > > > > The HEAD commit should be: > > > > > > a51

[PATCH v6 0/3] net, mac80211, kernel: enable KCOV remote coverage collection for 802.11 frame handling

2020-11-25 Thread Marco Elver
From: Aleksandr Nogikh This patch series enables remote KCOV coverage collection during 802.11 frames processing. These changes make it possible to perform coverage-guided fuzzing in search of remotely triggerable bugs. Normally, KCOV collects coverage information for the code that is executed i

[PATCH v6 1/3] kernel: make kcov_common_handle consider the current context

2020-11-25 Thread Marco Elver
dle in the following way. If it is called in a task context, return the common handle for the currently running task. Otherwise, return 0. Signed-off-by: Aleksandr Nogikh Signed-off-by: Marco Elver Reviewed-by: Andrey Konovalov --- kernel/kcov.c | 2 ++ 1 file changed, 2 insertions(+) diff --gi

[PATCH v6 2/3] net: store KCOV remote handle in sk_buff

2020-11-25 Thread Marco Elver
the user space. Signed-off-by: Aleksandr Nogikh Signed-off-by: Marco Elver --- v6: * Revert usage of skb extensions in favour of directly storing the kcov_handle in in sk_buff. skb extensions were leading to a memory leak as reported by Ido Schimmel: https://lore.kernel.org/linux-wireless

[PATCH v6 3/3] mac80211: add KCOV remote annotations to incoming frame processing

2020-11-25 Thread Marco Elver
From: Aleksandr Nogikh Add KCOV remote annotations to ieee80211_iface_work() and ieee80211_rx_list(). This will enable coverage-guided fuzzing of mac80211 code that processes incoming 802.11 frames. Signed-off-by: Aleksandr Nogikh Signed-off-by: Marco Elver Reviewed-by: Johannes Berg

Re: [PATCH v5 2/3] net: add kcov handle to skb extensions

2020-11-25 Thread Marco Elver
On Sat, 21 Nov 2020 at 22:02, Jakub Kicinski wrote: > On Sat, 21 Nov 2020 21:58:37 +0100 Johannes Berg wrote: > > On Sat, 2020-11-21 at 12:55 -0800, Jakub Kicinski wrote: > > > It is more complicated. We can go back to an skb field if this work is > > > expected to yield results for mac80211. Woul

Re: [PATCH v6 0/3] net, mac80211, kernel: enable KCOV remote coverage collection for 802.11 frame handling

2020-11-25 Thread Marco Elver
On Wed, 25 Nov 2020 at 17:45, Jakub Kicinski wrote: > On Wed, 25 Nov 2020 17:24:52 +0100 Marco Elver wrote: > > This patch series enables remote KCOV coverage collection during 802.11 > > frames processing. These changes make it possible to perform > > coverage-guided

[PATCH net-next] net: switch to storing KCOV handle directly in sk_buff

2020-11-25 Thread Marco Elver
KCOV handling") Link: https://lore.kernel.org/linux-wireless/20201121160941.ga485...@shredder.lan/ Reported-by: Ido Schimmel Signed-off-by: Marco Elver --- include/linux/skbuff.h | 37 + lib/Kconfig.debug | 1 - net/core/skbuff.c | 12 +---

Re: [PATCH net-next] net: switch to storing KCOV handle directly in sk_buff

2020-11-25 Thread Marco Elver
On Wed, 25 Nov 2020 at 21:43, Jakub Kicinski wrote: > > On Wed, 25 Nov 2020 18:34:36 +0100 Marco Elver wrote: > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > > index ffe3dcc0ebea..070b1077d976 100644 > > --- a/net/core/skbuff.c > > +++ b/net/core/skbuff.c

[PATCH net-next v2] net: switch to storing KCOV handle directly in sk_buff

2020-11-25 Thread Marco Elver
KCOV handling") Link: https://lore.kernel.org/linux-wireless/20201121160941.ga485...@shredder.lan/ Reported-by: Ido Schimmel Signed-off-by: Marco Elver --- v2: * Restore missing skb_set_kcov_handle() which got lost in the rebase. --- include/linux/skbuff.h | 37 +

[PATCH] genksyms: Ignore module scoped _Static_assert()

2020-12-01 Thread Marco Elver
cefully (as it appears was the case previously). Therefore, make genksyms ignore all _Static_assert() and the contained expression. With the fix, usage of _Static_assert() no longer cause "syntax error" all over the kernel, and the above modpost warnings for KCSAN are gone, too. Signed-of

Re: [PATCH] genksyms: Ignore module scoped _Static_assert()

2020-12-01 Thread Marco Elver
On Tue, Dec 01, 2020 at 04:14PM +, Christoph Hellwig wrote: > Why not use the kernels own BUILD_BUG_ON instead of this idiom? BUILD_BUG_ON() was conceived before there was builtin compiler-support in the form of _Static_assert() (static_assert()), which has several advantages (compile-time per

Re: [PATCH] genksyms: Ignore module scoped _Static_assert()

2020-12-01 Thread Marco Elver
On Tue, 1 Dec 2020 at 21:00, Nick Desaulniers wrote: > > On Tue, Dec 1, 2020 at 7:21 AM Marco Elver wrote: > > > > The C11 _Static_assert() keyword may be used at module scope, and we > > need to teach genksyms about it to not abort with an error. We currently >

Re: [PATCH v9 1/2] kunit: Support for Parameterized Testing

2020-12-01 Thread Marco Elver
On Tue, 1 Dec 2020 at 23:28, Shuah Khan wrote: > > On 11/30/20 3:22 PM, Brendan Higgins wrote: > > On Mon, Nov 23, 2020 at 11:25 PM David Gow wrote: > >> > >> On Mon, Nov 23, 2020 at 9:08 PM Marco Elver wrote: > >>> > >>> On Tue, 17 Nov

Re: [PATCH v5 3/4] lib/test_kasan.c: add workqueue test case

2020-12-03 Thread Marco Elver
_save_stack+0x24/0x50 > kasan_record_wq_stack+0xa8/0xb8 > insert_work+0x48/0x288 > __queue_work+0x3e8/0xc40 > queue_work_on+0xf4/0x118 > kasan_workqueue_uaf+0xfc/0x190 > > Signed-off-by: Walter Wu > Acked-by: Marco Elver > Reviewed-by: Dmitry Vyukov > Reviewed

Re: WARNING in sk_stream_kill_queues (5)

2020-12-03 Thread Marco Elver
On Mon, Nov 30, 2020 at 12:40AM -0800, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:6147c83f Add linux-next specific files for 20201126 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=117c967950 > kernel config:

Re: WARNING in sk_stream_kill_queues (5)

2020-12-03 Thread Marco Elver
On Thu, 3 Dec 2020 at 17:27, Eric Dumazet wrote: > On Thu, Dec 3, 2020 at 4:58 PM Marco Elver wrote: > > > > On Mon, Nov 30, 2020 at 12:40AM -0800, syzbot wrote: > > > Hello, > > > > > > syzbot found the following issue on: > > > > > >

Re: WARNING in sk_stream_kill_queues (5)

2020-12-03 Thread Marco Elver
On Thu, Dec 03, 2020 at 05:42PM +0100, Eric Dumazet wrote: > On Thu, Dec 3, 2020 at 5:34 PM Marco Elver wrote: > > > > On Thu, 3 Dec 2020 at 17:27, Eric Dumazet wrote: > > > On Thu, Dec 3, 2020 at 4:58 PM Marco Elver wrote: > > > > > > > > On

Re: [PATCH 02/11] kasan: docs: update overview section

2021-03-12 Thread Marco Elver
On Thu, 11 Mar 2021 at 22:37, Andrey Konovalov wrote: > > Update the "Overview" section in KASAN documentation: > > - Outline main use cases for each mode. > - Mention that HW_TAGS mode need compiler support too. > - Move the part about SLUB/SLAB support from "Usage" to "Overview". > - Punctuation

Re: [PATCH 11/11] kasan: docs: update tests section

2021-03-12 Thread Marco Elver
On Thu, Mar 11, 2021 at 10:37PM +0100, Andrey Konovalov wrote: [...] > -With ``CONFIG_KUNIT`` enabled, ``CONFIG_KASAN_KUNIT_TEST`` can be built as > -a loadable module and run on any architecture that supports KASAN by loading > -the module with insmod or modprobe. The module is called ``test_kasan

Re: [PATCH 09/11] kasan: docs: update shadow memory section

2021-03-12 Thread Marco Elver
On Thu, Mar 11, 2021 at 10:37PM +0100, Andrey Konovalov wrote: [...] > -The kernel maps memory in a number of different parts of the address > -space. This poses something of a problem for KASAN, which requires > -that all addresses accessed by instrumented code have a valid shadow > -region. > - >

Re: [PATCH 10/11] kasan: docs: update ignoring accesses section

2021-03-12 Thread Marco Elver
On Thu, Mar 11, 2021 at 10:37PM +0100, Andrey Konovalov wrote: [...] > +Other parts of the kernel might access metadata for allocated objects. > Normally, > +KASAN detects and reports such accesses, but in certain cases (e.g., in > memory > +allocators) these accesses are valid. Disabling instr

[PATCH mm] kfence: zero guard page after out-of-bounds access

2021-03-12 Thread Marco Elver
After an out-of-bounds accesses, zero the guard page before re-protecting in kfence_guarded_free(). On one hand this helps make the failure mode of subsequent out-of-bounds accesses more deterministic, but could also prevent certain information leaks. Signed-off-by: Marco Elver --- mm/kfence

Re: [PATCH v2 01/11] kasan: docs: clean up sections

2021-03-12 Thread Marco Elver
gt; > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > > Changes v1->v2: > - Rename "By default" section to "Default behaviour". > --- > Documentation/dev-tools/kasan.rst | 54 +++ > 1 file changed, 27 in

Re: [PATCH v2 02/11] kasan: docs: update overview section

2021-03-12 Thread Marco Elver
from "Usage" to "Overview". > - Punctuation, readability, and other minor clean-ups. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > > Changes v1->v2: > - Mention GCC support for HW_TAGS. > --- > Documentation/dev-tools/kasan.

Re: [PATCH v2 03/11] kasan: docs: update usage section

2021-03-12 Thread Marco Elver
On Fri, Mar 12, 2021 at 03:24PM +0100, Andrey Konovalov wrote: > Update the "Usage" section in KASAN documentation: > > - Add inline code snippet markers. > - Reword the part about stack traces for clarity. > - Other minor clean-ups. > > Signed-off-by: Andrey Konov

Re: [PATCH v2 04/11] kasan: docs: update error reports section

2021-03-12 Thread Marco Elver
- Punctuation, readability, and other minor clean-ups. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > Documentation/dev-tools/kasan.rst | 46 +-- > 1 file changed, 26 insertions(+), 20 deletions(-) > > diff --git a/Doc

Re: [PATCH v2 05/11] kasan: docs: update boot parameters section

2021-03-12 Thread Marco Elver
with panic_on_warn. > - A readability clean-up. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > Documentation/dev-tools/kasan.rst | 14 ++ > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/Documentation/dev-tools/kasan.r

Re: [PATCH v2 06/11] kasan: docs: update GENERIC implementation details section

2021-03-12 Thread Marco Elver
Update kasan_mem_to_shadow() definition to match actual code. > - Punctuation, readability, and other minor clean-ups. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > Documentation/dev-tools/kasan.rst | 27 +-- > 1 file ch

Re: [PATCH v2 07/11] kasan: docs: update SW_TAGS implementation details section

2021-03-12 Thread Marco Elver
On Fri, Mar 12, 2021 at 03:24PM +0100, Andrey Konovalov wrote: > Update the "Implementation details" section for SW_TAGS KASAN: > > - Clarify the introduction sentence. > - Punctuation, readability, and other minor clean-ups. > > Signed-off-by: Andrey Konovalo

Re: [PATCH v2 08/11] kasan: docs: update HW_TAGS implementation details section

2021-03-12 Thread Marco Elver
On Fri, Mar 12, 2021 at 03:24PM +0100, Andrey Konovalov wrote: > Update the "Implementation details" section for HW_TAGS KASAN: > > - Punctuation, readability, and other minor clean-ups. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > Do

Re: [PATCH v2 09/11] kasan: docs: update shadow memory section

2021-03-12 Thread Marco Elver
st of architectures with vmalloc support. > - Punctuation, readability, and other minor clean-ups. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > Documentation/dev-tools/kasan.rst | 31 ++- > 1 file changed, 14 insertions(+), 17 deletions(-

Re: [PATCH v2 10/11] kasan: docs: update ignoring accesses section

2021-03-12 Thread Marco Elver
et(). > - Readability and punctuation clean-ups. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > > Changes in v1->v2: > - Mention __no_sanitize_address/noinstr. > - Reword the whole section to make it clear which method works for which >

Re: [PATCH v2 11/11] kasan: docs: update tests section

2021-03-12 Thread Marco Elver
n-ups. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > > Changes v1->v2: > - Fix missing snippet delimeter around "test_kasan.ko". > - Drop "the" before "test_kasan.ko". > --- > Documentation/dev-tools/kasan.rst |

Re: [syzbot] KCSAN: data-race in start_this_handle / start_this_handle

2021-03-11 Thread Marco Elver
On Thu, Mar 11, 2021 at 03:53PM +0100, Dmitry Vyukov wrote: > On Thu, Mar 11, 2021 at 3:25 PM Jan Kara wrote: > > > > On Thu 11-03-21 02:59:14, syzbot wrote: > > > HEAD commit:a74e6a01 Merge tag 's390-5.12-3' of > > > git://git.kernel.org/p.. > > > git tree: upstream > > > console outpu

Re: [PATCH] kasan: fix per-page tags for non-page_alloc pages

2021-03-11 Thread Marco Elver
pointers for pages that didn't have tags set explicitly. > > This patch fixes the encountered conflict with KFENCE and prevents more > similar issues that can occur in the future. > > Fixes: 2813b9c02962 ("kasan, mm, arm64: tag non slab memory allocated via > pag

Re: [syzbot] KCSAN: data-race in start_this_handle / start_this_handle

2021-03-11 Thread Marco Elver
+Cc Paul On Thu, 11 Mar 2021 at 16:30, Theodore Ts'o wrote: > > On Thu, Mar 11, 2021 at 04:08:30PM +0100, Marco Elver wrote: > > If the outcome of the check does not affect correctness and the code is > > entirely fault tolerant to the precise value being read, then a

Re: [RFC PATCH v1] powerpc: Enable KFENCE for PPC32

2021-03-02 Thread Marco Elver
On Tue, 2 Mar 2021 at 09:37, Christophe Leroy wrote: > Add architecture specific implementation details for KFENCE and enable > KFENCE for the ppc32 architecture. In particular, this implements the > required interface in . Nice! > KFENCE requires that attributes for pages from its memory pool c

Re: [RFC PATCH v1] powerpc: Enable KFENCE for PPC32

2021-03-02 Thread Marco Elver
nly this test, and none of the others. Given that, it might be code-gen related, which results in some subtle issue with stack unwinding. There are a few things to try, if you feel like it: -- Change the unwinder, if it's possible for ppc32. -- Add code to test_invalid_access(), to get the compi

Re: [RFC PATCH v1] powerpc: Enable KFENCE for PPC32

2021-03-02 Thread Marco Elver
On Tue, 2 Mar 2021 at 12:21, Christophe Leroy wrote: [...] > >> Booting with 'no_hash_pointers" I get the following. Does it helps ? > >> > >> [ 16.837198] > >> == > >> [ 16.848521] BUG: KFENCE: invalid read in > >> finish_task_

Re: [PATCH 3/3] [v4] lib/vsprintf: no_hash_pointers prints all addresses as unhashed

2021-03-02 Thread Marco Elver
On Tue, 2 Mar 2021 at 12:51, Geert Uytterhoeven wrote: > Hi Timur, > > On Sun, Feb 14, 2021 at 5:17 PM Timur Tabi wrote: > > If the no_hash_pointers command line parameter is set, then > > printk("%p") will print pointers as unhashed, which is useful for > > debugging purposes. This change appli

Re: [PATCH 3/3] [v4] lib/vsprintf: no_hash_pointers prints all addresses as unhashed

2021-03-02 Thread Marco Elver
"); > + pr_warn("** via the console, logs, and other interfaces. This**\n"); > + pr_warn("** might reduce the security of your system.**\n"); > > Only the above section is really unique. The rest can be a boiler plate. Short of procedurally g

Re: [PATCH 3/3] [v4] lib/vsprintf: no_hash_pointers prints all addresses as unhashed

2021-03-02 Thread Marco Elver
On Tue, 2 Mar 2021 at 15:55, Geert Uytterhoeven wrote: > > Hi Marco, > > On Tue, Mar 2, 2021 at 3:40 PM Marco Elver wrote: > > On Tue, 2 Mar 2021 at 15:35, Matthew Wilcox wrote: > > > On Tue, Mar 02, 2021 at 03:26:50PM +0100, Marco Elver wrote:

Re: [PATCH 3/3] [v4] lib/vsprintf: no_hash_pointers prints all addresses as unhashed

2021-03-02 Thread Marco Elver
On Tue, 2 Mar 2021 at 15:35, Matthew Wilcox wrote: > > On Tue, Mar 02, 2021 at 03:26:50PM +0100, Marco Elver wrote: > > +static const char no_hash_pointers_warning[9][55] __initconst = { > > + "**", > > +

Re: [PATCH 2/2] lib/vsprintf: reduce space taken by no_hash_pointers warning

2021-03-08 Thread Marco Elver
On Mon, 8 Mar 2021 at 11:16, Petr Mladek wrote: > On Fri 2021-03-05 20:42:06, Marco Elver wrote: > > Move the no_hash_pointers warning string into __initconst section, so > > that it is discarded after init. Remove common start/end characters. > > Also remove repeated lines

Re: [PATCH 1/5] arm64: kasan: allow to init memory when setting tags

2021-03-08 Thread Marco Elver
in this series. > > Signed-off-by: Andrey Konovalov Acked-by: Marco Elver > --- > arch/arm64/include/asm/memory.h| 4 ++-- > arch/arm64/include/asm/mte-kasan.h | 20 ++-- > mm/kasan/kasan.h | 9 + > 3 files changed, 21 ins

Re: [PATCH 2/5] kasan: init memory in kasan_(un)poison for HW_TAGS

2021-03-08 Thread Marco Elver
improve HW_TAGS KASAN performance when init_on_alloc/free is enabled. > > This change doesn't integrate memory initialization with KASAN, > this is done is subsequent patches in this series. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > lib/test

Re: [PATCH 3/5] kasan, mm: integrate page_alloc init with HW_TAGS

2021-03-08 Thread Marco Elver
On Sat, Mar 06, 2021 at 01:15AM +0100, Andrey Konovalov wrote: > This change uses the previously added memory initialization feature > of HW_TAGS KASAN routines for page_alloc memory when init_on_alloc/free > is enabled. > > With this change, kernel_init_free_pages() is no longer called when > bot

Re: [PATCH 4/5] kasan, mm: integrate slab init_on_alloc with HW_TAGS

2021-03-08 Thread Marco Elver
On Sat, Mar 06, 2021 at 01:15AM +0100, Andrey Konovalov wrote: > This change uses the previously added memory initialization feature > of HW_TAGS KASAN routines for slab memory when init_on_alloc is enabled. > > With this change, memory initialization memset() is no longer called > when both HW_TA

Re: [PATCH 5/5] kasan, mm: integrate slab init_on_free with HW_TAGS

2021-03-08 Thread Marco Elver
On Sat, Mar 06, 2021 at 01:15AM +0100, Andrey Konovalov wrote: > This change uses the previously added memory initialization feature > of HW_TAGS KASAN routines for slab memory when init_on_free is enabled. > > With this change, memory initialization memset() is no longer called > when both HW_TAG

Re: [PATCH 3/5] kasan, mm: integrate page_alloc init with HW_TAGS

2021-03-08 Thread Marco Elver
On Mon, 8 Mar 2021 at 12:35, Marco Elver wrote: [...] > Could we instead add a static inline helper to , e.g. > kasan_supports_init() or so? Hmm, KASAN certainly "supports" memory initialization always. So maybe "kasan_has_accelerated_init()" is more accurate? I leav

Re: [PATCH v2 3/5] kasan, mm: integrate page_alloc init with HW_TAGS

2021-03-08 Thread Marco Elver
ting allocation tags with memory initialization improves > HW_TAGS KASAN performance when init_on_alloc/free is enabled. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > include/linux/kasan.h | 30 ++ > mm/kasan/common.c | 8

Re: [PATCH v2 4/5] kasan, mm: integrate slab init_on_alloc with HW_TAGS

2021-03-08 Thread Marco Elver
> > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver The code looks fine to me, but there are some non-obvious changes to the internal slab APIs, so I'd wait a bit more to see if we missed something. > --- > include/linux/kasan.h | 8 -

Re: [PATCH v2 5/5] kasan, mm: integrate slab init_on_free with HW_TAGS

2021-03-08 Thread Marco Elver
setting allocation tags with memory initialization improves > HW_TAGS KASAN performance when init_on_free is enabled. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver But same as other patch, given the internal API change, let's see if somebody else responds. &g

Re: [PATCH 2/2] lib/vsprintf: reduce space taken by no_hash_pointers warning

2021-03-08 Thread Marco Elver
On Mon, 8 Mar 2021 at 18:23, Petr Mladek wrote: [...] > > I'm actually concerned about both. Platforms (and boot loaders) may > > have limitations for kernel image size, too. > > Static memory consumption is also more easily measured, so I tend > > to run bloat-o-meter, and dive into anything tha

Re: UBSAN: array-index-out-of-bounds in decode_data

2021-01-21 Thread Marco Elver
On Thu, 21 Jan 2021 at 19:30, syzbot wrote: > syzbot has found a reproducer for the following issue on: > > HEAD commit:9791581c Merge tag 'for-5.11-rc4-tag' of git://git.kernel... > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=13cd09a4d0 > kernel co

[PATCH RFC v2 0/8] Add support for synchronous signals on perf events

2021-03-10 Thread Marco Elver
e child cleared all signal handlers to continue sending SIGTRAP. * Various minor fixes (see details in patches). v1: https://lkml.kernel.org/r/20210223143426.2412737-1-el...@google.com Marco Elver (8): perf/core: Apply PERF_EVENT_IOC_MODIFY_ATTRIBUTES to children perf/core: Support only inheriti

[PATCH RFC v2 1/8] perf/core: Apply PERF_EVENT_IOC_MODIFY_ATTRIBUTES to children

2021-03-10 Thread Marco Elver
: Marco Elver --- kernel/events/core.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 0aeca5f3c0ac..bff498766065 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -3179,16 +3179,36 @@ static

[PATCH RFC v2 3/8] perf/core: Add support for event removal on exec

2021-03-10 Thread Marco Elver
Adds bit perf_event_attr::remove_on_exec, to support removing an event from a task on exec. This option supports the case where an event is supposed to be process-wide only, and should not propagate beyond exec, to limit monitoring to the original process image only. Signed-off-by: Marco Elver

[PATCH RFC v2 2/8] perf/core: Support only inheriting events if cloned with CLONE_THREAD

2021-03-10 Thread Marco Elver
hared environment. Link: https://lore.kernel.org/lkml/ybvj6ejr%2fdy2t...@hirez.programming.kicks-ass.net/ Suggested-by: Peter Zijlstra Signed-off-by: Marco Elver --- v2: * Add patch to series. --- include/linux/perf_event.h | 5 +++-- include/uapi/linux/perf_event.h | 3 ++- kernel/events/c

[PATCH RFC v2 7/8] selftests/perf: Add kselftest for process-wide sigtrap handling

2021-03-10 Thread Marco Elver
: Marco Elver --- v2: * Patch added to series. --- .../testing/selftests/perf_events/.gitignore | 2 + tools/testing/selftests/perf_events/Makefile | 6 + tools/testing/selftests/perf_events/config| 1 + tools/testing/selftests/perf_events/settings | 1 + .../selftests/perf_events

[PATCH RFC v2 5/8] perf/core: Add support for SIGTRAP on perf events

2021-03-10 Thread Marco Elver
synchronous signals on perf events in the task where an event (such as breakpoints) triggered. Link: https://lore.kernel.org/lkml/ybv3rat566k+6...@hirez.programming.kicks-ass.net/ Suggested-by: Peter Zijlstra Acked-by: Dmitry Vyukov Signed-off-by: Marco Elver --- v2: * Use atomic_set(&event_c

[PATCH RFC v2 6/8] perf/core: Add breakpoint information to siginfo on SIGTRAP

2021-03-10 Thread Marco Elver
to user space. Signed-off-by: Marco Elver --- v2: * Add comment about si_perf==0. --- kernel/events/core.c | 16 1 file changed, 16 insertions(+) diff --git a/kernel/events/core.c b/kernel/events/core.c index e70c411b0b16..aa47e111435e 100644 --- a/kernel/events/core.c +++ b

[PATCH RFC v2 4/8] signal: Introduce TRAP_PERF si_code and si_perf to siginfo

2021-03-10 Thread Marco Elver
Introduces the TRAP_PERF si_code, and associated siginfo_t field si_perf. These will be used by the perf event subsystem to send signals (if requested) to the task where an event occurred. Acked-by: Geert Uytterhoeven # m68k Acked-by: Arnd Bergmann # asm-generic Signed-off-by: Marco Elver

[PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-10 Thread Marco Elver
Add kselftest to test that remove_on_exec removes inherited events from child tasks. Signed-off-by: Marco Elver --- v2: * Add patch to series. --- .../testing/selftests/perf_events/.gitignore | 1 + tools/testing/selftests/perf_events/Makefile | 2 +- .../selftests/perf_events

Re: [PATCH RFC v2 3/8] perf/core: Add support for event removal on exec

2021-03-10 Thread Marco Elver
On Wed, Mar 10, 2021 at 11:41AM +0100, Marco Elver wrote: > Adds bit perf_event_attr::remove_on_exec, to support removing an event > from a task on exec. > > This option supports the case where an event is supposed to be > process-wide only, and should not propagate beyond

Re: PROBLEM: 5.11.0-rc7 fails to compile with error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible

2021-02-08 Thread Marco Elver
On Mon, 8 Feb 2021 at 01:40, Stuart Little wrote: > > And for good measure: reverting that commit > > 20bf2b378729c4a0366a53e2018a0b70ace94bcd > > flagged by the bisect right on top of the current tree compiles fine. > > On Sun, Feb 07, 2021 at 07:26:01PM -0500, Stuart Little wrote: > > The result

Re: [PATCH v3 mm 08/13] kasan, mm: optimize krealloc poisoning

2021-02-08 Thread Marco Elver
KASAN accessibility checks when copying memory into a new object instead > of unpoisoning it. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Clarification below. > --- > mm/kasan/common.c | 12 ++-- > mm/slab_common.c | 20 ++-- >

Re: [PATCH v3 mm 11/13] kasan: inline HW_TAGS helper functions

2021-02-08 Thread Marco Elver
On Fri, Feb 05, 2021 at 06:34PM +0100, Andrey Konovalov wrote: > Mark all static functions in common.c and kasan.h that are used for > hardware tag-based KASAN as inline to avoid unnecessary function calls. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver >

Re: [PATCH v3 mm 13/13] kasan: clarify that only first bug is reported in HW_TAGS

2021-02-08 Thread Marco Elver
On Fri, Feb 05, 2021 at 06:34PM +0100, Andrey Konovalov wrote: > Hwardware tag-based KASAN only reports the first found bug. After that MTE > tag checking gets disabled. Clarify this in comments and documentation. > > Signed-off-by: Andrey Konovalov Reviewed-by:

Re: [PATCH 1/2] kcsan: Make test follow KUnit style recommendations

2021-01-26 Thread Marco Elver
On Tue, 26 Jan 2021 at 05:35, David Gow wrote: > > On Thu, Jan 14, 2021 at 12:06 AM Marco Elver wrote: > > > > Per recently added KUnit style recommendations at > > Documentation/dev-tools/kunit/style.rst, make the following changes to > > the KCSAN test: > >

Re: possible deadlock in lock_timer_base

2021-01-04 Thread Marco Elver
On Sun, 3 Jan 2021 at 10:49, Hillf Danton wrote: > > Sat, 02 Jan 2021 22:59:11 -0800 > > syzbot found the following issue on: > > > > HEAD commit:d7a03a44 Add linux-next specific files for 20201223 > > git tree: linux-next > > console output: https://syzkaller.appspot.com/x/log.txt?x=155

[PATCH mm] kfence: fix potential deadlock due to wake_up()

2021-01-04 Thread Marco Elver
is insignificant. Link: https://lkml.kernel.org/r/c0645805b7f98...@google.com Reported-by: syzbot+8983d6d4f7df556be...@syzkaller.appspotmail.com Suggested-by: Hillf Danton Signed-off-by: Marco Elver --- mm/kfence/core.c | 15 ++- 1 file changed, 10 insertions(+)

Re: [PATCH v3 15/15] kasan: don't run tests when KASAN is not enabled

2021-01-15 Thread Marco Elver
ned-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > lib/test_kasan.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/lib/test_kasan.c b/lib/test_kasan.c > index a96376aa7293..6238b56127f8 100644 > --- a/lib/test_kasan.c > +++ b/lib/tes

Re: [PATCH v3 14/15] kasan: add a test for kmem_cache_alloc/free_bulk

2021-01-15 Thread Marco Elver
> Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > lib/test_kasan.c | 38 +- > 1 file changed, 33 insertions(+), 5 deletions(-) > > diff --git a/lib/test_kasan.c b/lib/test_kasan.c > index ab22a653762e..a96376aa7293 100644

Re: [PATCH v3 11/15] kasan: move _RET_IP_ to inline wrappers

2021-01-15 Thread Marco Elver
ader. > > Now that KASAN has inline wrappers for all of its annotations, move > _RET_IP_ to those wrappers to simplify annotation call sites. > > Link: > https://linux-review.googlesource.com/id/I8fb3c06d49671305ee184175a39591bc26647a67 > Signed-off-by: Andrey Konovalov Mu

Re: [PATCH v3 12/15] kasan: fix bug detection via ksize for HW_TAGS mode

2021-01-15 Thread Marco Elver
itself, and via plain accesses that happen later. > > Link: > https://linux-review.googlesource.com/id/Iaabf771881d0f9ce1b969f2a62938e99d3308ec5 > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > include/linux/kasan-checks.h | 6 ++ >

[PATCH] kcsan: Add missing license and copyright headers

2021-01-15 Thread Marco Elver
Adds missing license and/or copyright headers for KCSAN source files. Signed-off-by: Marco Elver --- Documentation/dev-tools/kcsan.rst | 3 +++ include/linux/kcsan-checks.h | 6 ++ include/linux/kcsan.h | 7 +++ kernel/kcsan/atomic.h | 5 + kernel/kcsan

Re: [PATCH] kcsan: Add missing license and copyright headers

2021-01-15 Thread Marco Elver
On Fri, 15 Jan 2021 at 22:58, Paul E. McKenney wrote: > This one seemed straightforward and I heard no objections to the previous > two-patch series, so I queued them for the v5.13 merge window, thank you! > > If any of them need adjustment, please send me the updated patch and > tell me which on

Re: [PATCH] kcsan: Add missing license and copyright headers

2021-01-15 Thread Marco Elver
On Sat, 16 Jan 2021 at 00:31, Paul E. McKenney wrote: > On Sat, Jan 16, 2021 at 12:21:53AM +0100, Marco Elver wrote: > > On Fri, 15 Jan 2021 at 22:58, Paul E. McKenney wrote: > > > > > This one seemed straightforward and I heard no objections to the previous > > &

[PATCH mm 1/4] kfence: add missing copyright and description headers

2021-01-18 Thread Marco Elver
Add missing copyright and description headers to KFENCE source files. Signed-off-by: Marco Elver --- If appropriate, to be squashed into: mm: add Kernel Electric-Fence infrastructure --- include/linux/kfence.h | 6 ++ mm/kfence/core.c | 5 + mm/kfence/kfence.h | 6

[PATCH mm 2/4] kfence, x86: add missing copyright and description header

2021-01-18 Thread Marco Elver
Add missing copyright and description header to KFENCE source file. Signed-off-by: Marco Elver --- If appropriate, to be squashed into: x86, kfence: enable KFENCE for x86 --- arch/x86/include/asm/kfence.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm

[PATCH mm 4/4] kfence: add missing copyright header to documentation

2021-01-18 Thread Marco Elver
Add missing copyright header to KFENCE documentation. Signed-off-by: Marco Elver --- If appropriate, to be squashed into: kfence, Documentation: add KFENCE documentation --- Documentation/dev-tools/kfence.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/dev-tools

[PATCH mm 3/4] kfence, arm64: add missing copyright and description header

2021-01-18 Thread Marco Elver
Add missing copyright and description header to KFENCE source file. Signed-off-by: Marco Elver --- If appropriate, to be squashed into: arm64, kfence: enable KFENCE for ARM64 --- arch/arm64/include/asm/kfence.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/include

<    1   2   3   4   5   6   7   8   9   10   >