lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20070924200357.1FAD17C2@kernel>
Date:	Mon, 24 Sep 2007 13:03:57 -0700
From:	Dave Hansen <haveblue@...ibm.com>
To:	akpm@...l.org
Cc:	linux-kernel@...r.kernel.org, mbligh@...igh.org,
	Dave Hansen <haveblue@...ibm.com>
Subject: [PATCH] ext2 reservations: fix for r/o bind mounts: take-writer-count


This is on top of the ext2-reservations.patch in -mm.

The original r/o bind mount set didn't address the new
ext2 ioctl: EXT2_IOC_SETRSVSZ, because it doesn't exist
in mainline.  This fixes that up for -mm.  

Signed-off-by: Dave Hansen <haveblue@...ibm.com>
---

 lxc-dave/fs/ext2/ioctl.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff -puN fs/ext2/ioctl.c~ext2-reservations-take-writer-count fs/ext2/ioctl.c
--- lxc/fs/ext2/ioctl.c~ext2-reservations-take-writer-count	2007-09-24 11:00:18.000000000 -0700
+++ lxc-dave/fs/ext2/ioctl.c	2007-09-24 11:07:08.000000000 -0700
@@ -107,18 +107,21 @@ setflags_out:
 		}
 		return -ENOTTY;
 	case EXT2_IOC_SETRSVSZ: {
-
+		int ret;
 		if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
 			return -ENOTTY;
 
-		if (IS_RDONLY(inode))
-			return -EROFS;
+		ret = mnt_want_write(filp->f_vfsmnt);
+		if (ret)
+			return ret;
 
+		ret = -EACCES;
 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
-			return -EACCES;
+			goto setrsvsz_out;
 
+		ret = -EFAULT;
 		if (get_user(rsv_window_size, (int __user *)arg))
-			return -EFAULT;
+			goto setrsvsz_out;
 
 		if (rsv_window_size > EXT2_MAX_RESERVE_BLOCKS)
 			rsv_window_size = EXT2_MAX_RESERVE_BLOCKS;
@@ -140,7 +143,9 @@ setflags_out:
 			rsv->rsv_goal_size = rsv_window_size;
 		}
 		mutex_unlock(&ei->truncate_mutex);
-		return 0;
+	setrsvsz_out:
+		mnt_drop_write(filp->f_vfsmnt);
+		return ret;
 	}
 	default:
 		return -ENOTTY;
diff -puN fs/namespace.c~ext2-reservations-take-writer-count fs/namespace.c
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ