From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796138267; b=XBHofMamXJ455ETwnCvpTR39cg7OnJ+jOAWiVMmO86aaIPvncgj1DXBMKbvkiMwSw3x7 QtBfJhML0eKllwROu/sFR6OVIk9jVvLAHLG5Yn+gwFeSbm4hX4NdDTbAtwaaZO4TLtRCW psOL/fRMxOPcLDU4Ujr4SYt+UYjdcbglr1UqQc/sWIhq6/uxb9mnwZeqxwGQYM9+x2KBk i83FF1BFdxs+OPztxhIn+850N20anz3Cpq7zoZM5qfdcKPrMQaPhoeJFzXn626LUFRJ4p Fb4xCChbpVxUR5wKM4SHezKROx8mYCu1p8orGoPF28Hd4AKzghu741lQcjBGQRSF5/Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796138267; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=kuWV08KeMV+8NrLfff3rvnVy8FM6qYrGYbROojMbfkU=; b=RFJIaWLh0Ljm8eeYLGe2tUdaI6T5lTg1dxGGxjgiyvUaZjIDCjVXu/lTZfDIaM6+p1jK m/bAj25nAdOSnRxlpKl/Jzg2Oxf7W9HJBrVFhVs7t8bgT3b/kCgLM37M8E4w3OZ4SHtHi WqCi5ibwh43EAgrB4qP0pqXpi5abGktBIMX4qr1JaWS4J7XfzXebE/MeoxFQAiZtnag/f 2PMww1dBfTU45iIESKhk5kUgkgeswmYGdvC79SYs3m70z9Mo/TE/CzeQ3EG5suypV+umT 08WDhBucaqv2Ry/zYNU18iG8/9sGCwxIHO+3p2lE66rDXlx5ZCOUgBdgD74tIq0QIDg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=zU98em8v; arc=none smtp.remote-ip=209.85.128.47 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71DE6606A32C for ; Tue, 1 Dec 2026 15:17:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 71DE6606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=zU98em8v Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4bb666304fdso110721385e9.0 for ; Tue, 01 Dec 2026 07:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796138265; x=1796743065; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=kuWV08KeMV+8NrLfff3rvnVy8FM6qYrGYbROojMbfkU=; b=zU98em8v2hK801L7L2qdjmzsaTX1ufbm0XPRXj+lHvPSZUBx3/FGj0eM6tNw/7bf/P uspNBfp/+aHTO9pRhHDzbP9pmN94L4u6lrU/NNKtGbx7ukSYckNzrdA6/I7b9V7fxseg e+/XKnJ462+7hnYzI/o6gvLYcxnd9uag2xyLOijZEIe7cf91G6H7+bYV5HjOR63gDvys Qwx4/gEY3tSkGTZJ+QxEyofwoLqxqSCUMjv9NcFwvt8IGTfGAYm2ixVbZJRV1geVL69Q tYcdI4Z2TLzNsMOwxWJG/wQAaEwVdD5xCC3mXd+8nsWl8BMV1NOXz5s022IlP/hb29bg EJHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796138265; x=1796743065; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kuWV08KeMV+8NrLfff3rvnVy8FM6qYrGYbROojMbfkU=; b=izu8CvJZszkp0xtvdSDAp3YDQM+LbaLELtKqFRMTUJYyV846ag2ADL7vYc6wT2YF2V 6carXiYWAgFdu4JVcemOSdTYme6yNAMXTmotCfhtjqivxVVhHBeuNAieYrlK5NQjEOJv I2X6HVvIUIfy6t+U/EGrste2XKIz81g+fm6rs4MI3Fk0bK3Ot5pTteYqFdeao09BGnKe v5j2KbvO13RpY8OW9XaoOK41hxZEiJ7TfbyN9CKp1hRKTbJgaMakeJ/ft+1i7wRkPNoR g+CB1tvSmxenQP/VCZ3lzN+7pFJcLpsPqNXNrKSIM3xldCq1rOprk7t7BcbTZg1rhAwc nMSw== X-Forwarded-Encrypted: i=1; AL+hErHfy04fmFsxnLTiBqdBq+3bpnxqMQL4Pq6x6ZmNwkW/5pegnzFYjisU/r/DkH6QVJoYCekPM4qDKb+KKL8=@vger.kernel.org X-Gm-Message-State: APuU4Z86mGbGrBsg4NoOCR8ezfRf72woQkdSnK1gFskMb6tn+vrWqRd4 7dZLkomRD6KXBwUy/KDnGSoPLIpRrvhImnoAIygzrXX9pH2DhXyini7U X-Gm-Gg: AZFdTZeqPC+naW4vmYpVUX/N7rD6itLPnkNVloDE2s6TafDbnoC7NtKKygjg3HUcaHz uE7mAzC9DqyOGPDJ28xcg4fZUUIQlIxaBst2LDQBqTDU2OVCbHh8jMs/+zfJ/LyTIYEPsxKYHWw OTN8ALdo2dhzmOQ31qaqdeJn5i4QiEFYXaxDMQe82SYCu+yWb5jjFL7FCoEs4OF9wZ0q/W69qlo QJ3Je6zy9X7DFRf13PPA13IuHPtfrJI6BSwe1PclUJd9tl6jPaI0K+w58KhW79QSTj2fA/VOSSC uaHpzTuSEzfYOUU8/Sk8aLRiljTWuQCmq7PcrejahOAqRANpCA0UoXXWpeqbHzCEQCzm/aX4R1L suE4fA2Qkf6QW5DXEOxFR5PYk3bKmbk1LlRsP4eIVtoBdVK4Cl8Yz31nKoyhUO3Ugq8TDJQGOW9 75oE9LFC+WEZKPK7EVKN+4P8YVovLJxyEGwQSjiqFDb2+kIWKHzba4HwmVriBLlj+j+QkXQvQ8x OE/N6JHiML8q5Rv6hcKT5mNd6eEajos2HbWVJ3XCetehl3BWaDh9Xv7QxFkkjdBoU/lRY0XuUj2 3Aegexto1bHwrzVGQSGQD2QYbot/RLcXv359HZPDNC/hsC59PF9iSpkWJZmpeSdnfv3nCEoZIYF 57u4zqd5EPkIOefn5NH9Z4F6+RsFrqbmeqadJi18544rUk7dkLCJOdg== X-Received: by 2002:a05:600c:8b6b:b0:4bb:5e8c:13bc with SMTP id 5b1f17b1804b1-4bbba61a187mr240897865e9.7.1796138264586; Tue, 01 Dec 2026 07:17:44 -0800 (PST) Received: from Developer ([216.234.217.221]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb906e4ce6sm667503295e9.4.2026.12.01.07.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 07:17:44 -0800 (PST) From: Seke Kazuru To: joe.lawrence@redhat.com Cc: live-patching@vger.kernel.org, jpoimboe@kernel.org, mbenes@suse.cz, pmladek@suse.com, song@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] objtool/klp: Build x86 test fixtures with -fcf-protection=none Date: Tue, 1 Dec 2026 17:17:38 +0200 Message-ID: <20261201151738.1776-1-kazuruuni@gmail.com> X-Mailer: git-send-email 2.51.0.windows.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit x86 kernels always choose -fcf-protection themselves: =branch with CONFIG_X86_KERNEL_IBT, =none without (arch/x86/Makefile). The test fixtures pass neither, so they get the compiler's default, and Ubuntu's gcc defaults to =full. That puts an ENDBR at the start of a global function but not of a static one, so a patch which only changes a function's linkage changes its code. test-local-to-global-flip makes exactly that change and fails with Ubuntu's gcc 11 to 14: flipped_up gains an ENDBR, klp diff rightly reports it as changed and clones it, and the test, which expects it to be correlated, fails. Build the fixtures for the kernel without IBT, as the kernel would. A test about IBT can still override it. Verified with Ubuntu gcc 11, 13 and 14, Debian gcc 16 and Clang 18 and 23: test-local-to-global-flip fails on the three Ubuntu compilers before this change and passes after it, and no other test changes on any of the six. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Seke Kazuru --- tools/objtool/tests/lib.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/objtool/tests/lib.sh b/tools/objtool/tests/lib.sh index 4da168d0dd..41048960f8 100644 --- a/tools/objtool/tests/lib.sh +++ b/tools/objtool/tests/lib.sh @@ -153,6 +153,15 @@ EOF FIXTURE_CFLAGS="-O2 -ffunction-sections -fdata-sections -fno-common \ -fno-asynchronous-unwind-tables" +# x86 kernels always choose -fcf-protection themselves (arch/x86/Makefile): +# =branch with CONFIG_X86_KERNEL_IBT, =none without. A compiler's default never +# reaches kernel code, and some distributions' gcc defaults to =full, which puts +# an ENDBR at the start of a global function but not of a static one -- so a +# patch which only changes a function's linkage would change its code. Stand +# in for the kernel without IBT; a test about IBT overrides it. +[ "$KLP_TEST_ARCH" != x86 ] || + FIXTURE_CFLAGS="$FIXTURE_CFLAGS -fcf-protection=none" + test_name="$(basename "$0" .sh)" workdir= -- 2.43.0