From: Mark Rutland <mark.rutland@arm.com>
To: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, James Morse <james.morse@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Zhaoyang Huang <huangzhaoyang@gmail.com>,
steve.kang@unisoc.com, jeson.gao@unisoc.com,
xuewen.yan@unisoc.com
Subject: Re: [PATCH] arch: arm64: set __nocfi on swsusp_arch_resume
Date: Fri, 23 Jan 2026 15:55:02 +0000 [thread overview]
Message-ID: <aXOZ1vsFvQRkxK9x@J2N7QTR9R3.cambridge.arm.com> (raw)
In-Reply-To: <20260122114925.624309-1-zhaoyang.huang@unisoc.com>
On Thu, Jan 22, 2026 at 07:49:25PM +0800, zhaoyang.huang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
>
> A DABT is reported[1] on an android based system when resume from hiberate,
> which is root caused as CFI will plant stub code[2] to verify the
> swsusp_arch_suspend_exit's authentication, where the hash value is stored
> before the page that alloced by create_safe_exec_page. We also have
> tried to copy the hash value together with the function but get failed since
> the value is not on the desired position(src_start - 4). So we solve
> this issue by setting __nocfi on swsusp_arch_resume and it works.
I think this patch is fine for now, but in case anyone is looking into
this in future, the description isn't quite right.
The problem is that swsusp_arch_suspend_exit() doesn't have a CFI hash
at all, even before it is copied, since it is marked with SYM_CODE_*().
There is no hash to copy.
Ideally we'd mark swsusp_arch_suspend_exit() with SYM_FUNC_*(), but
that'd break the expectation that the entrypoint to
swsusp_arch_suspend_exit() is the first byte of the .hibernate_exit.text
section. Changing that is a bigger job.
AFAICT there isn't a way to suppress KCFI checks for a specific function
call, so for now this'll have to do.
Mark.
next prev parent reply other threads:[~2026-01-23 15:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 11:49 zhaoyang.huang
2026-01-22 12:25 ` Will Deacon
2026-01-22 18:23 ` Catalin Marinas
2026-01-23 15:55 ` Mark Rutland [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-01-14 1:37 zhaoyang.huang
2026-01-14 2:14 ` Zhaoyang Huang
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=aXOZ1vsFvQRkxK9x@J2N7QTR9R3.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=catalin.marinas@arm.com \
--cc=huangzhaoyang@gmail.com \
--cc=james.morse@arm.com \
--cc=jeson.gao@unisoc.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=steve.kang@unisoc.com \
--cc=will@kernel.org \
--cc=xuewen.yan@unisoc.com \
--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
all inboxes | Powered by JetHome®