From: Catalin Marinas <catalin.marinas@arm.com>
To: Ben Cressey <ben@cressey.dev>
Cc: Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Kees Cook <kees@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
kexec@lists.infradead.org, llvm@lists.linux.dev,
Nathan Chancellor <nathan@kernel.org>,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
Jeson Gao <jeson.gao@unisoc.com>
Subject: Re: [PATCH v2 2/2] arm64: hibernate: use a typed entry to drop __nocfi
Date: Wed, 18 Nov 2026 18:33:32 +0000 [thread overview]
Message-ID: <av3vfAK-XHNzRnFI@arm.com> (raw)
In-Reply-To: <20261111-arm64-kexec-nocfi-v2-2-ddf0c4aa326f@cressey.dev>
On Wed, Nov 11, 2026 at 03:26:05PM -0800, Ben Cressey wrote:
> swsusp_arch_resume() calls the safe page's copy of
> swsusp_arch_suspend_exit() indirectly, without a kCFI check. The MMU is
> on at the call and TTBR0 maps only that page. The copy starts at the
> page's first byte, so the check's load of the type hash in front of it
> would fault. SYM_CODE_START() also gives the routine no hash.
> Commit e2f8216ca2d8 ("arm64: Set __nocfi on swsusp_arch_resume()")
> disabled the check "for now", since the entry had to be first
> in .hibernate_exit.text.
>
> SYM_TYPED_FUNC_START() emits the hash inside that section, and
> create_safe_exec_page() already copies the whole section, at most 4 KiB,
> to the page's start, so the page holds both hash and entry. Relax the
> linker script's ASSERT, so the entry need only be in the section.
>
> Fix by typing the routine, with a C prototype, entering the copy at the
> symbol's offset in the section, and dropping __nocfi.
>
> Suggested-by: Mark Rutland <mark.rutland@arm.com>
> Link: https://lore.kernel.org/linux-arm-kernel/arZSe8hNnRPM5FqY@J2N7QTR9R3.cambridge.arm.com/
> Signed-off-by: Ben Cressey <ben@cressey.dev>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
next prev parent reply other threads:[~2026-11-18 18:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 23:26 [PATCH v2 0/2] arm64: use typed entries into copied code for kCFI Ben Cressey
2026-11-11 23:26 ` [PATCH v2 1/2] arm64: kexec: use a typed entry to fix kCFI oops Ben Cressey
2026-11-11 23:26 ` [PATCH v2 2/2] arm64: hibernate: use a typed entry to drop __nocfi Ben Cressey
2026-11-18 18:33 ` Catalin Marinas [this message]
2026-11-18 18:26 ` (subset) [PATCH v2 0/2] arm64: use typed entries into copied code for kCFI Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=av3vfAK-XHNzRnFI@arm.com \
--to=catalin.marinas@arm.com \
--cc=ben@cressey.dev \
--cc=jeson.gao@unisoc.com \
--cc=kees@kernel.org \
--cc=kexec@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=nathan@kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=samitolvanen@google.com \
--cc=will@kernel.org \
--cc=zhaoyang.huang@unisoc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox