From 092240449ffb77ab81987c58c4aa7ba2694026b4 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 25 Apr 2023 04:10:21 +0000 Subject: [PATCH] Add missing endbr64 instructions as required. Verified as neccessary with a fully IBT userland operational.. --- lib/csu/amd64/md_init.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/csu/amd64/md_init.h b/lib/csu/amd64/md_init.h index 329c2d35950..948e7c928bb 100644 --- a/lib/csu/amd64/md_init.h +++ b/lib/csu/amd64/md_init.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md_init.h,v 1.9 2023/04/25 04:06:06 deraadt Exp $ */ +/* $OpenBSD: md_init.h,v 1.10 2023/04/25 04:10:21 deraadt Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -45,6 +45,7 @@ " .type " #entry_pt ",@function \n" \ " .align 16 \n" \ #entry_pt": \n" \ + " endbr64 \n" \ " subq $8,%rsp \n" \ " .previous") @@ -65,6 +66,7 @@ " .globl _start \n" \ "_start: \n" \ "__start: \n" \ + " endbr64 \n" \ " movq %rdx,%rcx \n" \ " movq (%rsp),%rdi \n" \ " leaq 16(%rsp,%rdi,8),%rdx \n" \ @@ -83,6 +85,7 @@ " .type __start,@function \n" \ "_start: \n" \ "__start: \n" \ + " endbr64 \n" \ " movq %rsp, %r12 \n" \ " subq $8, %rsp \n" \ " andq $~15, %rsp \n" \ @@ -108,6 +111,7 @@ " .type _dl_exit,@function \n" \ " .align 8 \n" \ "_dl_exit: \n" \ + " endbr64 \n" \ " movl $ " STR(SYS_exit) ", %eax \n" \ " syscall \n" \ " int3 \n" \ -- 2.20.1