|
@@ -85,7 +85,9 @@ static void __exit_signal(struct task_struct *tsk)
|
|
BUG_ON(!sig);
|
|
BUG_ON(!sig);
|
|
BUG_ON(!atomic_read(&sig->count));
|
|
BUG_ON(!atomic_read(&sig->count));
|
|
|
|
|
|
- sighand = rcu_dereference(tsk->sighand);
|
|
|
|
|
|
+ sighand = rcu_dereference_check(tsk->sighand,
|
|
|
|
+ rcu_read_lock_held() ||
|
|
|
|
+ lockdep_is_held(&tasklist_lock));
|
|
spin_lock(&sighand->siglock);
|
|
spin_lock(&sighand->siglock);
|
|
|
|
|
|
posix_cpu_timers_exit(tsk);
|
|
posix_cpu_timers_exit(tsk);
|
|
@@ -170,8 +172,10 @@ void release_task(struct task_struct * p)
|
|
repeat:
|
|
repeat:
|
|
tracehook_prepare_release_task(p);
|
|
tracehook_prepare_release_task(p);
|
|
/* don't need to get the RCU readlock here - the process is dead and
|
|
/* don't need to get the RCU readlock here - the process is dead and
|
|
- * can't be modifying its own credentials */
|
|
|
|
|
|
+ * can't be modifying its own credentials. But shut RCU-lockdep up */
|
|
|
|
+ rcu_read_lock();
|
|
atomic_dec(&__task_cred(p)->user->processes);
|
|
atomic_dec(&__task_cred(p)->user->processes);
|
|
|
|
+ rcu_read_unlock();
|
|
|
|
|
|
proc_flush_task(p);
|
|
proc_flush_task(p);
|
|
|
|
|
|
@@ -473,9 +477,11 @@ static void close_files(struct files_struct * files)
|
|
/*
|
|
/*
|
|
* It is safe to dereference the fd table without RCU or
|
|
* It is safe to dereference the fd table without RCU or
|
|
* ->file_lock because this is the last reference to the
|
|
* ->file_lock because this is the last reference to the
|
|
- * files structure.
|
|
|
|
|
|
+ * files structure. But use RCU to shut RCU-lockdep up.
|
|
*/
|
|
*/
|
|
|
|
+ rcu_read_lock();
|
|
fdt = files_fdtable(files);
|
|
fdt = files_fdtable(files);
|
|
|
|
+ rcu_read_unlock();
|
|
for (;;) {
|
|
for (;;) {
|
|
unsigned long set;
|
|
unsigned long set;
|
|
i = j * __NFDBITS;
|
|
i = j * __NFDBITS;
|
|
@@ -521,10 +527,12 @@ void put_files_struct(struct files_struct *files)
|
|
* at the end of the RCU grace period. Otherwise,
|
|
* at the end of the RCU grace period. Otherwise,
|
|
* you can free files immediately.
|
|
* you can free files immediately.
|
|
*/
|
|
*/
|
|
|
|
+ rcu_read_lock();
|
|
fdt = files_fdtable(files);
|
|
fdt = files_fdtable(files);
|
|
if (fdt != &files->fdtab)
|
|
if (fdt != &files->fdtab)
|
|
kmem_cache_free(files_cachep, files);
|
|
kmem_cache_free(files_cachep, files);
|
|
free_fdtable(fdt);
|
|
free_fdtable(fdt);
|
|
|
|
+ rcu_read_unlock();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|