Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93db8a47 authored by Kees Cook's avatar Kees Cook Committed by Sami Tolvanen
Browse files

ANDROID: x86/alternatives: Use C int3 selftest but disable KASAN



Instead of using inline asm for the int3 selftest (which confuses the
Clang's ThinLTO pass), this restores the C function but disables KASAN
(and tracing for good measure) to keep the things simple and avoid
unexpected side-effects. This attempts to keep the fix from commit
ecc60610 ("x86/alternatives: Fix int3_emulate_call() selftest stack
corruption") without using inline asm.

Bug: 145297900
Change-Id: I2b6e237d89968b677c34e162b71a520ed8375e2d
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
parent e1b3a9f1
Loading
Loading
Loading
Loading
+4 −17
Original line number Diff line number Diff line
@@ -625,23 +625,10 @@ extern struct paravirt_patch_site __start_parainstructions[],
 *
 * See entry_{32,64}.S for more details.
 */

/*
 * We define the int3_magic() function in assembly to control the calling
 * convention such that we can 'call' it from assembly.
 */

extern void int3_magic(unsigned int *ptr); /* defined in asm */

asm (
"	.pushsection	.init.text, \"ax\", @progbits\n"
"	.type		int3_magic, @function\n"
"int3_magic:\n"
"	movl	$1, (%" _ASM_ARG1 ")\n"
"	ret\n"
"	.size		int3_magic, .-int3_magic\n"
"	.popsection\n"
);
static void __init __no_sanitize_address notrace int3_magic(unsigned int *ptr)
{
	*ptr = 1;
}

extern __initdata unsigned long int3_selftest_ip; /* defined in asm below */