linux-next build error (9)

54 views
Skip to first unread message

syzbot

unread,
Jun 22, 2020, 5:37:13 AM6/22/20
to b...@alien8.de, h...@zytor.com, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, sean.j.chr...@intel.com, s...@canb.auug.org.au, syzkall...@googlegroups.com, tg...@linutronix.de, vkuz...@redhat.com, wanp...@tencent.com, x...@kernel.org
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: syzbot+dbf8cf...@syzkaller.appspotmail.com

./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 syzk...@googlegroups.com.

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

Peter Zijlstra

unread,
Jun 22, 2020, 5:49:54 AM6/22/20
to syzbot, b...@alien8.de, h...@zytor.com, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, sean.j.chr...@intel.com, s...@canb.auug.org.au, syzkall...@googlegroups.com, tg...@linutronix.de, vkuz...@redhat.com, wanp...@tencent.com, x...@kernel.org, el...@google.com
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: syzbot+dbf8cf...@syzkaller.appspotmail.com
>
> ./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?

Marco Elver

unread,
Jun 22, 2020, 7:06:36 AM6/22/20
to Peter Zijlstra, syzbot, Borislav Petkov, H. Peter Anvin, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, LKML, Linux Next Mailing List, Ingo Molnar, Paolo Bonzini, sean.j.chr...@intel.com, Stephen Rothwell, syzkaller-bugs, Thomas Gleixner, vkuz...@redhat.com, wanp...@tencent.com, the arch/x86 maintainers, Dmitry Vyukov
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

Marco Elver

unread,
Jun 22, 2020, 9:12:52 AM6/22/20
to Peter Zijlstra, syzbot, Borislav Petkov, H. Peter Anvin, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, LKML, Linux Next Mailing List, Ingo Molnar, Paolo Bonzini, sean.j.chr...@intel.com, Stephen Rothwell, syzkaller-bugs, Thomas Gleixner, vkuz...@redhat.com, wanp...@tencent.com, the arch/x86 maintainers, Dmitry Vyukov
#syz invalid

compiler upgraded.

Stephen Rothwell

unread,
Jun 22, 2020, 10:44:24 PM6/22/20
to Peter Zijlstra, syzbot, b...@alien8.de, h...@zytor.com, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, sean.j.chr...@intel.com, syzkall...@googlegroups.com, tg...@linutronix.de, vkuz...@redhat.com, wanp...@tencent.com, x...@kernel.org, el...@google.com
Hi Peter,
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

Peter Zijlstra

unread,
Jun 23, 2020, 5:32:57 AM6/23/20
to Stephen Rothwell, syzbot, b...@alien8.de, h...@zytor.com, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, sean.j.chr...@intel.com, syzkall...@googlegroups.com, tg...@linutronix.de, vkuz...@redhat.com, wanp...@tencent.com, x...@kernel.org, el...@google.com
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 <pet...@infradead.org> 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.
signature.asc

Marco Elver

unread,
Jun 23, 2020, 6:09:19 AM6/23/20
to Peter Zijlstra, Stephen Rothwell, syzbot, Borislav Petkov, H. Peter Anvin, Jim Mattson, jo...@8bytes.org, k...@vger.kernel.org, LKML, Linux Next Mailing List, Ingo Molnar, Paolo Bonzini, sean.j.chr...@intel.com, syzkaller-bugs, Thomas Gleixner, vkuz...@redhat.com, wanp...@tencent.com, the arch/x86 maintainers
I'm trying to figure out by inspecting GCC changelogs which version
and which arch is actually good.

Thanks,
-- Marco

Stephen Rothwell

unread,
Jun 23, 2020, 6:17:56 AM6/23/20
to Peter Zijlstra, syzbot, b...@alien8.de, h...@zytor.com, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, sean.j.chr...@intel.com, syzkall...@googlegroups.com, tg...@linutronix.de, vkuz...@redhat.com, wanp...@tencent.com, x...@kernel.org, el...@google.com
Hi Peter,

On Tue, 23 Jun 2020 11:32:30 +0200 Peter Zijlstra <pet...@infradead.org> 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

Marco Elver

unread,
Jun 23, 2020, 7:24:56 AM6/23/20
to Stephen Rothwell, Peter Zijlstra, syzbot, b...@alien8.de, h...@zytor.com, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, sean.j.chr...@intel.com, syzkall...@googlegroups.com, tg...@linutronix.de, vkuz...@redhat.com, wanp...@tencent.com, x...@kernel.org
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 <el...@google.com>
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 <s...@canb.auug.org.au>
Signed-off-by: Marco Elver <el...@google.com>
---
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

Stephen Rothwell

unread,
Jun 23, 2020, 7:00:38 PM6/23/20
to Marco Elver, Peter Zijlstra, syzbot, b...@alien8.de, h...@zytor.com, jmat...@google.com, jo...@8bytes.org, k...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, sean.j.chr...@intel.com, syzkall...@googlegroups.com, tg...@linutronix.de, vkuz...@redhat.com, wanp...@tencent.com, x...@kernel.org
Hi Marco,
Thanks for tracking that down. I will add that patch to the tip tree
merge for today.

--
Cheers,
Stephen Rothwell

newroot

unread,
Sep 5, 2020, 7:53:41 PM9/5/20
to syzkaller-bugs
nice that you fixed it for gcc-8.0.1 but can you commit the fix for gcc-9 and later too?
Reply all
Reply to author
Forward
0 new messages