lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250429161002.GB4439@noisy.programming.kicks-ass.net>
Date: Tue, 29 Apr 2025 18:10:02 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: x86@...nel.org, kys@...rosoft.com, haiyangz@...rosoft.com,
	wei.liu@...nel.org, decui@...rosoft.com, tglx@...utronix.de,
	mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
	hpa@...or.com, pawan.kumar.gupta@...ux.intel.com, seanjc@...gle.com,
	pbonzini@...hat.com, ardb@...nel.org, kees@...nel.org,
	Arnd Bergmann <arnd@...db.de>, gregkh@...uxfoundation.org,
	linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
	kvm@...r.kernel.org, linux-efi@...r.kernel.org,
	samitolvanen@...gle.com, ojeda@...nel.org
Subject: Re: [PATCH 6/6] objtool: Validate kCFI calls

On Mon, Apr 14, 2025 at 04:43:26PM -0700, Josh Poimboeuf wrote:

> > +	 * Verify all indirect calls are kCFI adorned by checking for the
> > +	 * UD2. Notably, doing __nocfi calls to regular (cfi) functions is
> > +	 * broken.
> 
> This "__nocfi calls" is confusing me.  IIUC, there are two completely
> different meanings for "nocfi":
> 
>   - __nocfi: disable the kcfi function entry stuff

Ah, no. __nocfi is a bit of a mess, this is both the function entry
thing, but also very much the caller verification stuff for indirect
calls done inside this function.

This leads to lovely stuff like:

void (*foo)(void);

static __always_inline __nocfi void nocfi_caller(void)
{
	foo();
}

void bar(void)
{
	nocfi_caller();
	foo();
}

This actually compiles and has bar() have two distinctly different
indirect calls to foo, while bar itself has a __cfi preamble.


Anyway, let me have a poke at the annotation.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ