Skip to contentSkip to conversation

proc: Document why writing to /proc/pid/mem is a security hazard.

PATCH New Stephen Wilson 1 participant 1 message Mar 5, 2011 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proc: Document why writing to /proc/pid/mem is a security hazard.

---
 fs/proc/base.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
fs/proc/base.c +5 -1
index 9d096e8..9d55b7b 100644
@@ -832,7 +832,11 @@ out_no_task:
 #define mem_write NULL
 
 #ifndef mem_write
-/* This is a security hazard */
+/*
+ * As implemented, mem_write would be a security hazard if enabled.  For
+ * example, the target task could exec a setuid-root binary between the
+ * permission check and the write into memory.
+ */
 static ssize_t mem_write(struct file * file, const char __user *buf,
 			 size_t count, loff_t *ppos)
 {
Signature · 1 line
1.7.3.5