Skip to content
Snippets Groups Projects
Commit e8c64bc6 authored by Robert Sesek's avatar Robert Sesek Committed by Iliyan Malchev
Browse files

seccomp: Use atomic operations that are present in kernel 3.4.


Signed-off-by: default avatarRobert Sesek <rsesek@google.com>
parent 6756f10b
Branches
Tags
No related merge requests found
...@@ -245,7 +245,7 @@ static inline void seccomp_assign_mode(struct task_struct *task, ...@@ -245,7 +245,7 @@ static inline void seccomp_assign_mode(struct task_struct *task,
* Make sure TIF_SECCOMP cannot be set before the mode (and * Make sure TIF_SECCOMP cannot be set before the mode (and
* filter) is set. * filter) is set.
*/ */
smp_mb__before_atomic(); smp_mb();
set_tsk_thread_flag(task, TIF_SECCOMP); set_tsk_thread_flag(task, TIF_SECCOMP);
} }
...@@ -335,8 +335,8 @@ static inline void seccomp_sync_threads(void) ...@@ -335,8 +335,8 @@ static inline void seccomp_sync_threads(void)
* allows a put before the assignment.) * allows a put before the assignment.)
*/ */
put_seccomp_filter(thread); put_seccomp_filter(thread);
smp_store_release(&thread->seccomp.filter, smp_mb();
caller->seccomp.filter); ACCESS_ONCE(thread->seccomp.filter) = caller->seccomp.filter;
/* /*
* Opt the other thread into seccomp if needed. * Opt the other thread into seccomp if needed.
* As threads are considered to be trust-realm * As threads are considered to be trust-realm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment