One more unlock missing in error case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch is needed to in addition to the other unlocking fix which is
already applied.  It should be obvious that the system will deadlock in
case this isn't done.

(Andrew, I once again used a goto in the third error case because the
common code is again larger.)

Signed-Off-By: Ulrich Drepper <[email protected]>

--- fs/namei.c	2006-02-01 09:29:49.000000000 -0800
+++ fs/namei.c-new	2006-02-04 09:18:02.000000000 -0800
@@ -1096,6 +1096,7 @@

 		file = fget_light(dfd, &fput_needed);
 		if (!file) {
+			read_unlock(&current->fs->lock);
 			retval = -EBADF;
 			goto out_fail;
 		}
@@ -1104,15 +1105,15 @@

 		if (!S_ISDIR(dentry->d_inode->i_mode)) {
 			retval = -ENOTDIR;
+		unlock_fail:
 			fput_light(file, fput_needed);
+			read_unlock(&current->fs->lock);
 			goto out_fail;
 		}

 		retval = file_permission(file, MAY_EXEC);
-		if (retval) {
-			fput_light(file, fput_needed);
-			goto out_fail;
-		}
+		if (retval)
+			goto unlock_fail;

 		nd->mnt = mntget(file->f_vfsmnt);
 		nd->dentry = dget(dentry);


-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux