Thread (26 messages) 26 messages, 5 authors, 2021-03-17
STALE1935d REVIEWED: 1 (0M)
Revisions (20)
  1. v9 [diff vs current]
  2. v12 [diff vs current]
  3. v13 [diff vs current]
  4. v14 [diff vs current]
  5. v15 [diff vs current]
  6. v16 [diff vs current]
  7. v17 [diff vs current]
  8. v18 [diff vs current]
  9. v19 [diff vs current]
  10. v20 [diff vs current]
  11. v21 [diff vs current]
  12. v22 [diff vs current]
  13. v23 current
  14. v24 [diff vs current]
  15. v25 [diff vs current]
  16. v26 [diff vs current]
  17. v27 [diff vs current]
  18. v28 [diff vs current]
  19. v29 [diff vs current]
  20. v30 [diff vs current]

[PATCH v23 4/9] x86/cet/ibt: Update ELF header parsing for Indirect Branch Tracking

From: Yu-cheng Yu <hidden>
Date: 2021-03-16 15:18:23
Also in: linux-arch, linux-doc, linux-mm, lkml
Subsystem: the rest, x86 architecture (32-bit and 64-bit) · Maintainers: Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen

An ELF file's .note.gnu.property indicates features the file supports.
The property is parsed at loading time and passed to arch_setup_elf_
property().  Update it for Indirect Branch Tracking.

Signed-off-by: Yu-cheng Yu <redacted>
Reviewed-by: Kees Cook <redacted>
---
 arch/x86/kernel/process_64.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index cda830b0f7ee..11497689a841 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -864,6 +864,14 @@ int arch_setup_elf_property(struct arch_elf_state *state)
 			r = cet_setup_shstk();
 	}
 
+	if (r < 0)
+		return r;
+
+	if (static_cpu_has(X86_FEATURE_IBT)) {
+		if (state->gnu_property & GNU_PROPERTY_X86_FEATURE_1_IBT)
+			r = cet_setup_ibt();
+	}
+
 	return r;
 }
 #endif
-- 
2.21.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help