Commit fa883d6a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-2020-03-07' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux

Pull thread fixes from Christian Brauner:
 "Here are a few hopefully uncontroversial fixes:

   - Use RCU_INIT_POINTER() when initializing rcu protected members in
     task_struct to fix sparse warnings.

   - Add pidfd_fdinfo_test binary to .gitignore file"

* tag 'for-linus-2020-03-07' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux:
  selftests: pidfd: Add pidfd_fdinfo_test in .gitignore
  exit: Fix Sparse errors and warnings
  fork: Use RCU_INIT_POINTER() instead of rcu_access_pointer()
parents 676fc8de 186e28a1
...@@ -619,8 +619,8 @@ static void forget_original_parent(struct task_struct *father, ...@@ -619,8 +619,8 @@ static void forget_original_parent(struct task_struct *father,
reaper = find_new_reaper(father, reaper); reaper = find_new_reaper(father, reaper);
list_for_each_entry(p, &father->children, sibling) { list_for_each_entry(p, &father->children, sibling) {
for_each_thread(p, t) { for_each_thread(p, t) {
t->real_parent = reaper; RCU_INIT_POINTER(t->real_parent, reaper);
BUG_ON((!t->ptrace) != (t->parent == father)); BUG_ON((!t->ptrace) != (rcu_access_pointer(t->parent) == father));
if (likely(!t->ptrace)) if (likely(!t->ptrace))
t->parent = t->real_parent; t->parent = t->real_parent;
if (t->pdeath_signal) if (t->pdeath_signal)
......
...@@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk) ...@@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
return 0; return 0;
} }
sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL); sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL);
rcu_assign_pointer(tsk->sighand, sig); RCU_INIT_POINTER(tsk->sighand, sig);
if (!sig) if (!sig)
return -ENOMEM; return -ENOMEM;
......
...@@ -2,4 +2,5 @@ pidfd_open_test ...@@ -2,4 +2,5 @@ pidfd_open_test
pidfd_poll_test pidfd_poll_test
pidfd_test pidfd_test
pidfd_wait pidfd_wait
pidfd_fdinfo_test
pidfd_getfd_test pidfd_getfd_test
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment