diff -NurpP linux-2.6.37-vs2.3.0.37-rc1/include/linux/cred.h linux-2.6.37-vs2.3.0.37-rc1.1/include/linux/cred.h --- linux-2.6.37-vs2.3.0.37-rc1/include/linux/cred.h 2011-01-05 22:46:34.000000000 +0100 +++ linux-2.6.37-vs2.3.0.37-rc1.1/include/linux/cred.h 2011-01-07 21:21:10.000000000 +0100 @@ -208,31 +208,6 @@ static inline void validate_process_cred } #endif -static inline void set_cred_subscribers(struct cred *cred, int n) -{ -#ifdef CONFIG_DEBUG_CREDENTIALS - atomic_set(&cred->subscribers, n); -#endif -} - -static inline int read_cred_subscribers(const struct cred *cred) -{ -#ifdef CONFIG_DEBUG_CREDENTIALS - return atomic_read(&cred->subscribers); -#else - return 0; -#endif -} - -static inline void alter_cred_subscribers(const struct cred *_cred, int n) -{ -#ifdef CONFIG_DEBUG_CREDENTIALS - struct cred *cred = (struct cred *) _cred; - - atomic_add(n, &cred->subscribers); -#endif -} - /** * get_new_cred - Get a reference on a new set of credentials * @cred: The new credentials to reference diff -NurpP linux-2.6.37-vs2.3.0.37-rc1/include/linux/vserver/context.h linux-2.6.37-vs2.3.0.37-rc1.1/include/linux/vserver/context.h --- linux-2.6.37-vs2.3.0.37-rc1/include/linux/vserver/context.h 2011-01-05 22:46:44.000000000 +0100 +++ linux-2.6.37-vs2.3.0.37-rc1.1/include/linux/vserver/context.h 2011-01-07 21:23:03.000000000 +0100 @@ -99,8 +99,6 @@ struct _vx_info_pc { unsigned long vx_nsmask; /* assignment mask */ struct nsproxy *vx_nsproxy; /* private namespaces */ struct fs_struct *vx_fs; /* private namespace fs */ - const struct cred *vx_real_cred; /* real task credentials */ - const struct cred *vx_cred; /* task credentials */ }; struct vx_info { diff -NurpP linux-2.6.37-vs2.3.0.37-rc1/kernel/cred.c linux-2.6.37-vs2.3.0.37-rc1.1/kernel/cred.c --- linux-2.6.37-vs2.3.0.37-rc1/kernel/cred.c 2011-01-05 22:46:34.000000000 +0100 +++ linux-2.6.37-vs2.3.0.37-rc1.1/kernel/cred.c 2011-01-07 21:21:10.000000000 +0100 @@ -60,6 +60,31 @@ struct cred init_cred = { #endif }; +static inline void set_cred_subscribers(struct cred *cred, int n) +{ +#ifdef CONFIG_DEBUG_CREDENTIALS + atomic_set(&cred->subscribers, n); +#endif +} + +static inline int read_cred_subscribers(const struct cred *cred) +{ +#ifdef CONFIG_DEBUG_CREDENTIALS + return atomic_read(&cred->subscribers); +#else + return 0; +#endif +} + +static inline void alter_cred_subscribers(const struct cred *_cred, int n) +{ +#ifdef CONFIG_DEBUG_CREDENTIALS + struct cred *cred = (struct cred *) _cred; + + atomic_add(n, &cred->subscribers); +#endif +} + /* * Dispose of the shared task group credentials */ diff -NurpP linux-2.6.37-vs2.3.0.37-rc1/kernel/vserver/context.c linux-2.6.37-vs2.3.0.37-rc1.1/kernel/vserver/context.c --- linux-2.6.37-vs2.3.0.37-rc1/kernel/vserver/context.c 2011-01-05 22:46:44.000000000 +0100 +++ linux-2.6.37-vs2.3.0.37-rc1.1/kernel/vserver/context.c 2011-01-07 21:23:03.000000000 +0100 @@ -22,7 +22,6 @@ * V0.15 added context stat * V0.16 have __create claim() the vxi * V0.17 removed older and legacy stuff - * V0.18 added user credentials * */ @@ -39,7 +38,6 @@ #include #include #include -#include #include #include @@ -121,9 +119,6 @@ static struct vx_info *__alloc_vx_info(x spin_unlock(&init_fs.lock); space->vx_fs = &init_fs; - /* FIXME: do we want defaults? */ - space->vx_real_cred = 0; - space->vx_cred = 0; new->vx_fs[index] = &init_fs; } @@ -193,7 +187,6 @@ static void __shutdown_vx_info(struct vx { struct nsproxy *nsproxy; struct fs_struct *fs; - const struct cred *cred; int index, kill; might_sleep(); @@ -202,17 +195,6 @@ static void __shutdown_vx_info(struct vx free_fs_struct(fs); } - cred = xchg(&space->vx_real_cred, NULL); - if (cred) { - alter_cred_subscribers(cred, -1); - put_cred(cred); - } - - cred = xchg(&space->vx_cred, NULL); - if (cred) { - alter_cred_subscribers(cred, -1); - put_cred(cred); - } } } @@ -246,8 +237,6 @@ void free_vx_info(struct vx_info *vxi) BUG_ON(space->vx_nsproxy); BUG_ON(space->vx_fs); - BUG_ON(space->vx_real_cred); - BUG_ON(space->vx_cred); } spin_lock_irqsave(&vx_info_inactive_lock, flags); diff -NurpP linux-2.6.37-vs2.3.0.37-rc1/kernel/vserver/space.c linux-2.6.37-vs2.3.0.37-rc1.1/kernel/vserver/space.c --- linux-2.6.37-vs2.3.0.37-rc1/kernel/vserver/space.c 2011-01-05 22:46:44.000000000 +0100 +++ linux-2.6.37-vs2.3.0.37-rc1.1/kernel/vserver/space.c 2011-01-07 21:23:03.000000000 +0100 @@ -3,7 +3,6 @@ * V0.02 added task locking for namespace * V0.03 broken out vx_enter_namespace * V0.04 added *space support and commands - * V0.05 added credential support * */ @@ -17,7 +16,6 @@ #include #include #include -#include #include #include @@ -250,12 +242,4 @@ int vx_enter_space(struct vx_info *vxi, if (mask & CLONE_NEWUSER) { vxdprintk(VXD_CBIT(space, 10), - "vx_enter_space(%p[#%u],%p,%p) cred (%p,%p)", + "vx_enter_space(%p[#%u])", - vxi, vxi->vx_id, + vxi, vxi->vx_id); - current->real_cred, current->cred); - exit_creds(current); - current->real_cred = get_cred(space->vx_real_cred); - alter_cred_subscribers(current->real_cred, 1); - current->cred = get_cred(space->vx_cred); - alter_cred_subscribers(current->cred, 1); } @@ -337,7 +324,7 @@ int vx_set_space(struct vx_info *vxi, un alter_cred_subscribers(cred, 1); } else cred = NULL; - cred = xchg(&space->vx_real_cred, cred); if (cred) { alter_cred_subscribers(cred, -1); put_cred(cred); @@ -348,7 +335,7 @@ int vx_set_space(struct vx_info *vxi, un alter_cred_subscribers(cred, 1); } else cred = NULL; - cred = xchg(&space->vx_cred, cred); if (cred) { alter_cred_subscribers(cred, -1); put_cred(cred);