Skip to contentSkip to conversation

procfs: missing rcu unlock in proc_reg_release

PATCH New Sasha Levin 1 participant 1 message Mar 5, 2013 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 procfs: missing rcu unlock in proc_reg_release

Commit "procfs: improve scaling in proc" forgot to unlock rcu read lock if the proc file didn't have ops struct.

---
 fs/proc/inode.c | 1 +
 1 file changed, 1 insertion(+)
fs/proc/inode.c +1 -0
index 6cccc4d..d9292ac 100644
@@ -400,6 +400,7 @@ static int proc_reg_release(struct inode *inode, struct file *file)
 	rcu_read_lock();
 	fops = rcu_dereference(pde->proc_fops);
 	if (!fops) {
+		rcu_read_unlock();
 		/*
 		 * Can't simply exit, __fput() will think that everything is OK,
 		 * and move on to freeing struct file. remove_proc_entry() will
Signature · 1 line
1.8.1.4