Thread (17 messages) 17 messages, 4 authors, 2021-10-02

Re: [syzbot] upstream test error: KASAN: invalid-access Read in __entry_tramp_text_end

flat view

From: Peter Zijlstra <peterz@infradead.org>
Date: 2021-09-29 10:02:06
Also in: linux-fsdevel, lkml

On Wed, Sep 29, 2021 at 09:50:45AM +0100, Mark Rutland wrote:
On Wed, Sep 29, 2021 at 09:39:47AM +0200, Peter Zijlstra wrote:
quoted
On Tue, Sep 28, 2021 at 06:36:37PM -0700, Josh Poimboeuf wrote:
quoted
quoted
+	asm volatile("417: rdmsr\n"
+		     : EAX_EDX_RET(val, low, high)
+		     : "c" (msr));
+	asm_volatile_goto(_ASM_EXTABLE(417b, %l[Efault]) :::: Efault);
That's terrible :-) Could probably do with a comment, but might just
work..
The compiler is well within its rights to spill/restore/copy/shuffle
registers or modify memory between the two asm blocks (which it's liable
to do that when optimizing this after a few layers of inlining), and
skipping that would cause all sorts of undefined behaviour.
Ah, but in this case it'll work irrespective of that (which is why we
needs a comment!).

This is because _ASM_EXTABLE only generates data for another section.
There doesn't need to be code continuity between these two asm
statements.

As I said, this is terrible :-)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help