]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
vmlinux.lds.h: Fix placement of '.data..decrypted' section
authorNathan Chancellor <nathan@kernel.org>
Tue, 8 Nov 2022 17:49:34 +0000 (10:49 -0700)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 12:59:06 +0000 (13:59 +0100)
commit9c1a20dc4e429e8e25b032dc48e52feb34c3d135
tree1edd88422e713efd18763bb9ed924f0b95b916b2
parent3f57f557f9617ed5e11c0fbefe69b0431ee4cc4f
vmlinux.lds.h: Fix placement of '.data..decrypted' section

commit 000f8870a47bdc36730357883b6aef42bced91ee upstream.

Commit d4c639990036 ("vmlinux.lds.h: Avoid orphan section with !SMP")
fixed an orphan section warning by adding the '.data..decrypted' section
to the linker script under the PERCPU_DECRYPTED_SECTION define but that
placement introduced a panic with !SMP, as the percpu sections are not
instantiated with that configuration so attempting to access variables
defined with DEFINE_PER_CPU_DECRYPTED() will result in a page fault.

Move the '.data..decrypted' section to the DATA_MAIN define so that the
variables in it are properly instantiated at boot time with
CONFIG_SMP=n.

Cc: stable@vger.kernel.org
Fixes: d4c639990036 ("vmlinux.lds.h: Avoid orphan section with !SMP")
Link: https://lore.kernel.org/cbbd3548-880c-d2ca-1b67-5bb93b291d5f@huawei.com/
Debugged-by: Ard Biesheuvel <ardb@kernel.org>
Reported-by: Zhao Wenhui <zhaowenhui8@huawei.com>
Tested-by: xiafukun <xiafukun@huawei.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221108174934.3384275-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 51ae4579a5d53bda4badf56d8dc2d0397571b8f9)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
include/asm-generic/vmlinux.lds.h