lkml.org 
[lkml]   [2010]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] fs: make sure do_change_type() gets a valid type.
From
Date

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@freebox.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




\
 
 \ /
  Last update: 2010-06-28 18:43    [W:0.067 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site