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: <1277743282.31267.112.camel@sakura.staff.proxad.net>
Date:	Mon, 28 Jun 2010 18:41:22 +0200
From:	Maxime Bizon <mbizon@...ebox.fr>
To:	viro@...iv.linux.org.uk
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] fs: make sure do_change_type() gets a valid type.


Hi,


Busybox mount does not support --make-shared, and -o shared is used
instead. This has the side effect that MS_SILENT can be passed too, and
that prevents do_change_type() from working.

This patch fixes this by computing type using only relevant bits.

Signed-off-by: Maxime Bizon <mbizon@...ebox.fr>
---
 fs/namespace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index f20cb57..5360463 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1456,7 +1456,7 @@ static int do_change_type(struct path *path, int flag)
 {
 	struct vfsmount *m, *mnt = path->mnt;
 	int recurse = flag & MS_REC;
-	int type = flag & ~MS_REC;
+	int type = flag & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE);
 	int err = 0;
 
 	if (!capable(CAP_SYS_ADMIN))
-- 
1.7.1



-- 
Maxime


--
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