2020-06-22 09:39:28

by syzbot

[permalink] [raw]
Subject: linux-next build error (9)

Hello,

syzbot found the following crash on:

HEAD commit: 27f11fea Add linux-next specific files for 20200622
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=138dc743100000
kernel config: https://syzkaller.appspot.com/x/.config?x=41c659db5cada6f4
dashboard link: https://syzkaller.appspot.com/bug?extid=dbf8cf3717c8ef4a90a0
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: [email protected]

./arch/x86/include/asm/kvm_para.h:99:29: error: inlining failed in call to always_inline 'kvm_handle_async_pf': function attribute mismatch
./arch/x86/include/asm/processor.h:824:29: error: inlining failed in call to always_inline 'prefetchw': function attribute mismatch
./arch/x86/include/asm/current.h:13:44: error: inlining failed in call to always_inline 'get_current': function attribute mismatch
arch/x86/mm/fault.c:1353:1: error: inlining failed in call to always_inline 'handle_page_fault': function attribute mismatch
./arch/x86/include/asm/processor.h:576:29: error: inlining failed in call to always_inline 'native_swapgs': function attribute mismatch
./arch/x86/include/asm/fsgsbase.h:33:38: error: inlining failed in call to always_inline 'rdgsbase': function attribute mismatch
./arch/x86/include/asm/irq_stack.h:40:29: error: inlining failed in call to always_inline 'run_on_irqstack_cond': function attribute mismatch
./include/linux/debug_locks.h:15:28: error: inlining failed in call to always_inline '__debug_locks_off': function attribute mismatch
./include/asm-generic/atomic-instrumented.h:70:1: error: inlining failed in call to always_inline 'atomic_add_return': function attribute mismatch
kernel/locking/lockdep.c:396:29: error: inlining failed in call to always_inline 'lockdep_recursion_finish': function attribute mismatch
kernel/locking/lockdep.c:4725:5: error: inlining failed in call to always_inline '__lock_is_held': function attribute mismatch

---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at [email protected].

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.


2020-06-22 09:52:33

by Peter Zijlstra

[permalink] [raw]
Subject: Re: linux-next build error (9)

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: https://syzkaller.appspot.com/x/log.txt?x=138dc743100000
> kernel config: https://syzkaller.appspot.com/x/.config?x=41c659db5cada6f4
> dashboard link: https://syzkaller.appspot.com/bug?extid=dbf8cf3717c8ef4a90a0
> compiler: gcc (GCC) 9.0.0 20181231 (experimental)
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: [email protected]
>
> ./arch/x86/include/asm/kvm_para.h:99:29: error: inlining failed in call to always_inline 'kvm_handle_async_pf': function attribute mismatch
> ./arch/x86/include/asm/processor.h:824:29: error: inlining failed in call to always_inline 'prefetchw': function attribute mismatch
> ./arch/x86/include/asm/current.h:13:44: error: inlining failed in call to always_inline 'get_current': function attribute mismatch
> arch/x86/mm/fault.c:1353:1: error: inlining failed in call to always_inline 'handle_page_fault': function attribute mismatch
> ./arch/x86/include/asm/processor.h:576:29: error: inlining failed in call to always_inline 'native_swapgs': function attribute mismatch
> ./arch/x86/include/asm/fsgsbase.h:33:38: error: inlining failed in call to always_inline 'rdgsbase': function attribute mismatch
> ./arch/x86/include/asm/irq_stack.h:40:29: error: inlining failed in call to always_inline 'run_on_irqstack_cond': function attribute mismatch
> ./include/linux/debug_locks.h:15:28: error: inlining failed in call to always_inline '__debug_locks_off': function attribute mismatch
> ./include/asm-generic/atomic-instrumented.h:70:1: error: inlining failed in call to always_inline 'atomic_add_return': function attribute mismatch
> kernel/locking/lockdep.c:396:29: error: inlining failed in call to always_inline 'lockdep_recursion_finish': function attribute mismatch
> kernel/locking/lockdep.c:4725:5: error: inlining failed in call to always_inline '__lock_is_held': function attribute mismatch

Hurmph, I though that was cured in GCC >= 8. Marco?

2020-06-22 11:09:24

by Marco Elver

[permalink] [raw]
Subject: Re: linux-next build error (9)

On Mon, 22 Jun 2020 at 11:49, Peter Zijlstra <[email protected]> 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: https://syzkaller.appspot.com/x/log.txt?x=138dc743100000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=41c659db5cada6f4
> > dashboard link: https://syzkaller.appspot.com/bug?extid=dbf8cf3717c8ef4a90a0
> > compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> >
> > IMPORTANT: if you fix the bug, please add the following tag to the commit:
> > Reported-by: [email protected]
> >
> > ./arch/x86/include/asm/kvm_para.h:99:29: error: inlining failed in call to always_inline 'kvm_handle_async_pf': function attribute mismatch
> > ./arch/x86/include/asm/processor.h:824:29: error: inlining failed in call to always_inline 'prefetchw': function attribute mismatch
> > ./arch/x86/include/asm/current.h:13:44: error: inlining failed in call to always_inline 'get_current': function attribute mismatch
> > arch/x86/mm/fault.c:1353:1: error: inlining failed in call to always_inline 'handle_page_fault': function attribute mismatch
> > ./arch/x86/include/asm/processor.h:576:29: error: inlining failed in call to always_inline 'native_swapgs': function attribute mismatch
> > ./arch/x86/include/asm/fsgsbase.h:33:38: error: inlining failed in call to always_inline 'rdgsbase': function attribute mismatch
> > ./arch/x86/include/asm/irq_stack.h:40:29: error: inlining failed in call to always_inline 'run_on_irqstack_cond': function attribute mismatch
> > ./include/linux/debug_locks.h:15:28: error: inlining failed in call to always_inline '__debug_locks_off': function attribute mismatch
> > ./include/asm-generic/atomic-instrumented.h:70:1: error: inlining failed in call to always_inline 'atomic_add_return': function attribute mismatch
> > kernel/locking/lockdep.c:396:29: error: inlining failed in call to always_inline 'lockdep_recursion_finish': function attribute mismatch
> > kernel/locking/lockdep.c:4725:5: error: inlining failed in call to always_inline '__lock_is_held': function attribute mismatch
>
> Hurmph, I though that was cured in GCC >= 8. Marco?

Yeah, time to upgrade syzbot's compiler. This experimental gcc 9.0.0
still has the bug, but stable gcc 9 doesn't. For now, I think this
requires no fixes on the kernel side.

Thanks,
-- Marco

2020-06-22 19:13:43

by Marco Elver

[permalink] [raw]
Subject: Re: linux-next build error (9)

On Mon, 22 Jun 2020 at 13:06, Marco Elver <[email protected]> wrote:
>
> On Mon, 22 Jun 2020 at 11:49, Peter Zijlstra <[email protected]> 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: https://syzkaller.appspot.com/x/log.txt?x=138dc743100000
> > > kernel config: https://syzkaller.appspot.com/x/.config?x=41c659db5cada6f4
> > > dashboard link: https://syzkaller.appspot.com/bug?extid=dbf8cf3717c8ef4a90a0
> > > compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> > >
> > > IMPORTANT: if you fix the bug, please add the following tag to the commit:
> > > Reported-by: [email protected]
> > >
> > > ./arch/x86/include/asm/kvm_para.h:99:29: error: inlining failed in call to always_inline 'kvm_handle_async_pf': function attribute mismatch
> > > ./arch/x86/include/asm/processor.h:824:29: error: inlining failed in call to always_inline 'prefetchw': function attribute mismatch
> > > ./arch/x86/include/asm/current.h:13:44: error: inlining failed in call to always_inline 'get_current': function attribute mismatch
> > > arch/x86/mm/fault.c:1353:1: error: inlining failed in call to always_inline 'handle_page_fault': function attribute mismatch
> > > ./arch/x86/include/asm/processor.h:576:29: error: inlining failed in call to always_inline 'native_swapgs': function attribute mismatch
> > > ./arch/x86/include/asm/fsgsbase.h:33:38: error: inlining failed in call to always_inline 'rdgsbase': function attribute mismatch
> > > ./arch/x86/include/asm/irq_stack.h:40:29: error: inlining failed in call to always_inline 'run_on_irqstack_cond': function attribute mismatch
> > > ./include/linux/debug_locks.h:15:28: error: inlining failed in call to always_inline '__debug_locks_off': function attribute mismatch
> > > ./include/asm-generic/atomic-instrumented.h:70:1: error: inlining failed in call to always_inline 'atomic_add_return': function attribute mismatch
> > > kernel/locking/lockdep.c:396:29: error: inlining failed in call to always_inline 'lockdep_recursion_finish': function attribute mismatch
> > > kernel/locking/lockdep.c:4725:5: error: inlining failed in call to always_inline '__lock_is_held': function attribute mismatch
> >
> > Hurmph, I though that was cured in GCC >= 8. Marco?
>
> Yeah, time to upgrade syzbot's compiler. This experimental gcc 9.0.0
> still has the bug, but stable gcc 9 doesn't. For now, I think this
> requires no fixes on the kernel side.

#syz invalid

compiler upgraded.

2020-06-23 02:47:59

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next build error (9)

Hi Peter,

On Mon, 22 Jun 2020 11:49:23 +0200 Peter Zijlstra <[email protected]> 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: https://syzkaller.appspot.com/x/log.txt?x=138dc743100000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=41c659db5cada6f4
> > dashboard link: https://syzkaller.appspot.com/bug?extid=dbf8cf3717c8ef4a90a0
> > compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> >
> > IMPORTANT: if you fix the bug, please add the following tag to the commit:
> > Reported-by: [email protected]
> >
> > ./arch/x86/include/asm/kvm_para.h:99:29: error: inlining failed in call to always_inline 'kvm_handle_async_pf': function attribute mismatch
> > ./arch/x86/include/asm/processor.h:824:29: error: inlining failed in call to always_inline 'prefetchw': function attribute mismatch
> > ./arch/x86/include/asm/current.h:13:44: error: inlining failed in call to always_inline 'get_current': function attribute mismatch
> > arch/x86/mm/fault.c:1353:1: error: inlining failed in call to always_inline 'handle_page_fault': function attribute mismatch
> > ./arch/x86/include/asm/processor.h:576:29: error: inlining failed in call to always_inline 'native_swapgs': function attribute mismatch
> > ./arch/x86/include/asm/fsgsbase.h:33:38: error: inlining failed in call to always_inline 'rdgsbase': function attribute mismatch
> > ./arch/x86/include/asm/irq_stack.h:40:29: error: inlining failed in call to always_inline 'run_on_irqstack_cond': function attribute mismatch
> > ./include/linux/debug_locks.h:15:28: error: inlining failed in call to always_inline '__debug_locks_off': function attribute mismatch
> > ./include/asm-generic/atomic-instrumented.h:70:1: error: inlining failed in call to always_inline 'atomic_add_return': function attribute mismatch
> > kernel/locking/lockdep.c:396:29: error: inlining failed in call to always_inline 'lockdep_recursion_finish': function attribute mismatch
> > kernel/locking/lockdep.c:4725:5: error: inlining failed in call to always_inline '__lock_is_held': function attribute mismatch
>
> Hurmph, I though that was cured in GCC >= 8. Marco?

So what causes this? Because we got a couple of these in our s390 builds last night as well.

kernel/locking/lockdep.c:805:1: error: inlining failed in call to always_inline 'look_up_lock_class': function attribute mismatch
include/linux/debug_locks.h:15:28: error: inlining failed in call to always_inline '__debug_locks_off': function attribute mismatch

s390-linux-gcc (GCC) 8.1.0 / GNU ld (GNU Binutils) 2.30

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-06-23 09:37:30

by Peter Zijlstra

[permalink] [raw]
Subject: Re: linux-next build error (9)

On Tue, Jun 23, 2020 at 12:44:13PM +1000, Stephen Rothwell wrote:
> Hi Peter,
>
> On Mon, 22 Jun 2020 11:49:23 +0200 Peter Zijlstra <[email protected]> wrote:

> > Hurmph, I though that was cured in GCC >= 8. Marco?
>
> So what causes this? Because we got a couple of these in our s390 builds last night as well.

This is KASAN's __no_sanitize_address function attribute. Some GCC
versions are utterly wrecked when that function attribute is combined
with inlining. It wants to have matching attributes for the function
being inlined and function it is inlined into -- hence the function
attribute mismatch.

> kernel/locking/lockdep.c:805:1: error: inlining failed in call to always_inline 'look_up_lock_class': function attribute mismatch
> include/linux/debug_locks.h:15:28: error: inlining failed in call to always_inline '__debug_locks_off': function attribute mismatch
>
> s390-linux-gcc (GCC) 8.1.0 / GNU ld (GNU Binutils) 2.30

*groan*... So supposedly it was supposed to work on GCC-8 and later, see
commit 7b861a53e46b6. But now it turns out there's some later versions
that fail too.

I suppose the next quest is finding a s390 compiler version that works
and then bumping the version test in the aforementioned commit.


Attachments:
(No filename) (1.23 kB)
signature.asc (849.00 B)
Download all attachments

2020-06-23 10:11:54

by Marco Elver

[permalink] [raw]
Subject: Re: linux-next build error (9)

On Tue, 23 Jun 2020 at 11:32, Peter Zijlstra <[email protected]> wrote:
>
> On Tue, Jun 23, 2020 at 12:44:13PM +1000, Stephen Rothwell wrote:
> > Hi Peter,
> >
> > On Mon, 22 Jun 2020 11:49:23 +0200 Peter Zijlstra <[email protected]> wrote:
>
> > > Hurmph, I though that was cured in GCC >= 8. Marco?
> >
> > So what causes this? Because we got a couple of these in our s390 builds last night as well.
>
> This is KASAN's __no_sanitize_address function attribute. Some GCC
> versions are utterly wrecked when that function attribute is combined
> with inlining. It wants to have matching attributes for the function
> being inlined and function it is inlined into -- hence the function
> attribute mismatch.
>
> > kernel/locking/lockdep.c:805:1: error: inlining failed in call to always_inline 'look_up_lock_class': function attribute mismatch
> > include/linux/debug_locks.h:15:28: error: inlining failed in call to always_inline '__debug_locks_off': function attribute mismatch
> >
> > s390-linux-gcc (GCC) 8.1.0 / GNU ld (GNU Binutils) 2.30
>
> *groan*... So supposedly it was supposed to work on GCC-8 and later, see
> commit 7b861a53e46b6. But now it turns out there's some later versions
> that fail too.
>
> I suppose the next quest is finding a s390 compiler version that works
> and then bumping the version test in the aforementioned commit.

I'm trying to figure out by inspecting GCC changelogs which version
and which arch is actually good.

Thanks,
-- Marco

2020-06-23 10:20:42

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next build error (9)

Hi Peter,

On Tue, 23 Jun 2020 11:32:30 +0200 Peter Zijlstra <[email protected]> wrote:
>
> I suppose the next quest is finding a s390 compiler version that works
> and then bumping the version test in the aforementioned commit.

Not a lot of help, but my Debian cross compiler seems to work:

$ s390x-linux-gnu-gcc --version
s390x-linux-gnu-gcc (Debian 9.3.0-13) 9.3.0

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-06-23 11:27:13

by Marco Elver

[permalink] [raw]
Subject: Re: linux-next build error (9)

On Tue, Jun 23, 2020 at 08:17PM +1000, Stephen Rothwell wrote:
> Hi Peter,
>
> On Tue, 23 Jun 2020 11:32:30 +0200 Peter Zijlstra <[email protected]> wrote:
> >
> > I suppose the next quest is finding a s390 compiler version that works
> > and then bumping the version test in the aforementioned commit.
>
> Not a lot of help, but my Debian cross compiler seems to work:
>
> $ s390x-linux-gnu-gcc --version
> s390x-linux-gnu-gcc (Debian 9.3.0-13) 9.3.0

Rummaging through changelogs led me to 8.3.0 as the first good GCC. Also
confirmed by building that version and compiling a file that breaks with
older versions. It seems the first major version to fix it was 9, but
backported to 8.3. This is for all architectures.

Suggested patch below.

Thanks,
-- Marco

------ >8 ------

From: Marco Elver <[email protected]>
Date: Tue, 23 Jun 2020 12:57:42 +0200
Subject: [PATCH] kasan: Fix required compiler version

The first working GCC version to satisfy
CC_HAS_WORKING_NOSANITIZE_ADDRESS is GCC 8.3.0.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89124
Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Marco Elver <[email protected]>
---
lib/Kconfig.kasan | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
index 7a496b885f46..19fba15e99c6 100644
--- a/lib/Kconfig.kasan
+++ b/lib/Kconfig.kasan
@@ -16,7 +16,7 @@ config CC_HAS_KASAN_SW_TAGS
def_bool $(cc-option, -fsanitize=kernel-hwaddress)

config CC_HAS_WORKING_NOSANITIZE_ADDRESS
- def_bool !CC_IS_GCC || GCC_VERSION >= 80000
+ def_bool !CC_IS_GCC || GCC_VERSION >= 80300

config KASAN
bool "KASAN: runtime memory debugger"
--
2.27.0.111.gc72c7da667-goog

2020-06-23 23:01:17

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next build error (9)

Hi Marco,

On Tue, 23 Jun 2020 13:24:48 +0200 Marco Elver <[email protected]> wrote:
>
> On Tue, Jun 23, 2020 at 08:17PM +1000, Stephen Rothwell wrote:
> > Hi Peter,
> >
> > On Tue, 23 Jun 2020 11:32:30 +0200 Peter Zijlstra <[email protected]> wrote:
> > >
> > > I suppose the next quest is finding a s390 compiler version that works
> > > and then bumping the version test in the aforementioned commit.
> >
> > Not a lot of help, but my Debian cross compiler seems to work:
> >
> > $ s390x-linux-gnu-gcc --version
> > s390x-linux-gnu-gcc (Debian 9.3.0-13) 9.3.0
>
> Rummaging through changelogs led me to 8.3.0 as the first good GCC. Also
> confirmed by building that version and compiling a file that breaks with
> older versions. It seems the first major version to fix it was 9, but
> backported to 8.3. This is for all architectures.
>
> Suggested patch below.
>
> Thanks,
> -- Marco
>
> ------ >8 ------
>
> From: Marco Elver <[email protected]>
> Date: Tue, 23 Jun 2020 12:57:42 +0200
> Subject: [PATCH] kasan: Fix required compiler version
>
> The first working GCC version to satisfy
> CC_HAS_WORKING_NOSANITIZE_ADDRESS is GCC 8.3.0.
>
> Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89124
> Reported-by: Stephen Rothwell <[email protected]>
> Signed-off-by: Marco Elver <[email protected]>
> ---
> lib/Kconfig.kasan | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
> index 7a496b885f46..19fba15e99c6 100644
> --- a/lib/Kconfig.kasan
> +++ b/lib/Kconfig.kasan
> @@ -16,7 +16,7 @@ config CC_HAS_KASAN_SW_TAGS
> def_bool $(cc-option, -fsanitize=kernel-hwaddress)
>
> config CC_HAS_WORKING_NOSANITIZE_ADDRESS
> - def_bool !CC_IS_GCC || GCC_VERSION >= 80000
> + def_bool !CC_IS_GCC || GCC_VERSION >= 80300
>
> config KASAN
> bool "KASAN: runtime memory debugger"
> --
> 2.27.0.111.gc72c7da667-goog
>

Thanks for tracking that down. I will add that patch to the tip tree
merge for today.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature
Subject: [tip: x86/entry] kasan: Fix required compiler version

The following commit has been merged into the x86/entry branch of tip:

Commit-ID: acf7b0bf7dcf5a96d9b44a0997227c7210d995c1
Gitweb: https://git.kernel.org/tip/acf7b0bf7dcf5a96d9b44a0997227c7210d995c1
Author: Marco Elver <[email protected]>
AuthorDate: Tue, 23 Jun 2020 13:24:48 +02:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Thu, 25 Jun 2020 13:45:39 +02:00

kasan: Fix required compiler version

The first working GCC version to satisfy
CC_HAS_WORKING_NOSANITIZE_ADDRESS is GCC 8.3.0.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89124
Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Marco Elver <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
---
lib/Kconfig.kasan | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
index af0dd09..34b84bc 100644
--- a/lib/Kconfig.kasan
+++ b/lib/Kconfig.kasan
@@ -16,7 +16,7 @@ config CC_HAS_KASAN_SW_TAGS
def_bool $(cc-option, -fsanitize=kernel-hwaddress)

config CC_HAS_WORKING_NOSANITIZE_ADDRESS
- def_bool !CC_IS_GCC || GCC_VERSION >= 80000
+ def_bool !CC_IS_GCC || GCC_VERSION >= 80300

config KASAN
bool "KASAN: runtime memory debugger"