From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 642AFC71153 for ; Sun, 10 Sep 2023 18:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbjIJSav (ORCPT ); Sun, 10 Sep 2023 14:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232419AbjIJSau (ORCPT ); Sun, 10 Sep 2023 14:30:50 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0F531BD for ; Sun, 10 Sep 2023 11:30:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02F07C433C8; Sun, 10 Sep 2023 18:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694370645; bh=q4S7DiZqfezquhU2/g+KyZ75mcFSYd1NlKEKGGhQoAg=; h=Subject:To:Cc:From:Date:From; b=Icr+DgaT/2xfqogKaOa0PI+ZosyxoRpQAY8a4fDCsm70btmLOFgJxscMqQREKBU0Q ASDplJsYDi89YHtLHsCMqmlLPsHbs3ExUj3XiY3+KlBKsDZ+IKSTB3EjA9mRQFDJiE i0zQBzfDKWf/qmRjaOVg9I6jyuAXKz/FhTOBZXag= Subject: FAILED: patch "[PATCH] x86/build: Fix linker fill bytes quirk/incompatibility for" failed to apply to 5.15-stable tree To: song@kernel.org, keescook@chromium.org, mingo@kernel.org, peterz@infradead.org Cc: From: Date: Sun, 10 Sep 2023 19:30:33 +0100 Message-ID: <2023091033-scone-precinct-e841@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 65e710899fd19f435f40268f3a92dfaa11f14470 # git commit -s git send-email --to '' --in-reply-to '2023091033-scone-precinct-e841@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 65e710899fd19f435f40268f3a92dfaa11f14470 Mon Sep 17 00:00:00 2001 From: Song Liu Date: Wed, 6 Sep 2023 10:52:15 -0700 Subject: [PATCH] x86/build: Fix linker fill bytes quirk/incompatibility for ld.lld With ":text =0xcccc", ld.lld fills unused text area with 0xcccc0000. Example objdump -D output: ffffffff82b04203: 00 00 add %al,(%rax) ffffffff82b04205: cc int3 ffffffff82b04206: cc int3 ffffffff82b04207: 00 00 add %al,(%rax) ffffffff82b04209: cc int3 ffffffff82b0420a: cc int3 Replace it with ":text =0xcccccccc", so we get the following instead: ffffffff82b04203: cc int3 ffffffff82b04204: cc int3 ffffffff82b04205: cc int3 ffffffff82b04206: cc int3 ffffffff82b04207: cc int3 ffffffff82b04208: cc int3 gcc/ld doesn't seem to have the same issue. The generated code stays the same for gcc/ld. Signed-off-by: Song Liu Signed-off-by: Ingo Molnar Reviewed-by: Kees Cook Acked-by: Peter Zijlstra (Intel) Fixes: 7705dc855797 ("x86/vmlinux: Use INT3 instead of NOP for linker fill bytes") Link: https://lore.kernel.org/r/20230906175215.2236033-1-song@kernel.org diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 83d41c2601d7..f15fb71f280e 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -156,7 +156,7 @@ SECTIONS ALIGN_ENTRY_TEXT_END *(.gnu.warning) - } :text =0xcccc + } :text = 0xcccccccc /* End of text section, which should occupy whole number of pages */ _etext = .;