Merge to VServer 1.9.1
authorMark Huang <mlhuang@cs.princeton.edu>
Thu, 3 Jun 2004 23:00:31 +0000 (23:00 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Thu, 3 Jun 2004 23:00:31 +0000 (23:00 +0000)
Makefile
fs/ext2/ioctl.c
fs/ext3/ioctl.c
fs/namespace.c
fs/proc/array.c
fs/reiserfs/ioctl.c
kernel/fork.c

index 8024701..2320102 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 6
-EXTRAVERSION = -1.406-vs1.9.0
+EXTRAVERSION = -1.406-vs1.9.1
 NAME=Zonked Quokka
 
 # *DOCUMENTATION*
index 945d22a..2520c2f 100644 (file)
@@ -49,7 +49,9 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                 *
                 * This test looks nicer. Thanks to Pauline Middelink
                 */
-               if ((flags ^ oldflags) & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) {
+               if ((oldflags & EXT2_IMMUTABLE_FL) ||
+                       ((flags ^ oldflags) &
+                       (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL))) {
                        if (!capable(CAP_LINUX_IMMUTABLE))
                                return -EPERM;
                }
index cac06b6..f4e2cb1 100644 (file)
@@ -59,7 +59,9 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                 *
                 * This test looks nicer. Thanks to Pauline Middelink
                 */
-               if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) {
+               if ((oldflags & EXT3_IMMUTABLE_FL) ||
+                       ((flags ^ oldflags) &
+                       (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL))) {
                        if (!capable(CAP_LINUX_IMMUTABLE))
                                return -EPERM;
                }
index d497b2d..4b66831 100644 (file)
@@ -755,7 +755,7 @@ static int do_add_mount(struct nameidata *nd, char *type, int flags,
                return -EINVAL;
 
        /* we need capabilities... */
-       if (!capable(CAP_SYS_ADMIN))
+       if (!capable(CAP_SYS_ADMIN) && !vx_ccaps(VXC_SECURE_MOUNT))
                return -EPERM;
 
        mnt = do_kern_mount(type, flags, name, data);
index ecce180..cc6666d 100644 (file)
@@ -304,7 +304,7 @@ int proc_pid_status(struct task_struct *task, char * buffer)
        vxi = task_get_vx_info(task);
        if (vxi) {
                buffer += sprintf (buffer,"ctxflags: %08llx\n"
-                       ,vxi->vx_flags);
+                       ,(unsigned long long)vxi->vx_flags);
                buffer += sprintf (buffer,"initpid: %d\n"
                        ,vxi->vx_initpid);
        } else {
@@ -325,8 +325,6 @@ int proc_pid_status(struct task_struct *task, char * buffer)
                *buffer++ = '\n';
                buffer += sprintf (buffer,"ipv4root_bcast: %08x\n"
                        ,nxi->v4_bcast);
-               buffer += sprintf (buffer,"ipv4root_refcnt: %d\n"
-                       ,atomic_read(&nxi->nx_refcount));
        } else {
                buffer += sprintf (buffer,"ipv4root: 0\n");
                buffer += sprintf (buffer,"ipv4root_bcast: 0\n");
index b1f32fc..21d7c83 100644 (file)
@@ -49,9 +49,9 @@ int reiserfs_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                        return -EFAULT;
 
                oldflags = REISERFS_I(inode) -> i_attrs;
-               if ( ( ( flags ^ oldflags) &
-                  ( REISERFS_IMMUTABLE_FL | REISERFS_IUNLINK_FL | REISERFS_APPEND_FL)) &&
-                    !capable( CAP_LINUX_IMMUTABLE ) )
+               if ( (oldflags & REISERFS_IMMUTABLE_FL) || ( ( (flags ^ oldflags) &
+                  (REISERFS_IMMUTABLE_FL | REISERFS_IUNLINK_FL | REISERFS_APPEND_FL)) &&
+                    !capable( CAP_LINUX_IMMUTABLE ) ) )
                        return -EPERM;
                        
                if( ( flags & REISERFS_NOTAIL_FL ) &&
index b20afcb..4fc613a 100644 (file)
@@ -80,6 +80,7 @@ static kmem_cache_t *task_struct_cachep;
 static void free_task(struct task_struct *tsk)
 {
        free_thread_info(tsk->thread_info);
+       vxdprintk("freeing up task %p\n", tsk);
        clr_vx_info(&tsk->vx_info);
        clr_nx_info(&tsk->nx_info);
        free_task_struct(tsk);
@@ -883,7 +884,6 @@ struct task_struct *copy_process(unsigned long clone_flags,
        int retval;
        struct task_struct *p = NULL;
        struct vx_info *vxi;
-       struct nx_info *nxi;
 
        if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
                return ERR_PTR(-EINVAL);
@@ -914,8 +914,10 @@ struct task_struct *copy_process(unsigned long clone_flags,
                goto fork_out;
        p->tux_info = NULL;
 
-       vxi = get_vx_info(current->vx_info);
-       nxi = get_nx_info(current->nx_info);
+       p->vx_info = NULL;
+       set_vx_info(&p->vx_info, current->vx_info);
+       p->nx_info = NULL;
+       set_nx_info(&p->nx_info, current->nx_info);
 
        /* check vserver memory */
        if (p->mm && !(clone_flags & CLONE_VM)) {
@@ -930,6 +932,7 @@ struct task_struct *copy_process(unsigned long clone_flags,
        }
 
        retval = -EAGAIN;
+       vxi = current->vx_info;
        if (vxi && (atomic_read(&vxi->limit.res[RLIMIT_NPROC])
                >= vxi->limit.rlim[RLIMIT_NPROC]))
                goto bad_fork_free;