summaryrefslogtreecommitdiffstats
path: root/kernel/cred.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-06-24 10:11:27 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-06-24 10:11:27 +0200
commit25bc694a8a086bfee6e5b9dd9e53f4de721b0acf (patch)
treea843d17b336c9ea7d4cad67843ebbf255d61ea1f /kernel/cred.c
parent3e26c5feed2add218046ecf91bab3cfa9bf762a6 (diff)
parent000dd5316e1c756a1c028f22e01d06a38249dd4d (diff)
downloadlinux-25bc694a8a086bfee6e5b9dd9e53f4de721b0acf.tar.bz2
Merge back PCI power management material for v5.3.
Diffstat (limited to 'kernel/cred.c')
-rw-r--r--kernel/cred.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/cred.c b/kernel/cred.c
index e74ffdc98a92..c73a87a4df13 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -446,6 +446,15 @@ int commit_creds(struct cred *new)
if (task->mm)
set_dumpable(task->mm, suid_dumpable);
task->pdeath_signal = 0;
+ /*
+ * If a task drops privileges and becomes nondumpable,
+ * the dumpability change must become visible before
+ * the credential change; otherwise, a __ptrace_may_access()
+ * racing with this change may be able to attach to a task it
+ * shouldn't be able to attach to (as if the task had dropped
+ * privileges without becoming nondumpable).
+ * Pairs with a read barrier in __ptrace_may_access().
+ */
smp_wmb();
}