From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C305B362149 for ; Wed, 12 Aug 2026 19:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786561338; cv=none; b=Z5f0Y5hkxGCo2kT7so7ho6my2e/468tzVPJs1whr74fj2B83UpWKofGBopb2JwZ8un99YSLVbU+sj4t/DB/AVJc/kmtp2UnyyPeCKiDGwizf6TMFeufMWktcJMMdGheMgCYoq4dAZAc60h/mbbP02slv/rkHbRETvzVfSkpyN1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786561338; c=relaxed/simple; bh=7/SyHoyn0bdLX/0VbBnuWjZydqXIiEEqAYcU5J2Iny4=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=KUwyf5pbb+CAojC7OsfG1vebUqmPstXcvSxtCYuZc/EFB4OxbVTWndfZ1z7WG2hDdg1dp7mtX0cze/Emeiol4RcLInfIFLNTMomDX7yRWmakO0iY9E3c/Ty6MFAKky6X++k9kEvB8xwjEDG1KRaZzPw3EiXeUaZZ/6nj4msPSj0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=Af5Ob9oO; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="Af5Ob9oO" Received: from ehlo.thunderbird.net ([172.59.161.195]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 67CJ1fFw2541471 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Wed, 12 Aug 2026 12:01:42 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 67CJ1fFw2541471 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026072801; t=1786561303; bh=zcisOmpejxBUnwqvVxS0R2fkxcWAQqr/sONs1gG6r5M=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Af5Ob9oOx0FTrJjjY+Mv9EwUEzInC4MCNCWFu3pT7Blya5aUGeQoyn0Eatw5PdZSo PpabQRoziNypX40ttisi/mWHovJkz4IDzxSA1KUB1gr4DZ1BANo1vi0Q8grPLaDTqe hhlHuOfv7ld8j+nLGZufxOX0/ClrgRFbhBmJj4q5Sx6+jJXF5G3zTqP41rJqkBuqM+ CxP4MugQrBgtt4xla02CTWlo5f/WBZYXvzzqmlIRRs56yckaG/Ht1R8MewlZ1oOawL ZTCWZYx/x7FjelxtzGElBwKbIZhZYZXuBhOzJ8Pm3z3+t36Z8y+9LeZEuu8zcCx7f3 PI/mjjmNJ+XDg== Date: Wed, 12 Aug 2026 12:01:36 -0700 From: "H. Peter Anvin" To: =?UTF-8?B?5p2O5YiZ6Imv?= , Peter Zijlstra CC: =?ISO-8859-1?Q?J=FCrgen_Gro=DF?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Kees Cook , Nathan Chancellor , Josh Poimboeuf , linux-kernel@vger.kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH=5D_x86/alternatives=3A_gracefully_s?= =?US-ASCII?Q?kip_unrecognized_indirect_call_instructions?= User-Agent: K-9 Mail for Android In-Reply-To: References: <191300ae-0f0d-430e-955f-bdd2aea4997e@suse.com> <20260812110023.GL776954@noisy.programming.kicks-ass.net> Message-ID: <00C4A911-0909-4C7A-9374-5845268664AF@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On August 12, 2026 10:14:41 AM PDT, "=E6=9D=8E=E5=88=99=E8=89=AF" wrote: >> >> I don't think we want to cater for this=2E But what actual instruction >> sequences is it emitting? > >This is the scene that triggers the bug, which can be perfectly >reproduced when KCFLAGS=3D-O1=2E > >[ 0=2E111827] SMP alternatives: ALT_FLAG_DIRECT_CALL set for >unrecognized indirect call >[ 0=2E112083] ------------[ cut here ]------------ >[ 0=2E112417] kernel BUG at arch/x86/kernel/alternative=2Ec:558! >[ 0=2E113080] Oops: invalid opcode: 0000 [#1] SMP NOPTI >[ 0=2E113424] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted >7=2E2=2E0-rc7-00016-g3d6d817622b0-dirty #2 PREEMPT(lazy) >[ 0=2E114077] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), >BIOS 1=2E17=2E0-debian-1=2E17=2E0-1ubuntu1 04/01/2014 >[ 0=2E114077] RIP: 0010:apply_alternatives+0x3a6/0x540 >[ 0=2E114077] Code: 8d 04 80 89 95 d1 fe ff ff e9 dd fe ff ff 48 c7 >c7 f8 88 9d 82 e8 ea 94 0d 00 90 0f 0b 48 c7 c7 50 89 9d 82 e8 db 94 >0d 00 90 <0f> 0b 80 7d ce 00 75 0d 41 80 7e 0d 00 0f 84 14 ff ff ff eb >62 48 >[ 0=2E114077] RSP: 0000:ffffffff82c03d60 EFLAGS: 00010246 >[ 0=2E114077] RAX: 0000000000000049 RBX: ffffffff831dae1c RCX: 0000000= 000000003 >[ 0=2E114077] RDX: 0000000000000000 RSI: ffffffff82d3cd08 RDI: 0000000= 000000001 >[ 0=2E114077] RBP: ffffffff82c03ea8 R08: 0000000000000000 R09: 205d373= 238313131 >[ 0=2E114077] R10: 7265746c6120504d R11: 65746c6120504d53 R12: fffffff= f831e116c >[ 0=2E114077] R13: ffffffff82ee2880 R14: ffffffff831dae0e R15: fffffff= f831e1f58 >[ 0=2E114077] FS: 0000000000000000(0000) GS:ffff8882f4a18000(0000) >knlGS:0000000000000000 >[ 0=2E114077] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >[ 0=2E114077] CR2: ffff88827ffff000 CR3: 0000000002c30001 CR4: 0000000= 000770ef0 >[ 0=2E114077] PKRU: 55555554 >[ 0=2E114077] Call Trace: >[ 0=2E114077] >[ 0=2E114077] ? insn_get_sib+0x21/0x80 >[ 0=2E114077] ? early_fixup_exception+0x85/0xa0 >[ 0=2E114077] alternative_instructions+0x76/0x110 >[ 0=2E114077] arch_cpu_finalize_init+0x113/0x170 >[ 0=2E114077] start_kernel+0x794/0x820 >[ 0=2E114077] x86_64_start_reservations+0x28/0x30 >[ 0=2E114077] x86_64_start_kernel+0xdc/0xe0 >[ 0=2E114077] common_startup_64+0x13e/0x158 >[ 0=2E114077] RIP: 1f0f:0x2e66000000000084 >[ 0=2E114077] Code: Unable to access opcode bytes at 0x2e6600000000005= a=2E >[ 0=2E114077] RSP: 0000:00841f0f2e660000 EFLAGS: 841f0f2e66 ORIG_RAX: >1f0f2e6600000000 >[ 0=2E114077] RAX: 1f0f2e6600000000 RBX: 1f0f2e6600000000 RCX: 2e66000= 000000084 >[ 0=2E114077] RDX: 0000000000841f0f RSI: 000000841f0f2e66 RDI: 00841f0= f2e660000 >[ 0=2E114077] RBP: 00841f0f2e660000 R08: 00841f0f2e660000 R09: 0000008= 41f0f2e66 >[ 0=2E114077] R10: 0000000000841f0f R11: 2e66000000000084 R12: 0000008= 41f0f2e66 >[ 0=2E114077] R13: 0000000000841f0f R14: 2e66000000000084 R15: 1f0f2e6= 600000000 >[ 0=2E114077] >[ 0=2E114077] Modules linked in: >[ 0=2E114078] ---[ end trace 0000000000000000 ]--- >[ 0=2E114405] RIP: 0010:apply_alternatives+0x3a6/0x540 >[ 0=2E115078] Code: 8d 04 80 89 95 d1 fe ff ff e9 dd fe ff ff 48 c7 >c7 f8 88 9d 82 e8 ea 94 0d 00 90 0f 0b 48 c7 c7 50 89 9d 82 e8 db 94 >0d 00 90 <0f> 0b 80 7d ce 00 75 0d 41 80 7e 0d 00 0f 84 14 ff ff ff eb >62 48 >[ 0=2E116078] RSP: 0000:ffffffff82c03d60 EFLAGS: 00010246 >[ 0=2E116456] RAX: 0000000000000049 RBX: ffffffff831dae1c RCX: 0000000= 000000003 >[ 0=2E117077] RDX: 0000000000000000 RSI: ffffffff82d3cd08 RDI: 0000000= 000000001 >[ 0=2E117589] RBP: ffffffff82c03ea8 R08: 0000000000000000 R09: 205d373= 238313131 >[ 0=2E118077] R10: 7265746c6120504d R11: 65746c6120504d53 R12: fffffff= f831e116c >[ 0=2E118585] R13: ffffffff82ee2880 R14: ffffffff831dae0e R15: fffffff= f831e1f58 >[ 0=2E119077] FS: 0000000000000000(0000) GS:ffff8882f4a18000(0000) >knlGS:0000000000000000 >[ 0=2E119642] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >[ 0=2E120077] CR2: ffff88827ffff000 CR3: 0000000002c30001 CR4: 0000000= 000770ef0 >[ 0=2E120537] PKRU: 55555554 >[ 0=2E121078] Kernel panic - not syncing: Attempted to kill the idle t= ask! >[ 0=2E121545] ---[ end Kernel panic - not syncing: Attempted to kill >the idle task! ]--- > Well, what about -Og?