Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4551B352C4B for ; Sat, 7 Feb 2026 15:05:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770476755; cv=none; b=Eq4eS/y5Uvwxjwkx4RuzK/4Wa2hGqfuUPCFhZEGpab/qeGo07R13v/KPyTlYfSSMdFQX6bGTvWntwH82AcRXN8mA0L6SkYW7u4ah9/D/CxUM0TU/m34BGics/+Gnsq0Hm/GlMyLfDBuW71k/H0gR6pnfx3AKEQg/IvdYXgs72oU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770476755; c=relaxed/simple; bh=8zgXGsRC+rSThHcXlQDKiWAJp9u38OT71gi+m47Xt9A=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=EEoW/cJRNhGc6mvJGtdfRk2f2QFtQNGqNj94L8zQMVuEUkCEG/jkffLvfGfJlmLTjHy/RhxZg2YkXhZg8yPzlQBHkUJ7BR4IWCpW7fY+I3okddudjnSOYQ3NbLFzfNvsIIBvSYNcdddbS8bhq8ZoCFeDArGQ5kJogQOtFXx0IGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Rq6ll2gl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Rq6ll2gl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9C7FC116D0; Sat, 7 Feb 2026 15:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770476755; bh=8zgXGsRC+rSThHcXlQDKiWAJp9u38OT71gi+m47Xt9A=; h=Subject:To:Cc:From:Date:From; b=Rq6ll2glPn1ZYJ342EeoZT8Bxvz6wMQkX7j1R3R41/AFQ+9XeNjgIX8JvojvHBr3o 2sHSSBd6WthEDrkllUNkd5gGrFVqxXWRmWyIleJ4D9UnZTD0rFQbvZNeJF7WEvkWZf 7AuojcNOFqd7hl4QrnrKzhfDkZ99WxwbxPu3zu38= Subject: FAILED: patch "[PATCH] KVM: selftests: Add -U_FORTIFY_SOURCE to avoid some" failed to apply to 6.1-stable tree To: zhiquan_li@163.com,seanjc@google.com Cc: From: Date: Sat, 07 Feb 2026 16:04:56 +0100 Message-ID: <2026020756-ventricle-automated-f5f0@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-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-6.1.y git checkout FETCH_HEAD git cherry-pick -x e396a74222654486d6ab45dca5d0c54c408b8b91 # git commit -s git send-email --to '' --in-reply-to '2026020756-ventricle-automated-f5f0@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From e396a74222654486d6ab45dca5d0c54c408b8b91 Mon Sep 17 00:00:00 2001 From: Zhiquan Li Date: Thu, 22 Jan 2026 13:35:50 +0800 Subject: [PATCH] KVM: selftests: Add -U_FORTIFY_SOURCE to avoid some unpredictable test failures Some distributions (such as Ubuntu) configure GCC so that _FORTIFY_SOURCE is automatically enabled at -O1 or above. This results in some fortified version of definitions of standard library functions are included. While linker resolves the symbols, the fortified versions might override the definitions in lib/string_override.c and reference to those PLT entries in GLIBC. This is not a problem for the code in host, but it is a disaster for the guest code. E.g., if build and run x86/nested_emulation_test on Ubuntu 24.04 will encounter a L1 #PF due to memset() reference to __memset_chk@plt. The option -fno-builtin-memset is not helpful here, because those fortified versions are not built-in but some definitions which are included by header, they are for different intentions. In order to eliminate the unpredictable behaviors may vary depending on the linker and platform, add the "-U_FORTIFY_SOURCE" into CFLAGS to prevent from introducing the fortified definitions. Signed-off-by: Zhiquan Li Link: https://patch.msgid.link/20260122053551.548229-1-zhiquan_li@163.com Fixes: 6b6f71484bf4 ("KVM: selftests: Implement memcmp(), memcpy(), and memset() for guest use") Cc: stable@vger.kernel.org [sean: tag for stable] Signed-off-by: Sean Christopherson diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm index ba5c2b643efa..d45bf4ccb3bf 100644 --- a/tools/testing/selftests/kvm/Makefile.kvm +++ b/tools/testing/selftests/kvm/Makefile.kvm @@ -251,6 +251,7 @@ LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ -Wno-gnu-variable-sized-type-not-at-end -MD -MP -DCONFIG_64BIT \ + -U_FORTIFY_SOURCE \ -fno-builtin-memcmp -fno-builtin-memcpy \ -fno-builtin-memset -fno-builtin-strnlen \ -fno-stack-protector -fno-PIE -fno-strict-aliasing \