gen_syscall_header: use compiler barrier
We need to enforce that if the implementation function is inlined, and we are using a syscall declaration macro where a runtime check is performed, that all memory access in the inlined implementation function is done after the user context check is performed. Fixes bad memory access issues observed due to the compiler fetching member data from a kernel object when the calling context was in user mode. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
2574219d8b
commit
c5354552ce
1 changed files with 5 additions and 0 deletions
|
@ -95,6 +95,11 @@ def gen_defines_inner(ret, argc, kernel_only=False, user_only=False):
|
|||
sys.stdout.write("\t\t} else {")
|
||||
newline()
|
||||
|
||||
# Prevent memory access issues if the implementation function gets
|
||||
# inlined
|
||||
sys.stdout.write("\t\t\tcompiler_barrier();");
|
||||
newline()
|
||||
|
||||
sys.stdout.write("\t\t\t")
|
||||
gen_call_impl(ret, argc)
|
||||
sys.stdout.write("\t\t}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue