From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D63822D7B1 for ; Fri, 23 Jan 2026 15:55:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769183708; cv=none; b=VImsX4MEzK2zdZ7hyjJ3S5OmBPZOOXpjZJj4l2OhPE/uM6Elw8ArmJDC0nNtN+nov8ss0/2cYYzHL0FG/PEhi+HTpQ/SkihkuBZjlcMU+hiF3wHX8FXs4eWr143Dkq+BT/o6ZHRx9b/B50XA0ddrlDMlIjs29D9UmBaNndYTn3A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769183708; c=relaxed/simple; bh=262FZUhc5ciMH/9Tm1iGDnI21wb0YTxhgfFQdtfHb1w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IM+ok3AC0JnbrTrJaXS1C4FQaAJdoD2c4Sycdi1FSN/P90dXYmjNMLLo3Z4p2Ruv1ZzuiqSo1V3bZSR2iB9Dcbmc7JUk7eCxQ41z5CJ8Jb1Rzb7ZBUC0s0SOdBfBof1+nqScWRTDMS/G60vkQphmmI0/J+MipY4lnw2CqkjMk7U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 35DF11476; Fri, 23 Jan 2026 07:54:59 -0800 (PST) Received: from J2N7QTR9R3.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 743AF3F694; Fri, 23 Jan 2026 07:55:04 -0800 (PST) Date: Fri, 23 Jan 2026 15:55:02 +0000 From: Mark Rutland To: "zhaoyang.huang" Cc: Catalin Marinas , Will Deacon , James Morse , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Zhaoyang Huang , steve.kang@unisoc.com, jeson.gao@unisoc.com, xuewen.yan@unisoc.com Subject: Re: [PATCH] arch: arm64: set __nocfi on swsusp_arch_resume Message-ID: References: <20260122114925.624309-1-zhaoyang.huang@unisoc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > > 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.