sukadev@xxxxxxxxxx wrote: > From: Sukadev Bhattiprolu <sukadev@xxxxxxxxxx> > Subject: [PATCH 6/7]: Check for user-space mount of /dev/pts > > When the pts namespace is cloned, the /dev/pts is not useful unless it > is remounted from the user space. > > If user-space clones pts namespace but does not remount /dev/pts, it > would end up using the /dev/pts mount from parent-pts-ns but allocate > the pts indices from current pts ns. > > This patch (hack ?) prevents creation of PTYs in user space unless > user-space mounts /dev/pts. > > (While this patch can be folded into others, keeping this separate > for now for easier review (and to highlight the hack :-) > > Signed-off-by: Sukadev Bhattiprolu <sukadev@xxxxxxxxxx> > --- > fs/devpts/inode.c | 25 +++++++++++++++++++++++-- > include/linux/devpts_fs.h | 20 +++++++++++++++++++- > 2 files changed, 42 insertions(+), 3 deletions(-) > > Index: 2.6.25-rc5-mm1/include/linux/devpts_fs.h > =================================================================== [snip] > =================================================================== > --- 2.6.25-rc5-mm1.orig/fs/devpts/inode.c 2008-03-24 20:08:33.000000000 -0700 > +++ 2.6.25-rc5-mm1/fs/devpts/inode.c 2008-03-24 20:08:57.000000000 -0700 > @@ -201,8 +201,11 @@ static int devpts_get_sb(struct file_sys > if (IS_ERR(sb)) > return PTR_ERR(sb); > > - if (sb->s_root) > + if (sb->s_root) { > + if (!(flags & MS_KERNMOUNT)) > + ns->user_mounted = 1; What if user space umounts this back? Won't this break? Thanks, Pavel _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers