SOURCES (LINUX_2_6): linux-2.6-grsec_full.patch - pldized

zbyniu zbyniu at pld-linux.org
Tue Apr 15 13:58:20 CEST 2008


Author: zbyniu                       Date: Tue Apr 15 11:58:20 2008 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- pldized

---- Files affected:
SOURCES:
   linux-2.6-grsec_full.patch (1.1.2.32 -> 1.1.2.33) 

---- Diffs:

================================================================
Index: SOURCES/linux-2.6-grsec_full.patch
diff -u SOURCES/linux-2.6-grsec_full.patch:1.1.2.32 SOURCES/linux-2.6-grsec_full.patch:1.1.2.33
--- SOURCES/linux-2.6-grsec_full.patch:1.1.2.32	Tue Apr 15 13:54:04 2008
+++ SOURCES/linux-2.6-grsec_full.patch	Tue Apr 15 13:58:14 2008
@@ -39,9 +39,9 @@
 --- linux-2.6.24.4/arch/alpha/kernel/ptrace.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/arch/alpha/kernel/ptrace.c	2008-03-26 20:21:07.000000000 -0400
 @@ -15,6 +15,7 @@
- #include <linux/slab.h>
  #include <linux/security.h>
  #include <linux/signal.h>
+ #include <linux/vs_base.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/uaccess.h>
@@ -436,9 +436,9 @@
 --- linux-2.6.24.4/arch/ia64/kernel/ptrace.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/arch/ia64/kernel/ptrace.c	2008-03-26 20:21:07.000000000 -0400
 @@ -17,6 +17,7 @@
- #include <linux/security.h>
  #include <linux/audit.h>
  #include <linux/signal.h>
+ #include <linux/vs_base.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/pgtable.h>
@@ -486,9 +486,9 @@
 --- linux-2.6.24.4/arch/ia64/mm/fault.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/arch/ia64/mm/fault.c	2008-03-26 20:21:07.000000000 -0400
 @@ -10,6 +10,7 @@
- #include <linux/interrupt.h>
  #include <linux/kprobes.h>
  #include <linux/kdebug.h>
+ #include <linux/vs_memory.h>
 +#include <linux/binfmts.h>
  
  #include <asm/pgtable.h>
@@ -2049,9 +2049,9 @@
 --- linux-2.6.24.4/arch/sparc/kernel/ptrace.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/arch/sparc/kernel/ptrace.c	2008-03-26 20:21:07.000000000 -0400
 @@ -19,6 +19,7 @@
- #include <linux/smp_lock.h>
  #include <linux/security.h>
  #include <linux/signal.h>
+ #include <linux/vs_base.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/pgtable.h>
@@ -2443,9 +2443,9 @@
 --- linux-2.6.24.4/arch/sparc64/kernel/ptrace.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/arch/sparc64/kernel/ptrace.c	2008-03-26 20:21:07.000000000 -0400
 @@ -22,6 +22,7 @@
- #include <linux/seccomp.h>
  #include <linux/audit.h>
  #include <linux/signal.h>
+ #include <linux/vs_base.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/asi.h>
@@ -14795,9 +14795,9 @@
 --- linux-2.6.24.4/fs/binfmt_aout.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/binfmt_aout.c	2008-03-26 20:21:08.000000000 -0400
 @@ -24,6 +24,7 @@
- #include <linux/binfmts.h>
  #include <linux/personality.h>
  #include <linux/init.h>
+ #include <linux/vs_memory.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/system.h>
@@ -14876,9 +14876,9 @@
 --- linux-2.6.24.4/fs/binfmt_elf.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/binfmt_elf.c	2008-03-26 20:21:08.000000000 -0400
 @@ -39,10 +39,16 @@
- #include <linux/random.h>
  #include <linux/elf.h>
  #include <linux/utsname.h>
+ #include <linux/vs_memory.h>
 +#include <linux/grsecurity.h>
 +
  #include <asm/uaccess.h>
@@ -16145,14 +16145,14 @@
 --- linux-2.6.24.4/fs/ext3/balloc.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/ext3/balloc.c	2008-03-26 20:21:08.000000000 -0400
 @@ -1359,7 +1359,7 @@ static int ext3_has_free_blocks(struct e
+ 	DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks);
  
- 	free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
- 	root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
--	if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) &&
-+	if (free_blocks < root_blocks + 1 && !capable_nolog(CAP_SYS_RESOURCE) &&
+ 	cond = (free_blocks < root_blocks + 1 &&
+-		!capable(CAP_SYS_RESOURCE) &&
++		!capable_nolog(CAP_SYS_RESOURCE) &&
  		sbi->s_resuid != current->fsuid &&
- 		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
- 		return 0;
+ 		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid)));
+ 
 diff -urNp linux-2.6.24.4/fs/ext3/namei.c linux-2.6.24.4/fs/ext3/namei.c
 --- linux-2.6.24.4/fs/ext3/namei.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/ext3/namei.c	2008-03-26 20:21:08.000000000 -0400
@@ -16186,14 +16186,14 @@
 --- linux-2.6.24.4/fs/ext4/balloc.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/ext4/balloc.c	2008-03-26 20:21:08.000000000 -0400
 @@ -1479,7 +1479,7 @@ static int ext4_has_free_blocks(struct e
+ 	DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks);
  
- 	free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
- 	root_blocks = ext4_r_blocks_count(sbi->s_es);
--	if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) &&
-+	if (free_blocks < root_blocks + 1 && !capable_nolog(CAP_SYS_RESOURCE) &&
+ 	cond = (free_blocks < root_blocks + 1 &&
+-		!capable(CAP_SYS_RESOURCE) &&
++		!capable_nolog(CAP_SYS_RESOURCE) &&
  		sbi->s_resuid != current->fsuid &&
- 		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
- 		return 0;
+ 		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid)));
+ 
 diff -urNp linux-2.6.24.4/fs/ext4/namei.c linux-2.6.24.4/fs/ext4/namei.c
 --- linux-2.6.24.4/fs/ext4/namei.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/ext4/namei.c	2008-03-26 20:21:08.000000000 -0400
@@ -16213,9 +16213,9 @@
 --- linux-2.6.24.4/fs/fcntl.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/fcntl.c	2008-03-26 20:21:08.000000000 -0400
 @@ -19,6 +19,7 @@
- #include <linux/signal.h>
  #include <linux/rcupdate.h>
  #include <linux/pid_namespace.h>
+ #include <linux/vs_limit.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/poll.h>
@@ -16510,9 +16510,9 @@
 --- linux-2.6.24.4/fs/namei.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/namei.c	2008-03-26 20:21:08.000000000 -0400
 @@ -30,6 +30,7 @@
- #include <linux/capability.h>
- #include <linux/file.h>
- #include <linux/fcntl.h>
+ #include <linux/vs_tag.h>
+ #include <linux/vs_cowbl.h>
+ #include <linux/vs_context.h>
 +#include <linux/grsecurity.h>
  #include <asm/namei.h>
  #include <asm/uaccess.h>
@@ -16678,7 +16678,7 @@
 +
  	if (!IS_POSIXACL(nd.dentry->d_inode))
  		mode &= ~current->fs->umask;
- 	error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);
+ 	error = vfs_mkdir(nd.dentry->d_inode, dentry, mode, &nd);
 +
 +	if (!error)
 +		gr_handle_create(dentry, nd.mnt);
@@ -16711,7 +16711,7 @@
 +			goto dput_exit2;
 +		}
 +	}
- 	error = vfs_rmdir(nd.dentry->d_inode, dentry);
+ 	error = vfs_rmdir(nd.dentry->d_inode, dentry, &nd);
 +	if (!error && (saved_dev || saved_ino))
 +		gr_handle_delete(saved_ino, saved_dev);
 +dput_exit2:
@@ -16747,10 +16747,10 @@
 +				error = -EACCES;
 +
  			atomic_inc(&inode->i_count);
--		error = vfs_unlink(nd.dentry->d_inode, dentry);
+-		error = vfs_unlink(nd.dentry->d_inode, dentry, &nd);
 +		}
 +		if (!error)
-+			error = vfs_unlink(nd.dentry->d_inode, dentry);
++			error = vfs_unlink(nd.dentry->d_inode, dentry, &nd);
 +		if (!error && (saved_ino || saved_dev))
 +			gr_handle_delete(saved_ino, saved_dev);
  	exit2:
@@ -16765,7 +16765,7 @@
 +		goto out_dput_unlock;
 +	}
 +
- 	error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO);
+ 	error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO, &nd);
 +
 +	if (!error)
 +		gr_handle_create(dentry, nd.mnt);
@@ -16791,7 +16791,7 @@
 +		goto out_unlock_dput;
 +	}
 +
- 	error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
+ 	error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry, &nd);
 +
 +	if (!error)
 +		gr_handle_create(new_dentry, nd.mnt);
@@ -16821,9 +16821,9 @@
 --- linux-2.6.24.4/fs/namespace.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/namespace.c	2008-03-26 20:21:08.000000000 -0400
 @@ -25,6 +25,7 @@
- #include <linux/security.h>
- #include <linux/mount.h>
- #include <linux/ramfs.h>
+ #include <linux/vs_tag.h>
+ #include <linux/vserver/space.h>
+ #include <linux/vserver/global.h>
 +#include <linux/grsecurity.h>
  #include <asm/uaccess.h>
  #include <asm/unistd.h>
@@ -17216,9 +17216,9 @@
 --- linux-2.6.24.4/fs/open.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/open.c	2008-03-26 20:21:08.000000000 -0400
 @@ -27,6 +27,7 @@
- #include <linux/rcupdate.h>
- #include <linux/audit.h>
- #include <linux/falloc.h>
+ #include <linux/vs_dlimit.h>
+ #include <linux/vs_tag.h>
+ #include <linux/vs_cowbl.h>
 +#include <linux/grsecurity.h>
  
  int vfs_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -17328,15 +17328,6 @@
  	newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
  	newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
  	error = notify_change(nd.dentry, &newattrs);
-@@ -631,7 +680,7 @@ asmlinkage long sys_chmod(const char __u
- 	return sys_fchmodat(AT_FDCWD, filename, mode);
- }
- 
--static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
-+static int chown_common(struct dentry * dentry, uid_t user, gid_t group, struct vfsmount *mnt)
- {
- 	struct inode * inode;
- 	int error;
 @@ -648,6 +697,12 @@ static int chown_common(struct dentry * 
  	error = -EPERM;
  	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
@@ -17350,42 +17341,6 @@
  	newattrs.ia_valid =  ATTR_CTIME;
  	if (user != (uid_t) -1) {
  		newattrs.ia_valid |= ATTR_UID;
-@@ -675,7 +730,7 @@ asmlinkage long sys_chown(const char __u
- 	error = user_path_walk(filename, &nd);
- 	if (error)
- 		goto out;
--	error = chown_common(nd.dentry, user, group);
-+	error = chown_common(nd.dentry, user, group, nd.mnt);
- 	path_release(&nd);
- out:
- 	return error;
-@@ -695,7 +750,7 @@ asmlinkage long sys_fchownat(int dfd, co
- 	error = __user_walk_fd(dfd, filename, follow, &nd);
- 	if (error)
- 		goto out;
--	error = chown_common(nd.dentry, user, group);
-+	error = chown_common(nd.dentry, user, group, nd.mnt);
- 	path_release(&nd);
- out:
- 	return error;
-@@ -709,7 +764,7 @@ asmlinkage long sys_lchown(const char __
- 	error = user_path_walk_link(filename, &nd);
- 	if (error)
- 		goto out;
--	error = chown_common(nd.dentry, user, group);
-+	error = chown_common(nd.dentry, user, group, nd.mnt);
- 	path_release(&nd);
- out:
- 	return error;
-@@ -728,7 +783,7 @@ asmlinkage long sys_fchown(unsigned int 
- 
- 	dentry = file->f_path.dentry;
- 	audit_inode(NULL, dentry);
--	error = chown_common(dentry, user, group);
-+	error = chown_common(dentry, user, group, file->f_vfsmnt);
- 	fput(file);
- out:
- 	return error;
 @@ -939,6 +994,7 @@ repeat:
  	 * N.B. For clone tasks sharing a files structure, this test
  	 * will limit the total number of files that can be opened.
@@ -17523,9 +17478,9 @@
 --- linux-2.6.24.4/fs/proc/base.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/proc/base.c	2008-03-26 20:21:08.000000000 -0400
 @@ -76,6 +76,8 @@
- #include <linux/oom.h>
- #include <linux/elf.h>
  #include <linux/pid_namespace.h>
+ #include <linux/vs_context.h>
+ #include <linux/vs_network.h>
 +#include <linux/grsecurity.h>
 +
  #include "internal.h"
@@ -17716,9 +17671,9 @@
  
  out:
 @@ -2250,6 +2313,9 @@ static const struct pid_entry tgid_base_
- #ifdef CONFIG_TASK_IO_ACCOUNTING
  	INF("io",	S_IRUGO, pid_io_accounting),
  #endif
+ 	INF("nsproxy",	S_IRUGO, pid_nsproxy),
 +#ifdef CONFIG_GRKERNSEC_PROC_IPADDR
 +	INF("ipaddr",	  S_IRUSR, pid_ipaddr),
 +#endif
@@ -17755,7 +17710,7 @@
 @@ -2486,6 +2563,9 @@ int proc_pid_readdir(struct file * filp,
  {
  	unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY;
- 	struct task_struct *reaper = get_proc_task(filp->f_path.dentry->d_inode);
+ 	struct task_struct *reaper = get_proc_task_real(filp->f_path.dentry->d_inode);
 +#if defined(CONFIG_GRKERNSEC_PROC_USER) || defined(CONFIG_GRKERNSEC_PROC_USERGROUP)
 +	struct task_struct *tmp = current;
 +#endif
@@ -17799,9 +17754,9 @@
 --- linux-2.6.24.4/fs/proc/internal.h	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/proc/internal.h	2008-03-26 20:21:08.000000000 -0400
 @@ -52,6 +52,9 @@ extern int proc_tid_stat(struct task_str
- extern int proc_tgid_stat(struct task_struct *, char *);
  extern int proc_pid_status(struct task_struct *, char *);
  extern int proc_pid_statm(struct task_struct *, char *);
+ extern int proc_pid_nsproxy(struct task_struct *, char *);
 +#ifdef CONFIG_GRKERNSEC_PROC_IPADDR
 +extern int proc_pid_ipaddr(struct task_struct*,char*);
 +#endif
@@ -17982,6 +17937,7 @@
 +#else
  	proc_bus = proc_mkdir("bus", NULL);
 +#endif
+ 	proc_vx_init();
  	proc_sys_init();
  }
  
@@ -18346,9 +18302,9 @@
 --- linux-2.6.24.4/fs/utimes.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/fs/utimes.c	2008-03-26 20:21:08.000000000 -0400
 @@ -6,6 +6,7 @@
- #include <linux/sched.h>
- #include <linux/stat.h>
  #include <linux/utime.h>
+ #include <linux/mount.h>
+ #include <linux/vs_cowbl.h>
 +#include <linux/grsecurity.h>
  #include <asm/uaccess.h>
  #include <asm/unistd.h>
@@ -18361,7 +18317,7 @@
  	struct inode *inode;
  	struct iattr newattrs;
  	struct file *f = NULL;
-@@ -78,12 +80,14 @@ long do_utimes(int dfd, char __user *fil
+@@ -78,6 +80,7 @@ long do_utimes(int dfd, char __user *fil
  		if (!f)
  			goto out;
  		dentry = f->f_path.dentry;
@@ -18369,8 +18325,9 @@
  	} else {
  		error = __user_walk_fd(dfd, filename, (flags & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW, &nd);
  		if (error)
- 			goto out;
- 
+@@ -86,6 +90,7 @@ long do_utimes(int dfd, char __user *fil
+ 		if (error)
+ 			goto dput_and_out;
  		dentry = nd.dentry;
 +		mnt = nd.mnt;
  	}
@@ -31454,23 +31411,27 @@
  	sys_close(fd);
  	if (len <= 0 || len == 32 || buf[len - 1] != '\n')
  		goto fail;
-@@ -145,8 +147,8 @@ dev_t name_to_dev_t(char *name)
- 	int part;
+@@ -145,12 +145,12 @@ dev_t name_to_dev_t(char *name)
+ 	int part, mount_result;
  
  #ifdef CONFIG_SYSFS
 -	int mkdir_err = sys_mkdir("/sys", 0700);
--	if (sys_mount("sysfs", "/sys", "sysfs", 0, NULL) < 0)
 +	int mkdir_err = sys_mkdir((char __user *)"/sys", 0700);
-+	if (sys_mount((char __user *)"sysfs", (char __user *)"/sys", (char __user *)"sysfs", 0, NULL) < 0)
+ 	/*
+ 	 * When changing resume parameter for TuxOnIce, sysfs may
+ 	 * already be mounted.
+ 	 */
+-	mount_result = sys_mount("sysfs", "/sys", "sysfs", 0, NULL);
++	mount_result = sys_mount((char __user *)"sysfs", (char __user *)"/sys", (char __user *)"sysfs", 0, NULL);
+ 	if (mount_result < 0 && mount_result != -EBUSY)
  		goto out;
  #endif
- 
 @@ -198,10 +200,10 @@ dev_t name_to_dev_t(char *name)
- 	res = try_name(s, part);
  done:
  #ifdef CONFIG_SYSFS
--	sys_umount("/sys", 0);
-+	sys_umount((char __user *)"/sys", 0);
+ 	if (mount_result >= 0)
+-		sys_umount("/sys", 0);
++		sys_umount((char __user *)"/sys", 0);
  out:
  	if (!mkdir_err)
 -		sys_rmdir("/sys");
@@ -31757,9 +31718,9 @@
 --- linux-2.6.24.4/ipc/msg.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/ipc/msg.c	2008-03-26 20:21:09.000000000 -0400
 @@ -36,6 +36,7 @@
- #include <linux/seq_file.h>
  #include <linux/rwsem.h>
  #include <linux/nsproxy.h>
+ #include <linux/vs_base.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/current.h>
@@ -31797,9 +31758,9 @@
 --- linux-2.6.24.4/ipc/sem.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/ipc/sem.c	2008-03-26 20:21:09.000000000 -0400
 @@ -82,6 +82,7 @@
- #include <linux/seq_file.h>
- #include <linux/rwsem.h>
  #include <linux/nsproxy.h>
+ #include <linux/vs_base.h>
+ #include <linux/vs_limit.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/uaccess.h>
@@ -31837,9 +31798,9 @@
 --- linux-2.6.24.4/ipc/shm.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/ipc/shm.c	2008-03-26 20:21:09.000000000 -0400
 @@ -38,6 +38,7 @@
- #include <linux/rwsem.h>
- #include <linux/nsproxy.h>
  #include <linux/mount.h>
+ #include <linux/vs_context.h>
+ #include <linux/vs_limit.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/uaccess.h>
@@ -31942,14 +31903,14 @@
 --- linux-2.6.24.4/kernel/capability.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/kernel/capability.c	2008-03-26 20:21:09.000000000 -0400
 @@ -13,6 +13,7 @@
- #include <linux/security.h>
  #include <linux/syscalls.h>
  #include <linux/pid_namespace.h>
+ #include <linux/vs_context.h>
 +#include <linux/grsecurity.h>
  #include <asm/uaccess.h>
  
  /*
-@@ -233,15 +234,25 @@ out:
+@@ -233,13 +234,22 @@ out:
  
  int __capable(struct task_struct *t, int cap)
  {
@@ -31970,8 +31931,10 @@
 +	return 0;
 +}
 +
+ #include <linux/vserver/base.h>
  int capable(int cap)
  {
+@@ -252,3 +262,4 @@ int capable(int cap)
  	return __capable(current, cap);
  }
  EXPORT_SYMBOL(capable);
@@ -32021,9 +31984,9 @@
 --- linux-2.6.24.4/kernel/exit.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/kernel/exit.c	2008-03-26 20:21:09.000000000 -0400
 @@ -44,6 +44,11 @@
- #include <linux/resource.h>
- #include <linux/blkdev.h>
- #include <linux/task_io_accounting_ops.h>
+ #include <linux/vs_network.h>
+ #include <linux/vs_pid.h>
+ #include <linux/vserver/global.h>
 +#include <linux/grsecurity.h>
 +
 +#ifdef CONFIG_GRKERNSEC
@@ -32105,9 +32068,9 @@
 --- linux-2.6.24.4/kernel/fork.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/kernel/fork.c	2008-03-26 20:21:09.000000000 -0400
 @@ -51,6 +51,7 @@
- #include <linux/random.h>
- #include <linux/tty.h>
- #include <linux/proc_fs.h>
+ #include <linux/vs_limit.h>
+ #include <linux/vs_memory.h>
+ #include <linux/vserver/global.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/pgtable.h>
@@ -32200,15 +32163,15 @@
  }
  
 @@ -1015,6 +1042,9 @@ static struct task_struct *copy_process(
+ 	DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
  	DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
  #endif
- 	retval = -EAGAIN;
 +
 +	gr_learn_resource(p, RLIMIT_NPROC, atomic_read(&p->user->processes), 0);
 +
- 	if (atomic_read(&p->user->processes) >=
- 			p->signal->rlim[RLIMIT_NPROC].rlim_cur) {
- 		if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
+ 	init_vx_info(&p->vx_info, current->vx_info);
+ 	init_nx_info(&p->nx_info, current->nx_info);
+ 
 @@ -1169,6 +1199,8 @@ static struct task_struct *copy_process(
  	if (clone_flags & CLONE_THREAD)
  		p->tgid = current->tgid;
@@ -32941,9 +32904,9 @@
 --- linux-2.6.24.4/kernel/pid.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/kernel/pid.c	2008-03-26 20:21:09.000000000 -0400
 @@ -35,6 +35,7 @@
- #include <linux/pid_namespace.h>
- #include <linux/init_task.h>
  #include <linux/syscalls.h>
+ #include <linux/vs_pid.h>
+ #include <linux/vserver/global.h>
 +#include <linux/grsecurity.h>
  
  #define pid_hashfn(nr, ns)	\
@@ -33008,9 +32971,9 @@
 --- linux-2.6.24.4/kernel/printk.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/kernel/printk.c	2008-03-26 20:21:09.000000000 -0400
 @@ -33,6 +33,7 @@
- #include <linux/bootmem.h>
  #include <linux/syscalls.h>
  #include <linux/jiffies.h>
+ #include <linux/vs_cvirt.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/uaccess.h>
@@ -33031,9 +32994,9 @@
 --- linux-2.6.24.4/kernel/ptrace.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/kernel/ptrace.c	2008-03-26 20:21:09.000000000 -0400
 @@ -20,6 +20,7 @@
- #include <linux/signal.h>
  #include <linux/audit.h>
  #include <linux/pid_namespace.h>
+ #include <linux/vs_context.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/pgtable.h>
@@ -33139,9 +33102,9 @@
 --- linux-2.6.24.4/kernel/sched.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/kernel/sched.c	2008-03-26 20:21:09.000000000 -0400
 @@ -63,6 +63,7 @@
- #include <linux/reciprocal_div.h>
- #include <linux/unistd.h>
  #include <linux/pagemap.h>
+ #include <linux/vs_sched.h>
+ #include <linux/vs_cvirt.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/tlb.h>
@@ -33162,7 +33125,7 @@
 -	if (increment < 0 && !can_nice(current, nice))
 +	if (increment < 0 && (!can_nice(current, nice) ||
 +			      gr_handle_chroot_nice()))
- 		return -EPERM;
+ 		return vx_flags(VXF_IGNEG_NICE, 0) ? 0 : -EPERM;
  
  	retval = security_task_setnice(current, nice);
 @@ -5396,7 +5398,7 @@ static struct ctl_table sd_ctl_dir[] = {
@@ -33508,7 +33471,7 @@
 @@ -88,6 +89,9 @@ asmlinkage long sys_stime(time_t __user 
  		return err;
  
- 	do_settimeofday(&tv);
+ 	vx_settimeofday(&tv);
 +
 +	gr_log_timechange();
 +
@@ -34282,9 +34245,9 @@
 --- linux-2.6.24.4/mm/mlock.c	2008-03-24 14:49:18.000000000 -0400
 +++ linux-2.6.24.4/mm/mlock.c	2008-03-26 20:21:09.000000000 -0400
 @@ -12,6 +12,7 @@
- #include <linux/syscalls.h>
  #include <linux/sched.h>
  #include <linux/module.h>
+ #include <linux/vs_memory.h>
 +#include <linux/grsecurity.h>
  
  int can_do_mlock(void)
@@ -34314,7 +34277,7 @@
 +	gr_learn_resource(current, RLIMIT_MEMLOCK, (current->mm->locked_vm << PAGE_SHIFT) + len, 1);
  	if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
  		error = do_mlock(start, len, 1);
- 	up_write(&current->mm->mmap_sem);
+ out:
 @@ -173,10 +186,10 @@ asmlinkage long sys_munlock(unsigned lon
  static int do_mlockall(int flags)
  {
@@ -34346,9 +34309,9 @@
  
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/linux-2.6-grsec_full.patch?r1=1.1.2.32&r2=1.1.2.33&f=u



More information about the pld-cvs-commit mailing list