[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXOZ1vsFvQRkxK9x@J2N7QTR9R3.cambridge.arm.com>
Date: Fri, 23 Jan 2026 15:55:02 +0000
From: Mark Rutland <mark.rutland@....com>
To: "zhaoyang.huang" <zhaoyang.huang@...soc.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, James Morse <james.morse@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Zhaoyang Huang <huangzhaoyang@...il.com>, steve.kang@...soc.com,
jeson.gao@...soc.com, xuewen.yan@...soc.com
Subject: Re: [PATCH] arch: arm64: set __nocfi on swsusp_arch_resume
On Thu, Jan 22, 2026 at 07:49:25PM +0800, zhaoyang.huang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@...soc.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.
Powered by blists - more mailing lists