]> Git Repo - linux.git/commitdiff
Merge tag 'timers-urgent-2021-11-14' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <[email protected]>
Sun, 14 Nov 2021 18:43:38 +0000 (10:43 -0800)
committerLinus Torvalds <[email protected]>
Sun, 14 Nov 2021 18:43:38 +0000 (10:43 -0800)
Pull timer fix from Thomas Gleixner:
 "A single fix for POSIX CPU timers to address a problem where POSIX CPU
  timer delivery stops working for a new child task because
  copy_process() copies state information which is only valid for the
  parent task"

* tag 'timers-urgent-2021-11-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  posix-cpu-timers: Clear task::posix_cputimers_work in copy_process()

1  2 
kernel/fork.c

diff --combined kernel/fork.c
index 5de23f3e08bfb3f950c98be428695f35b3e3384d,8269ae2e5d7c510ccdccc761e8f5fd65066263d5..3244cc56b697d7e3a5b3a87d1ed580fb64db1954
@@@ -1043,6 -1043,7 +1043,6 @@@ static struct mm_struct *mm_init(struc
        seqcount_init(&mm->write_protect_seq);
        mmap_init_lock(mm);
        INIT_LIST_HEAD(&mm->mmlist);
 -      mm->core_state = NULL;
        mm_pgtables_bytes_init(mm);
        mm->map_count = 0;
        mm->locked_vm = 0;
@@@ -1390,7 -1391,8 +1390,7 @@@ static void mm_release(struct task_stru
         * purposes.
         */
        if (tsk->clear_child_tid) {
 -              if (!(tsk->signal->flags & SIGNAL_GROUP_COREDUMP) &&
 -                  atomic_read(&mm->mm_users) > 1) {
 +              if (atomic_read(&mm->mm_users) > 1) {
                        /*
                         * We don't check the error code - if userspace has
                         * not set up a proper pointer then tough luck.
@@@ -2277,6 -2279,7 +2277,7 @@@ static __latent_entropy struct task_str
        p->pdeath_signal = 0;
        INIT_LIST_HEAD(&p->thread_group);
        p->task_works = NULL;
+       clear_posix_cputimers_work(p);
  
  #ifdef CONFIG_KRETPROBES
        p->kretprobe_instances.first = NULL;
@@@ -3024,7 -3027,7 +3025,7 @@@ int unshare_fd(unsigned long unshare_fl
  int ksys_unshare(unsigned long unshare_flags)
  {
        struct fs_struct *fs, *new_fs = NULL;
 -      struct files_struct *fd, *new_fd = NULL;
 +      struct files_struct *new_fd = NULL;
        struct cred *new_cred = NULL;
        struct nsproxy *new_nsproxy = NULL;
        int do_sysvsem = 0;
                        spin_unlock(&fs->lock);
                }
  
 -              if (new_fd) {
 -                      fd = current->files;
 -                      current->files = new_fd;
 -                      new_fd = fd;
 -              }
 +              if (new_fd)
 +                      swap(current->files, new_fd);
  
                task_unlock(current);
  
This page took 0.070801 seconds and 4 git commands to generate.