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 746DC30C16F for ; Wed, 12 Aug 2026 11:26:23 +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=1786533988; cv=none; b=ZGvVwvHtqbPuNocQRnLuvHOCrU99WFmIVeq14z0NyXWoqdU/vaq/zs39lhd9JAX+dU+EKSLCWmGoztDwMBYCMjb3LR7trO9xG542Zj09+PIYoO5sJjbwFIJGsp9dkmPf3Yq5U7MPffVUHKBoLEhA6HKrKRA7c0cQq5wXXJcDMbo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786533988; c=relaxed/simple; bh=WEzD+DRI4ttwSbwkyYKsNEnT/MnJ/48oT66rOuI7jxk=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=IHcLFaouFayLvgU0oMhvJLBGQgMemss7MmOXSozIUJVRYIKlMcqXI7Lq/Lgtf0OX9MwBfN+lt5AEdegew/1DFBDD0w9YOLMHq7/frBiBTA6qi4kLbUIvMPG7tv24kzSS+bi9L0+PWeB1BfldUjHO00BtRO51x53opGpaABrJC1A= 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=KWCht6l+; 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="KWCht6l+" Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 67CBOh3g1775281 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Wed, 12 Aug 2026 04:24:43 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 67CBOh3g1775281 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026072801; t=1786533884; bh=COjgWrYdMQopEJ+y99y+lxR9UbV/qv2H/5AdUNFjpXM=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=KWCht6l+tRm/7Dak6eNyVi6Gwqy0+BqRItXHoLSwSMtyb5vtOBnHo9Zq5FGJjKwmb i4ZOCmifwLaG4rahrRJrKwregBAsCFaK1Qj0scNMPs+5Y8dLzzVQbaTm2Gkrmaqepe G8AHjRTLfhz+aqRFOVE0ayVtVlF17AFtukfS6Lc7mfScPte/nCD0AL8Ev9bHzT0wdY B7KOpWVXe6i6yi/0YSW3FLz40aRnTD3x8v54E5W+HBTTzJVORnhIsygwV2YUew7ArE Z+K87tP3D4oj2qJGwrqDG3nKLcRGGDVD7LurV9faBvlpa7cIMw4uKdwLHSKHmU82mm 5XRqWPhE1R4ug== Date: Wed, 12 Aug 2026 04:24:37 -0700 From: "H. Peter Anvin" To: Peter Zijlstra , =?UTF-8?B?5p2O5YiZ6Imv?= 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: <20260812110023.GL776954@noisy.programming.kicks-ass.net> References: <191300ae-0f0d-430e-955f-bdd2aea4997e@suse.com> <20260812110023.GL776954@noisy.programming.kicks-ass.net> Message-ID: <0232397A-11D1-409E-8C85-E1E63EB4D181@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 4:00:23 AM PDT, Peter Zijlstra = wrote: >On Wed, Aug 12, 2026 at 05:22:14PM +0800, =E6=9D=8E=E5=88=99=E8=89=AF wro= te: >> From cd58bd112a6178593c6bc9c0f9b307d6897ae3d0 Mon Sep 17 00:00:00 2001 >> From: Zeliang Li >> Date: Tue, 11 Aug 2026 19:09:09 +0800 >> Subject: [PATCH v2] x86/alternative: WARN and skip unrecognized indirec= t call >> only for non-O2 builds >>=20 >> When the kernel is compiled at a non-default optimization level >> (e=2Eg=2E, KCFLAGS=3D-O1 or -O0), the compiler may emit call instructio= n >> patterns that differ from the expected 6-byte sequence >> (opcodes 0xff 0x15 followed by a 32-bit displacement) checked >> by alt_replace_call()=2E > >I don't think we want to cater for this=2E But what actual instruction >sequences is it emitting? I'm kind of surprised the kernel compiles with -O0 at all; it certainly di= dn't used to=2E -Og was created for a reason=2E=20 That being said, if it helps someone debug a problem as long as the kernel= also screams "bloody murder don't use me in production" it might be useful= =2E=20 Honestly, thinking about it, an "unsafe_debug=3D=2E=2E=2E" or similar kern= el command line option might be justified for things like this; by requirin= g an active user step to enable the unsafe behavior it should make it much = harder for something to sneak into production=2E -hpa