diff -u ./drivers/base/class.c linux-2.6.16-026test006/drivers/base/class.c
--- ./drivers/base/class.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/drivers/base/class.c	2006-03-30 12:13:47.000000000 +0400
@@ -72,7 +72,7 @@
 };
 
 /* Hotplug events for classes go to the class_obj subsys */
-static decl_subsys(class, &ktype_class, NULL);
+decl_subsys(class, &ktype_class, NULL);
 
 #ifndef CONFIG_VE
 #define visible_class_subsys class_subsys
@@ -425,7 +425,7 @@
 	.uevent =	class_uevent,
 };
 
-static decl_subsys(class_obj, &ktype_class_device, &class_uevent_ops);
+decl_subsys(class_obj, &ktype_class_device, &class_uevent_ops);
 
 #ifndef CONFIG_VE
 #define visible_class_obj_subsys class_obj_subsys
diff -u ./fs/binfmt_elf.c linux-2.6.16-026test006/fs/binfmt_elf.c
--- ./fs/binfmt_elf.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/fs/binfmt_elf.c	2006-03-30 12:13:47.000000000 +0400
@@ -1022,8 +1022,13 @@
 	sys_close(elf_exec_fileno);
 out_free_fh:
 	if (files) {
-		put_files_struct(current->files);
+		struct files_struct *old;
+
+		old = current->files;
+		task_lock(current);
 		current->files = files;
+		task_unlock(current);
+		put_files_struct(old);
 	}
 out_free_ph:
 	kfree(elf_phdata);
diff -u ./fs/binfmt_misc.c linux-2.6.16-026test006/fs/binfmt_misc.c
--- ./fs/binfmt_misc.c	2006-03-20 18:42:06.000000000 +0300
+++ linux-2.6.16-026test006/fs/binfmt_misc.c	2006-03-30 12:13:46.000000000 +0400
@@ -216,8 +216,13 @@
 	bprm->interp_data = 0;
 _unshare:
 	if (files) {
-		put_files_struct(current->files);
+		struct files_struct *old;
+
+		old = current->files;
+		task_lock(current);
 		current->files = files;
+		task_unlock(current);
+		put_files_struct(old);
 	}
 	goto _ret;
 }
diff -u ./fs/devpts/inode.c linux-2.6.16-026test006/fs/devpts/inode.c
--- ./fs/devpts/inode.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/fs/devpts/inode.c	2006-03-30 12:13:47.000000000 +0400
@@ -117,7 +117,7 @@
 	return get_sb_single(fs_type, flags, data, devpts_fill_super);
 }
 
-static struct file_system_type devpts_fs_type = {
+struct file_system_type devpts_fs_type = {
 	.owner		= THIS_MODULE,
 	.name		= "devpts",
 	.get_sb		= devpts_get_sb,
diff -u ./fs/exec.c linux-2.6.16-026test006/fs/exec.c
--- ./fs/exec.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/fs/exec.c	2006-03-30 12:13:47.000000000 +0400
@@ -857,7 +857,7 @@
 {
 	char * name;
 	int i, ch, retval;
-	struct files_struct *files;
+	struct files_struct *files, *old;
 	char tcomm[sizeof(current->comm)];
 
 	/*
@@ -938,8 +938,11 @@
 	return 0;
 
 mmap_failed:
-	put_files_struct(current->files);
+	old = current->files;
+	task_lock(current);
 	current->files = files;
+	task_unlock(current);
+	put_files_struct(old);
 out:
 	return retval;
 }
diff -u ./fs/file_table.c linux-2.6.16-026test006/fs/file_table.c
--- ./fs/file_table.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/fs/file_table.c	2006-03-30 12:13:47.000000000 +0400
@@ -114,11 +114,12 @@
 
 	percpu_counter_inc(&nr_files);
 	memset(f, 0, sizeof(*f));
-	SET_VE_OWNER_FILP(f, get_ve(get_exec_env()));
 
 	if (ub_file_charge(f))
 		goto fail_ch;
 
+	SET_VE_OWNER_FILP(f, get_ve(get_exec_env()));
+
 	if (security_file_alloc(f))
 		goto fail_sec;
 
diff -u ./fs/proc/root.c linux-2.6.16-026test006/fs/proc/root.c
--- ./fs/proc/root.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/fs/proc/root.c	2006-03-30 12:13:47.000000000 +0400
@@ -35,7 +35,7 @@
 	return get_sb_single(fs_type, flags, data, proc_fill_super);
 }
 
-static struct file_system_type proc_fs_type = {
+struct file_system_type proc_fs_type = {
 	.name		= "proc",
 	.get_sb		= proc_get_sb,
 	.kill_sb	= kill_anon_super,
diff -u ./fs/sysfs/mount.c linux-2.6.16-026test006/fs/sysfs/mount.c
--- ./fs/sysfs/mount.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/fs/sysfs/mount.c	2006-03-30 12:13:47.000000000 +0400
@@ -76,7 +76,7 @@
 	return get_sb_single(fs_type, flags, data, sysfs_fill_super);
 }
 
-static struct file_system_type sysfs_fs_type = {
+struct file_system_type sysfs_fs_type = {
 	.name		= "sysfs",
 	.get_sb		= sysfs_get_sb,
 	.kill_sb	= kill_litter_super,
diff -u ./include/linux/mm.h linux-2.6.16-026test006/include/linux/mm.h
--- ./include/linux/mm.h	2006-03-20 18:42:06.000000000 +0300
+++ linux-2.6.16-026test006/include/linux/mm.h	2006-03-30 12:13:47.000000000 +0400
@@ -1035,7 +1035,6 @@
 #define FOLL_TOUCH	0x02	/* mark page accessed */
 #define FOLL_GET	0x04	/* do get_page on page */
 #define FOLL_ANON	0x08	/* give ZERO_PAGE if no pgtable */
-#define FOLL_KERN	0x10	/* lookup kernel page */
 
 #ifdef CONFIG_XEN
 typedef int (*pte_fn_t)(pte_t *pte, struct page *pte_page, unsigned long addr, 
diff -u ./include/ub/ub_mem.h linux-2.6.16-026test006/include/ub/ub_mem.h
--- ./include/ub/ub_mem.h	2006-03-20 18:42:06.000000000 +0300
+++ linux-2.6.16-026test006/include/ub/ub_mem.h	2006-03-30 12:13:46.000000000 +0400
@@ -72,7 +72,7 @@
 		memset(slab_ubcs(cachep, slabp), 0,			\
 				(cachep)->num * sizeof(void *));	\
 	} while (0)
-#define kmem_obj_memusage(o)	(kmem_cache_size(virt_to_cache(o)))
+#define kmem_obj_memusage(o)	(virt_to_cache(o)->objuse)
 #else
 #define ub_vmalloc(size) vmalloc(size)
 #define ub_vmalloc_node(size, node) vmalloc_node(size, node)
diff -u ./kernel/fork.c linux-2.6.16-026test006/kernel/fork.c
--- ./kernel/fork.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/kernel/fork.c	2006-03-30 12:13:47.000000000 +0400
@@ -752,7 +752,7 @@
 	free_fdset (new_fdt->open_fds, new_fdt->max_fdset);
 	free_fd_array(new_fdt->fd, new_fdt->max_fds);
 	kmem_cache_free(files_cachep, newf);
-	goto out;
+	return NULL;
 }
 
 static int copy_files(unsigned long clone_flags, struct task_struct * tsk)
diff -u ./kernel/sysctl.c linux-2.6.16-026test006/kernel/sysctl.c
--- ./kernel/sysctl.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/kernel/sysctl.c	2006-03-30 12:13:47.000000000 +0400
@@ -182,9 +182,9 @@
 
 static void register_proc_table(ctl_table *, struct proc_dir_entry *, void *);
 static void unregister_proc_table(ctl_table *, struct proc_dir_entry *);
+#endif
 
 extern struct new_utsname virt_utsname;
-#endif
 
 /* The default sysctl tables: */
 
diff -u ./kernel/ub/ub_mem.c linux-2.6.16-026test006/kernel/ub/ub_mem.c
--- ./kernel/ub/ub_mem.c	2006-03-20 18:42:06.000000000 +0300
+++ linux-2.6.16-026test006/kernel/ub/ub_mem.c	2006-03-30 12:13:46.000000000 +0400
@@ -359,9 +359,7 @@
 {
 	struct page *pg;
 
-	spin_lock(&init_mm.page_table_lock);
-	pg = follow_page(NULL, (unsigned long)obj, FOLL_KERN);
-	spin_unlock(&init_mm.page_table_lock);
+	pg = vmalloc_to_page(obj);
 	if (pg == NULL)
 		return NULL;
 
diff -u ./kernel/vecalls.c linux-2.6.16-026test006/kernel/vecalls.c
--- ./kernel/vecalls.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/kernel/vecalls.c	2006-03-30 12:13:47.000000000 +0400
@@ -377,6 +377,7 @@
 		(((perms->mask & access_mode) == access_mode) ? 0 : -EACCES) :
 		-ENODEV;
 }
+EXPORT_SYMBOL(real_get_device_perms_ve);
 
 int do_setdevperms(envid_t veid, unsigned type, dev_t dev, unsigned mask)
 {
@@ -2301,6 +2302,7 @@
 
 	module_put(THIS_MODULE);
 }
+EXPORT_SYMBOL(real_do_env_free);
 
 
 /**********************************************************************
diff -u ./kernel/veowner.c linux-2.6.16-026test006/kernel/veowner.c
--- ./kernel/veowner.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/kernel/veowner.c	2006-03-30 12:13:47.000000000 +0400
@@ -60,6 +60,7 @@
  * ------------------------------------------------------------------------
  */
 
+#ifdef CONFIG_PROC_FS
 static void proc_move(struct proc_dir_entry *ddir,
 		struct proc_dir_entry *sdir,
 		const char *name)
@@ -154,6 +155,7 @@
 {
 	ve0.proc_root = &ve0_proc_root;
 }
+#endif
 
 /*
  * ------------------------------------------------------------------------
@@ -294,7 +296,9 @@
 	read_unlock(&init_entry->fs->lock);
 
 	/* common prepares */
+#ifdef CONFIG_PROC_FS
 	prepare_proc();
+#endif
 	prepare_sysctl();
 	prepare_ipc();
 }
diff -u ./mm/memory.c linux-2.6.16-026test006/mm/memory.c
--- ./mm/memory.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/mm/memory.c	2006-03-30 12:13:47.000000000 +0400
@@ -932,9 +932,8 @@
 	pte_t *ptep, pte;
 	spinlock_t *ptl;
 	struct page *page;
-	struct mm_struct *mm;
+	struct mm_struct *mm = vma->vm_mm;
 
-	mm = (flags & FOLL_KERN ? &init_mm : vma->vm_mm);
 	page = follow_huge_addr(mm, address, flags & FOLL_WRITE);
 	if (!IS_ERR(page)) {
 		BUG_ON(flags & FOLL_GET);
@@ -942,10 +941,7 @@
 	}
 
 	page = NULL;
-	if (flags & FOLL_KERN)
-		pgd = pgd_offset_k(address);
-	else
-		pgd = pgd_offset(mm, address);
+	pgd = pgd_offset(mm, address);
 	if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
 		goto no_page_table;
 
@@ -963,9 +959,6 @@
 		goto out;
 	}
 
-	if (flags & FOLL_KERN)
-		goto kern;
-
 	ptep = pte_offset_map_lock(mm, pmd, address, &ptl);
 	if (!ptep)
 		goto out;
@@ -975,7 +968,6 @@
 		goto unlock;
 	if ((flags & FOLL_WRITE) && !pte_write(pte))
 		goto unlock;
-
 	page = vm_normal_page(vma, address, pte);
 	if (unlikely(!page))
 		goto unlock;
@@ -993,15 +985,6 @@
 out:
 	return page;
 
-kern:
-	ptep = pte_offset_map(pmd, address);
-	BUG_ON(!ptep);
-	pte = *ptep;
-	BUG_ON(!pte_present(pte));
-	page = pte_page(pte);
-	pte_unmap(ptep);
-	return page;
-
 no_page_table:
 	/*
 	 * When core dumping an enormous anonymous area that nobody
diff -u ./mm/shmem.c linux-2.6.16-026test006/mm/shmem.c
--- ./mm/shmem.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/mm/shmem.c	2006-03-30 12:13:47.000000000 +0400
@@ -2257,7 +2257,7 @@
 	return get_sb_nodev(fs_type, flags, data, shmem_fill_super);
 }
 
-static struct file_system_type tmpfs_fs_type = {
+struct file_system_type tmpfs_fs_type = {
 	.owner		= THIS_MODULE,
 	.name		= "tmpfs",
 	.get_sb		= shmem_get_sb,
diff -u ./net/core/net-sysfs.c linux-2.6.16-026test006/net/core/net-sysfs.c
--- ./net/core/net-sysfs.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/net/core/net-sysfs.c	2006-03-30 12:13:47.000000000 +0400
@@ -394,7 +394,7 @@
 	kfree((char *)dev - dev->padded);
 }
 
-static struct class net_class = {
+struct class net_class = {
 	.name = "net",
 	.release = netdev_release,
 	.class_dev_attrs = net_class_attributes,
diff -u ./net/ipv4/netfilter/ip_conntrack_standalone.c linux-2.6.16-026test006/net/ipv4/netfilter/ip_conntrack_standalone.c
--- ./net/ipv4/netfilter/ip_conntrack_standalone.c	2006-03-20 18:42:07.000000000 +0300
+++ linux-2.6.16-026test006/net/ipv4/netfilter/ip_conntrack_standalone.c	2006-03-30 12:13:47.000000000 +0400
@@ -60,6 +60,18 @@
 #endif
 DECLARE_PER_CPU(struct ip_conntrack_stat, ip_conntrack_stat);
 
+/* Prior to 2.6.15, we had a ip_conntrack_enable_ve0 param. */
+static int warn_set(const char *val, struct kernel_param *kp)
+{
+	printk(KERN_INFO KBUILD_MODNAME
+	       ": parameter ip_conntrack_enable_ve0 is obsoleted. In ovzkernel"
+	       " >= 2.6.15 connection tracking on hardware node is enabled by "
+	       "default, use ip_conntrack_disable_ve0=1 parameter to "
+	       "disable.\n");
+	return 0;
+}
+module_param_call(ip_conntrack_enable_ve0, warn_set, NULL, NULL, 0);
+
 static int kill_proto(struct ip_conntrack *i, void *data)
 {
 	return (i->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum == 
only in patch2:
unchanged:
--- linux-2.6.16.orig/include/asm-i386/thread_info.h	2006-03-30 12:04:07.000000000 +0400
+++ linux-2.6.16-026test006/include/asm-i386/thread_info.h	2006-03-30 12:13:46.000000000 +0400
@@ -101,13 +101,13 @@ register unsigned long current_stack_poi
 	({							\
 		struct thread_info *ret;			\
 								\
-		ret = kmalloc(THREAD_SIZE, GFP_KERNEL);		\
+		ret = kmalloc(THREAD_SIZE, GFP_KERNEL_UBC);	\
 		if (ret)					\
 			memset(ret, 0, THREAD_SIZE);		\
 		ret;						\
 	})
 #else
-#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
+#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL_UBC)
 #endif
 
 #define free_thread_info(info)	kfree(info)
only in patch2:
unchanged:
--- linux-2.6.16.orig/include/asm-x86_64/thread_info.h	2006-03-30 12:04:07.000000000 +0400
+++ linux-2.6.16-026test006/include/asm-x86_64/thread_info.h	2006-03-30 12:13:46.000000000 +0400
@@ -74,7 +74,7 @@ static inline struct thread_info *stack_
 
 /* thread information allocation */
 #define alloc_thread_info(tsk) \
-	((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER))
+	((struct thread_info *) __get_free_pages(GFP_KERNEL_UBC,THREAD_ORDER))
 #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
 
 #else /* !__ASSEMBLY__ */
only in patch2:
unchanged:
--- linux-2.6.16.orig/net/ipv6/route.c	2006-03-30 12:04:07.000000000 +0400
+++ linux-2.6.16-026test006/net/ipv6/route.c	2006-03-30 12:13:47.000000000 +0400
@@ -113,7 +113,6 @@ struct rt6_info ip6_null_entry = {
 		.dst = {
 			.__refcnt	= ATOMIC_INIT(1),
 			.__use		= 1,
-			.dev		= &loopback_dev,
 			.obsolete	= -1,
 			.error		= -ENETUNREACH,
 			.metrics	= { [RTAX_HOPLIMIT - 1] = 255, },
@@ -2121,6 +2120,7 @@ void __init ip6_route_init(void)
 #ifdef CONFIG_XFRM
 	xfrm6_init();
 #endif
+	ip6_null_entry.u.dst.dev = &loopback_dev;
 }
 
 void ip6_route_cleanup(void)
