diff -NurpP --minimal linux-2.6.11.10-vs2.0-rc2/Makefile linux-2.6.11.10-vs2.0-rc3/Makefile --- linux-2.6.11.10-vs2.0-rc2/Makefile 2005-05-25 10:34:38 +0200 +++ linux-2.6.11.10-vs2.0-rc3/Makefile 2005-05-31 12:42:45 +0200 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 11 -EXTRAVERSION = .10-vs2.0-rc2 +EXTRAVERSION = .10-vs2.0-rc3 NAME=Woozy Beaver # *DOCUMENTATION* diff -NurpP --minimal linux-2.6.11.10-vs2.0-rc2/include/linux/vserver/debug.h linux-2.6.11.10-vs2.0-rc3/include/linux/vserver/debug.h --- linux-2.6.11.10-vs2.0-rc2/include/linux/vserver/debug.h 2005-05-25 10:06:32 +0200 +++ linux-2.6.11.10-vs2.0-rc3/include/linux/vserver/debug.h 2005-05-30 23:41:51 +0200 @@ -152,186 +152,85 @@ static inline void __vxh_copy_vxi(struct } } -static inline void vxh_throw_oops(void) -{ - struct _vx_hist_entry *entry; - - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - entry->type = VXH_THROW_OOPS; - preempt_enable(); - - /* prevent further acquisition */ - vxh_active = 0; -} - -static inline void vxh_get_vx_info(struct vx_info *vxi) -{ - struct _vx_hist_entry *entry; - - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->type = VXH_GET_VX_INFO; - preempt_enable(); -} - -static inline void vxh_put_vx_info(struct vx_info *vxi) -{ - struct _vx_hist_entry *entry; - - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->type = VXH_PUT_VX_INFO; - preempt_enable(); -} - -static inline void vxh_init_vx_info(struct vx_info *vxi, void *data) -{ - struct _vx_hist_entry *entry; - - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->sc.data = data; - entry->type = VXH_INIT_VX_INFO; - preempt_enable(); -} -static inline void vxh_set_vx_info(struct vx_info *vxi, void *data) -{ - struct _vx_hist_entry *entry; - - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->sc.data = data; - entry->type = VXH_SET_VX_INFO; - preempt_enable(); -} - -static inline void vxh_clr_vx_info(struct vx_info *vxi, void *data) -{ - struct _vx_hist_entry *entry; - - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->sc.data = data; - entry->type = VXH_CLR_VX_INFO; +#define __VXH_BODY(__type, __data) \ + struct _vx_hist_entry *entry; \ + \ + preempt_disable(); \ + entry = vxh_advance(VXH_HERE()); \ + __data; \ + entry->type = __type; \ preempt_enable(); -} -static inline void vxh_claim_vx_info(struct vx_info *vxi, void *data) -{ - struct _vx_hist_entry *entry; - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->sc.data = data; - entry->type = VXH_CLAIM_VX_INFO; - preempt_enable(); -} - -static inline void vxh_release_vx_info(struct vx_info *vxi, void *data) -{ - struct _vx_hist_entry *entry; + /* pass vxi only */ +#define __VXH_SIMPLE \ + __vxh_copy_vxi(entry, vxi) - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->sc.data = data; - entry->type = VXH_RELEASE_VX_INFO; - preempt_enable(); +#define VXH_SIMPLE(__name, __type) \ +static inline void __name(struct vx_info *vxi) \ +{ \ + __VXH_BODY(__type, __VXH_SIMPLE) \ } -static inline void vxh_alloc_vx_info(struct vx_info *vxi) -{ - struct _vx_hist_entry *entry; + /* pass vxi and data (void *) */ +#define __VXH_DATA \ + __vxh_copy_vxi(entry, vxi); \ + entry->sc.data = data - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->type = VXH_ALLOC_VX_INFO; - preempt_enable(); +#define VXH_DATA(__name, __type) \ +static inline \ +void __name(struct vx_info *vxi, void *data) \ +{ \ + __VXH_BODY(__type, __VXH_DATA) \ } -static inline void vxh_dealloc_vx_info(struct vx_info *vxi) -{ - struct _vx_hist_entry *entry; + /* pass vxi and arg (long) */ +#define __VXH_LARG \ + __vxh_copy_vxi(entry, vxi); \ + entry->ll.arg = arg - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->type = VXH_DEALLOC_VX_INFO; - preempt_enable(); +#define VXH_LARG(__name, __type) \ +static inline \ +void __name(struct vx_info *vxi, long arg) \ +{ \ + __VXH_BODY(__type, __VXH_LARG) \ } -static inline void vxh_hash_vx_info(struct vx_info *vxi) -{ - struct _vx_hist_entry *entry; - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->type = VXH_HASH_VX_INFO; - preempt_enable(); -} - -static inline void vxh_unhash_vx_info(struct vx_info *vxi) +static inline void vxh_throw_oops(void) { - struct _vx_hist_entry *entry; - - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->type = VXH_UNHASH_VX_INFO; - preempt_enable(); + __VXH_BODY(VXH_THROW_OOPS, {}); + /* prevent further acquisition */ + vxh_active = 0; } -static inline void vxh_loc_vx_info(unsigned arg, struct vx_info *vxi) -{ - struct _vx_hist_entry *entry; - - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->ll.arg = arg; - entry->type = VXH_LOC_VX_INFO; - preempt_enable(); -} +VXH_SIMPLE(vxh_get_vx_info, VXH_GET_VX_INFO); +VXH_SIMPLE(vxh_put_vx_info, VXH_PUT_VX_INFO); -static inline void vxh_lookup_vx_info(unsigned arg, struct vx_info *vxi) -{ - struct _vx_hist_entry *entry; +VXH_DATA(vxh_init_vx_info, VXH_INIT_VX_INFO); +VXH_DATA(vxh_set_vx_info, VXH_SET_VX_INFO); +VXH_DATA(vxh_clr_vx_info, VXH_CLR_VX_INFO); - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->ll.arg = arg; - entry->type = VXH_LOOKUP_VX_INFO; - preempt_enable(); -} +VXH_DATA(vxh_claim_vx_info, VXH_CLAIM_VX_INFO); +VXH_DATA(vxh_release_vx_info, VXH_RELEASE_VX_INFO); -static inline void vxh_create_vx_info(unsigned arg, struct vx_info *vxi) -{ - struct _vx_hist_entry *entry; +VXH_SIMPLE(vxh_alloc_vx_info, VXH_ALLOC_VX_INFO); +VXH_SIMPLE(vxh_dealloc_vx_info, VXH_DEALLOC_VX_INFO); - preempt_disable(); - entry = vxh_advance(VXH_HERE()); - __vxh_copy_vxi(entry, vxi); - entry->ll.arg = arg; - entry->type = VXH_CREATE_VX_INFO; - preempt_enable(); -} +VXH_SIMPLE(vxh_hash_vx_info, VXH_HASH_VX_INFO); +VXH_SIMPLE(vxh_unhash_vx_info, VXH_UNHASH_VX_INFO); +VXH_LARG(vxh_loc_vx_info, VXH_LOC_VX_INFO); +VXH_LARG(vxh_lookup_vx_info, VXH_LOOKUP_VX_INFO); +VXH_LARG(vxh_create_vx_info, VXH_CREATE_VX_INFO); extern void vxh_dump_history(void); + #else /* CONFIG_VSERVER_HISTORY */ + #define vxh_throw_oops() do { } while (0) #define vxh_get_vx_info(v) do { } while (0) diff -NurpP --minimal linux-2.6.11.10-vs2.0-rc2/kernel/vserver/Kconfig linux-2.6.11.10-vs2.0-rc3/kernel/vserver/Kconfig --- linux-2.6.11.10-vs2.0-rc2/kernel/vserver/Kconfig 2005-05-22 06:58:25 +0200 +++ linux-2.6.11.10-vs2.0-rc3/kernel/vserver/Kconfig 2005-05-27 09:57:34 +0200 @@ -31,8 +31,9 @@ config VSERVER_NGNET depends on EXPERIMENTAL default n help - This disables the legacy networking API, which allows - to configure per vserver IPs as we know it. + This disables the legacy networking API which is required + by the chbind tool. Do not disable it unless you exactly + know what you are doing. config VSERVER_PROC_SECURE bool "Enable Proc Security" diff -NurpP --minimal linux-2.6.11.10-vs2.0-rc2/kernel/vserver/context.c linux-2.6.11.10-vs2.0-rc3/kernel/vserver/context.c --- linux-2.6.11.10-vs2.0-rc2/kernel/vserver/context.c 2005-05-25 10:13:43 +0200 +++ linux-2.6.11.10-vs2.0-rc3/kernel/vserver/context.c 2005-05-30 23:42:47 +0200 @@ -223,7 +223,7 @@ found: vxdprintk(VXD_CBIT(xid, 0), "__lookup_vx_info(#%u): %p[#%u]", xid, vxi, vxi?vxi->vx_id:0); - vxh_lookup_vx_info(xid, vxi); + vxh_lookup_vx_info(vxi, xid); return vxi; } @@ -307,7 +307,7 @@ static struct vx_info * __loc_vx_info(in out_unlock: spin_unlock(&vx_info_hash_lock); - vxh_loc_vx_info(id, vxi); + vxh_loc_vx_info(vxi, id); if (new) __dealloc_vx_info(new); return vxi; @@ -368,7 +368,7 @@ static struct vx_info * __create_vx_info out_unlock: spin_unlock(&vx_info_hash_lock); - vxh_create_vx_info(id, IS_ERR(vxi)?NULL:vxi); + vxh_create_vx_info(IS_ERR(vxi)?NULL:vxi, id); if (new) __dealloc_vx_info(new); return vxi; diff -NurpP --minimal linux-2.6.11.10-vs2.0-rc2/kernel/vserver/signal.c linux-2.6.11.10-vs2.0-rc3/kernel/vserver/signal.c --- linux-2.6.11.10-vs2.0-rc2/kernel/vserver/signal.c 2005-05-25 00:30:33 +0200 +++ linux-2.6.11.10-vs2.0-rc3/kernel/vserver/signal.c 2005-05-30 22:57:58 +0200 @@ -23,21 +23,15 @@ int vc_ctx_kill(uint32_t id, void __user { int retval, count=0; struct vcmd_ctx_kill_v0 vc_data; - struct siginfo info; struct task_struct *p; struct vx_info *vxi; + unsigned long priv = 0; if (!vx_check(0, VX_ADMIN)) return -ENOSYS; if (copy_from_user (&vc_data, data, sizeof(vc_data))) return -EFAULT; - info.si_signo = vc_data.sig; - info.si_errno = 0; - info.si_code = SI_USER; - info.si_pid = current->pid; - info.si_uid = current->uid; - vxi = locate_vx_info(id); if (!vxi) return -ESRCH; @@ -46,17 +40,16 @@ int vc_ctx_kill(uint32_t id, void __user read_lock(&tasklist_lock); switch (vc_data.pid) { case 0: - info.si_code = SI_KERNEL; + priv = 1; case -1: for_each_process(p) { int err = 0; if (vx_task_xid(p) != id || p->pid <= 1 || - (vc_data.pid && vxi->vx_initpid == p->pid) || - !thread_group_leader(p)) + (vc_data.pid && vxi->vx_initpid == p->pid)) continue; - err = send_sig_info(vc_data.sig, &info, p); + err = group_send_sig_info(vc_data.sig, (void*)priv, p); ++count; if (err != -EPERM) retval = err; @@ -66,21 +59,15 @@ int vc_ctx_kill(uint32_t id, void __user case 1: if (vxi->vx_initpid) { vc_data.pid = vxi->vx_initpid; - info.si_code = SI_KERNEL; + priv = 1; } /* fallthrough */ default: p = find_task_by_real_pid(vc_data.pid); if (p) { - if (!thread_group_leader(p)) { - struct task_struct *tg; - - tg = find_task_by_real_pid(p->tgid); - if (tg) - p = tg; - } if ((id == -1) || (vx_task_xid(p) == id)) - retval = send_sig_info(vc_data.sig, &info, p); + retval = group_send_sig_info(vc_data.sig, + (void*)priv, p); } break; }