Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
f66d6ac
Documentation
LICENSES
arch
alpha
arc
arm
arm64
csky
hexagon
loongarch
m68k
microblaze
mips
nios2
openrisc
parisc
powerpc
riscv
s390
sh
sparc
um
x86
boot
coco
configs
crypto
entry
syscalls
vdso
vsyscall
Makefile
calling.h
common.c
entry.S
entry_32.S
entry_64.S
entry_64_compat.S
entry_64_fred.S
entry_fred.c
syscall_32.c
syscall_64.c
syscall_x32.c
thunk.S
events
hyperv
ia32
include
kernel
kvm
lib
math-emu
mm
net
pci
platform
power
purgatory
ras
realmode
tools
um
video
virt
xen
.gitignore
Kbuild
Kconfig
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile
Makefile.postlink
Makefile.um
Makefile_32.cpu
xtensa
.gitignore
Kconfig
block
certs
crypto
drivers
fs
include
init
io_uring
ipc
kernel
lib
mm
net
rust
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
arch
/
x86
/
entry
/
entry.S
Copy path
Blame
Blame
Latest commit
Ard Biesheuvel
and
Borislav Petkov (AMD)
x86/stackprotector: Work around strict Clang TLS symbol requirements
Nov 8, 2024
577c134
·
Nov 8, 2024
History
History
69 lines (58 loc) · 1.83 KB
Breadcrumbs
linux
/
arch
/
x86
/
entry
/
entry.S
Top
File metadata and controls
Code
Blame
69 lines (58 loc) · 1.83 KB
Raw
/* SPDX-License-Identifier: GPL-2.0 */ /* * Common place for both 32- and 64-bit entry routines. */ #include <linux/export.h> #include <linux/linkage.h> #include <asm/msr-index.h> #include <asm/unwind_hints.h> #include <asm/segment.h> #include <asm/cache.h> #include <asm/cpufeatures.h> #include <asm/nospec-branch.h> #include "calling.h" .pushsection .noinstr.text, "ax" SYM_FUNC_START(entry_ibpb) movl $MSR_IA32_PRED_CMD, %ecx movl $PRED_CMD_IBPB, %eax xorl %edx, %edx wrmsr /* Make sure IBPB clears return stack preductions too. */ FILL_RETURN_BUFFER %rax, RSB_CLEAR_LOOPS, X86_BUG_IBPB_NO_RET RET SYM_FUNC_END(entry_ibpb) /* For KVM */ EXPORT_SYMBOL_GPL(entry_ibpb); .popsection /* * Define the VERW operand that is disguised as entry code so that * it can be referenced with KPTI enabled. This ensure VERW can be * used late in exit-to-user path after page tables are switched. */ .pushsection .entry.text, "ax" .align L1_CACHE_BYTES, 0xcc SYM_CODE_START_NOALIGN(mds_verw_sel) UNWIND_HINT_UNDEFINED ANNOTATE_NOENDBR .word __KERNEL_DS .align L1_CACHE_BYTES, 0xcc SYM_CODE_END(mds_verw_sel); /* For KVM */ EXPORT_SYMBOL_GPL(mds_verw_sel); .popsection THUNK warn_thunk_thunk, __warn_thunk #ifndef CONFIG_X86_64 /* * Clang's implementation of TLS stack cookies requires the variable in * question to be a TLS variable. If the variable happens to be defined as an * ordinary variable with external linkage in the same compilation unit (which * amounts to the whole of vmlinux with LTO enabled), Clang will drop the * segment register prefix from the references, resulting in broken code. Work * around this by avoiding the symbol used in -mstack-protector-guard-symbol= * entirely in the C code, and use an alias emitted by the linker script * instead. */ #ifdef CONFIG_STACKPROTECTOR EXPORT_SYMBOL(__ref_stack_chk_guard); #endif #endif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
You can’t perform that action at this time.