About this list Date view Thread view Subject view Author view Attachment view

From: Herbert Pötzl (herbert_at_13thfloor.at)
Date: Wed 13 Aug 2003 - 23:32:20 BST


On Tue, Aug 12, 2003 at 04:08:21PM +0300, Girts wrote:
> Hi!
>
> I'm sorry if it is already fixed and I have missed it, but I am allowed
> to see more that I should be.
>
> Running under vserver:
> # cat /proc/mounts
> rootfs / rootfs rw 0 0
> /dev/root / ext3 rw 0 0
> proc /proc proc rw 0 0
> devpts /dev/pts devpts rw 0 0
> /dev/hda1 /boot ext2 rw 0 0
> ..
> none /var/lib/vservers/xxx/proc proc rw 0 0
> none /var/lib/vservers/xxx/dev/pts devpts rw 0 0
> none /var/lib/vservers/yyy/proc proc rw 0 0
> none /var/lib/vservers/yyy/dev/pts devpts rw 0 0
> none /proc proc rw 0 0
> none /dev/pts devpts rw 0 0
> none /var/lib/vservers/zzz/proc proc rw 0 0
> none /var/lib/vservers/zzz/dev/pts devpts rw 0 0
>
> But "df":
> Filesystem 1k-blocks Used Available Use% Mounted on
> /dev/hdv1 7550280 3247476 4302804 44% /
>
> And "mount":
> /dev/hdv1 on / type vfs (none)
> proc on /proc type proc (rw)
> devpts on /dev/pts type devpts (rw,gid=5,mode=620)
>
> Why does /proc/mounts show full info?

here are two possible quick-fixes (read hacks)
to change this behaviour ...

the first displays nothing at /proc/mounts, the
second, lets "/", "/proc" and "/dev/pts" leak through
from the physical server ... this is for the case
that any application will depend on such information
...

there is also a third possible quick-fix, I didn't
code yet, to present some fixed info like in mtab
but I do not see any reason to do so, if the other
approaches are sufficient ... pleas check them, and
report any findings to me ...

why not real virtualization? simple, because in current
ctx-world the context does not know which mounts would
belong to him, because there is no namespace abstraction ...

HTH,
Herbert

no /proc/mounts ...
------------------
diff -NurP --minimal linux-2.4.22-rc2-ctx17a/fs/namespace.c linux-2.4.22-rc2-ctx17a-proc/fs/namespace.c
--- linux-2.4.22-rc2-ctx17a/fs/namespace.c 2003-06-13 16:51:37.000000000 +0200
+++ linux-2.4.22-rc2-ctx17a-proc/fs/namespace.c 2003-08-14 00:16:20.000000000 +0200
@@ -220,6 +220,8 @@
                 return PTR_ERR(path);
         }
 
+ if (current->s_context > 1)
+ goto out;
         mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
         seq_putc(m, ' ');
         mangle(m, path);
@@ -238,6 +240,7 @@
         if (mnt->mnt_sb->s_op->show_options)
                 err = mnt->mnt_sb->s_op->show_options(m, mnt);
         seq_puts(m, " 0 0\n");
+out:
         return err;
 }
 
leaking through physical "/", "/proc", and "/dev/pts" ...
-----------------------
diff -NurP --minimal linux-2.4.22-rc2-ctx17a/fs/namespace.c linux-2.4.22-rc2-ctx17a-proc/fs/namespace.c
--- linux-2.4.22-rc2-ctx17a/fs/namespace.c 2003-06-13 16:51:37.000000000 +0200
+++ linux-2.4.22-rc2-ctx17a-proc/fs/namespace.c 2003-08-14 00:16:20.000000000 +0200
@@ -220,6 +220,16 @@
                 return PTR_ERR(path);
         }
 
+ if (current->s_context > 1) {
+ if (strcmp(path, "/") == 0)
+ goto show;
+ if (strcmp(path, "/proc") == 0)
+ goto show;
+ if (strcmp (path, "/dev/pts") == 0)
+ goto show;
+ goto out;
+ }
+show:
         mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
         seq_putc(m, ' ');
         mangle(m, path);
@@ -238,6 +248,7 @@
         if (mnt->mnt_sb->s_op->show_options)
                 err = mnt->mnt_sb->s_op->show_options(m, mnt);
         seq_puts(m, " 0 0\n");
+out:
         return err;
 }
 


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 13 Aug 2003 - 23:55:35 BST by hypermail 2.1.3