オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.8.x/ccs-patch/patches/ccs-patch-2.6.16-vine-linux-4.2.diff

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/ccs-patch/patches/ccs-patch-2.6.16-vine-linux-4.2.diff revision 2882 by kumaneko, Sun Aug 9 10:54:06 2009 UTC trunk/1.7.x/ccs-patch/patches/ccs-patch-2.6.16-vine-linux-4.2.diff revision 2944 by kumaneko, Mon Aug 24 05:00:52 2009 UTC
# Line 15  Source code for this patch is http://upd Line 15  Source code for this patch is http://upd
15   fs/attr.c                       |    5 +++++   fs/attr.c                       |    5 +++++
16   fs/compat.c                     |    9 ++++++++-   fs/compat.c                     |    9 ++++++++-
17   fs/exec.c                       |   12 +++++++++++-   fs/exec.c                       |   12 +++++++++++-
18   fs/fcntl.c                      |    5 +++++   fs/fcntl.c                      |    4 ++++
19   fs/ioctl.c                      |    5 +++++   fs/ioctl.c                      |    5 +++++
20   fs/namei.c                      |   38 ++++++++++++++++++++++++++++++++++++++   fs/namei.c                      |   34 ++++++++++++++++++++++++++++++++++
21   fs/namespace.c                  |   25 ++++++++++++++++++++++++-   fs/namespace.c                  |   24 +++++++++++++++++++++++-
22   fs/open.c                       |   30 +++++++++++++++++++++++++++++-   fs/open.c                       |   29 ++++++++++++++++++++++++++++-
23   fs/proc/proc_misc.c             |    1 +   fs/proc/proc_misc.c             |    1 +
24   include/linux/init_task.h       |    2 ++   include/linux/init_task.h       |    9 +++++++++
25   include/linux/sched.h           |    4 ++++   include/linux/sched.h           |    6 ++++++
26   kernel/compat.c                 |    3 +++   kernel/compat.c                 |    3 +++
27   kernel/kexec.c                  |    3 +++   kernel/kexec.c                  |    3 +++
28   kernel/kmod.c                   |    3 +++   kernel/kmod.c                   |    5 +++++
29   kernel/module.c                 |    7 +++++--   kernel/module.c                 |    7 +++++--
30   kernel/ptrace.c                 |    3 +++   kernel/ptrace.c                 |    3 +++
31   kernel/sched.c                  |    3 +++   kernel/sched.c                  |    3 +++
# Line 44  Source code for this patch is http://upd Line 44  Source code for this patch is http://upd
44   net/unix/af_unix.c              |    4 ++++   net/unix/af_unix.c              |    4 ++++
45   security/Kconfig                |    2 ++   security/Kconfig                |    2 ++
46   security/Makefile               |    3 +++   security/Makefile               |    3 +++
47   42 files changed, 290 insertions(+), 11 deletions(-)   42 files changed, 294 insertions(+), 11 deletions(-)
48    
49  --- linux-2.6.16-76.51vl4.orig/arch/alpha/kernel/ptrace.c  --- linux-2.6.16-76.51vl4.orig/arch/alpha/kernel/ptrace.c
50  +++ linux-2.6.16-76.51vl4/arch/alpha/kernel/ptrace.c  +++ linux-2.6.16-76.51vl4/arch/alpha/kernel/ptrace.c
# Line 254  Source code for this patch is http://upd Line 254  Source code for this patch is http://upd
254          if (inode->i_op && inode->i_op->setattr) {          if (inode->i_op && inode->i_op->setattr) {
255                  error = security_inode_setattr(dentry, attr);                  error = security_inode_setattr(dentry, attr);
256                  if (!error)                  if (!error)
257  +                       error = ccs_check_setattr_permission(dentry, attr);  +                       error = ccs_setattr_permission(dentry, attr);
258  +               if (!error)  +               if (!error)
259                          error = inode->i_op->setattr(dentry, attr);                          error = inode->i_op->setattr(dentry, attr);
260          } else {          } else {
# Line 262  Source code for this patch is http://upd Line 262  Source code for this patch is http://upd
262                  if (!error)                  if (!error)
263                          error = security_inode_setattr(dentry, attr);                          error = security_inode_setattr(dentry, attr);
264  +               if (!error)  +               if (!error)
265  +                       error = ccs_check_setattr_permission(dentry, attr);  +                       error = ccs_setattr_permission(dentry, attr);
266                  if (!error) {                  if (!error) {
267                          if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||                          if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
268                              (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid))                              (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid))
# Line 320  Source code for this patch is http://upd Line 320  Source code for this patch is http://upd
320          if (error)          if (error)
321                  goto exit;                  goto exit;
322    
323  +       error = ccs_check_uselib_permission(nd.dentry, nd.mnt);  +       error = ccs_uselib_permission(nd.dentry, nd.mnt);
324  +       if (error)  +       if (error)
325  +               goto exit;  +               goto exit;
326  +  +
# Line 332  Source code for this patch is http://upd Line 332  Source code for this patch is http://upd
332                          if (!err && !(inode->i_mode & 0111))                          if (!err && !(inode->i_mode & 0111))
333                                  err = -EACCES;                                  err = -EACCES;
334  +                       if (!err)  +                       if (!err)
335  +                               err = ccs_check_open_exec_permission(nd.dentry,  +                               err = ccs_open_exec_permission(nd.dentry,
336  +                                                                    nd.mnt);  +                                                                    nd.mnt);
337                          file = ERR_PTR(err);                          file = ERR_PTR(err);
338                          if (!err) {                          if (!err) {
# Line 357  Source code for this patch is http://upd Line 357  Source code for this patch is http://upd
357    
358   void fastcall set_close_on_exec(unsigned int fd, int flag)   void fastcall set_close_on_exec(unsigned int fd, int flag)
359   {   {
360  @@ -215,6 +216,10 @@ static int setfl(int fd, struct file * f  @@ -215,6 +216,9 @@ static int setfl(int fd, struct file * f
361          if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode))          if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode))
362                  return -EPERM;                  return -EPERM;
363    
364  +       if (((arg ^ filp->f_flags) & O_APPEND) &&  +       if (((arg ^ filp->f_flags) & O_APPEND) && ccs_rewrite_permission(filp))
 +           ccs_check_rewrite_permission(filp))  
365  +               return -EPERM;  +               return -EPERM;
366  +  +
367          /* O_NOATIME can only be set by the owner or superuser */          /* O_NOATIME can only be set by the owner or superuser */
# Line 392  Source code for this patch is http://upd Line 391  Source code for this patch is http://upd
391    
392          error = security_file_ioctl(filp, cmd, arg);          error = security_file_ioctl(filp, cmd, arg);
393  +       if (!error)  +       if (!error)
394  +               error = ccs_check_ioctl_permission(filp, cmd, arg);  +               error = ccs_ioctl_permission(filp, cmd, arg);
395          if (error)          if (error)
396                  goto out_fput;                  goto out_fput;
397    
# Line 412  Source code for this patch is http://upd Line 411  Source code for this patch is http://upd
411                          return -EPERM;                          return -EPERM;
412    
413  +       /* includes O_APPEND and O_TRUNC checks */  +       /* includes O_APPEND and O_TRUNC checks */
414  +       error = ccs_check_open_permission(dentry, nd->mnt, flag);  +       error = ccs_open_permission(dentry, nd->mnt, flag);
415  +       if (error)  +       if (error)
416  +               return error;  +               return error;
417  +  +
# Line 431  Source code for this patch is http://upd Line 430  Source code for this patch is http://upd
430          if (!path.dentry->d_inode) {          if (!path.dentry->d_inode) {
431                  if (!IS_POSIXACL(dir->d_inode))                  if (!IS_POSIXACL(dir->d_inode))
432                          mode &= ~current->fs->umask;                          mode &= ~current->fs->umask;
433  +               error = ccs_check_mknod_permission(dir->d_inode, path.dentry,  +               error = ccs_mknod_permission(dir->d_inode, path.dentry,
434  +                                                  nd->mnt, mode, 0);  +                                            nd->mnt, mode, 0);
435  +               if (!error)  +               if (!error)
436                  error = vfs_create(dir->d_inode, path.dentry, mode, nd);                  error = vfs_create(dir->d_inode, path.dentry, mode, nd);
437                  mutex_unlock(&dir->d_inode->i_mutex);                  mutex_unlock(&dir->d_inode->i_mutex);
438                  dput(nd->dentry);                  dput(nd->dentry);
439  @@ -1847,6 +1858,10 @@ asmlinkage long sys_mknodat(int dfd, con  @@ -1847,6 +1858,9 @@ asmlinkage long sys_mknodat(int dfd, con
440          if (!IS_POSIXACL(nd.dentry->d_inode))          if (!IS_POSIXACL(nd.dentry->d_inode))
441                  mode &= ~current->fs->umask;                  mode &= ~current->fs->umask;
442          if (!IS_ERR(dentry)) {          if (!IS_ERR(dentry)) {
443  +               error = ccs_check_mknod_permission(nd.dentry->d_inode, dentry,  +               error = ccs_mknod_permission(nd.dentry->d_inode, dentry,
444  +                                                  nd.mnt, mode,  +                                            nd.mnt, mode, dev);
 +                                                  new_decode_dev(dev));  
445  +               if (!error)  +               if (!error)
446                  switch (mode & S_IFMT) {                  switch (mode & S_IFMT) {
447                  case 0: case S_IFREG:                  case 0: case S_IFREG:
448                          error = vfs_create(nd.dentry->d_inode,dentry,mode,&nd);                          error = vfs_create(nd.dentry->d_inode,dentry,mode,&nd);
449  @@ -1920,6 +1935,10 @@ asmlinkage long sys_mkdirat(int dfd, con  @@ -1920,6 +1934,9 @@ asmlinkage long sys_mkdirat(int dfd, con
450                  if (!IS_ERR(dentry)) {                  if (!IS_ERR(dentry)) {
451                          if (!IS_POSIXACL(nd.dentry->d_inode))                          if (!IS_POSIXACL(nd.dentry->d_inode))
452                                  mode &= ~current->fs->umask;                                  mode &= ~current->fs->umask;
453  +                       error = ccs_check_mkdir_permission(nd.dentry->d_inode,  +                       error = ccs_mkdir_permission(nd.dentry->d_inode,
454  +                                                          dentry, nd.mnt,  +                                                    dentry, nd.mnt, mode);
 +                                                          mode);  
455  +                       if (!error)  +                       if (!error)
456                          error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);                          error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);
457                          dput(dentry);                          dput(dentry);
458                  }                  }
459  @@ -2028,6 +2047,9 @@ static long do_rmdir(int dfd, const char  @@ -2028,6 +2045,9 @@ static long do_rmdir(int dfd, const char
460          dentry = lookup_hash(&nd);          dentry = lookup_hash(&nd);
461          error = PTR_ERR(dentry);          error = PTR_ERR(dentry);
462          if (!IS_ERR(dentry)) {          if (!IS_ERR(dentry)) {
463  +               error = ccs_check_rmdir_permission(nd.dentry->d_inode, dentry,  +               error = ccs_rmdir_permission(nd.dentry->d_inode, dentry,
464  +                                                  nd.mnt);  +                                            nd.mnt);
465  +               if (!error)  +               if (!error)
466                  error = vfs_rmdir(nd.dentry->d_inode, dentry);                  error = vfs_rmdir(nd.dentry->d_inode, dentry);
467                  dput(dentry);                  dput(dentry);
468          }          }
469  @@ -2108,6 +2130,9 @@ static long do_unlinkat(int dfd, const c  @@ -2108,6 +2128,9 @@ static long do_unlinkat(int dfd, const c
470                  inode = dentry->d_inode;                  inode = dentry->d_inode;
471                  if (inode)                  if (inode)
472                          atomic_inc(&inode->i_count);                          atomic_inc(&inode->i_count);
473  +               error = ccs_check_unlink_permission(nd.dentry->d_inode, dentry,  +               error = ccs_unlink_permission(nd.dentry->d_inode, dentry,
474  +                                                   nd.mnt);  +                                             nd.mnt);
475  +               if (!error)  +               if (!error)
476                  error = vfs_unlink(nd.dentry->d_inode, dentry);                  error = vfs_unlink(nd.dentry->d_inode, dentry);
477          exit2:          exit2:
478                  dput(dentry);                  dput(dentry);
479  @@ -2186,6 +2211,10 @@ asmlinkage long sys_symlinkat(const char  @@ -2186,6 +2209,9 @@ asmlinkage long sys_symlinkat(const char
480                  dentry = lookup_create(&nd, 0);                  dentry = lookup_create(&nd, 0);
481                  error = PTR_ERR(dentry);                  error = PTR_ERR(dentry);
482                  if (!IS_ERR(dentry)) {                  if (!IS_ERR(dentry)) {
483  +                       error = ccs_check_symlink_permission(nd.dentry->d_inode,  +                       error = ccs_symlink_permission(nd.dentry->d_inode,
484  +                                                            dentry, nd.mnt,  +                                                      dentry, nd.mnt, from);
 +                                                            from);  
485  +                       if (!error)  +                       if (!error)
486                          error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO);                          error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO);
487                          dput(dentry);                          dput(dentry);
488                  }                  }
489  @@ -2278,6 +2307,10 @@ asmlinkage long sys_linkat(int olddfd, c  @@ -2278,6 +2304,9 @@ asmlinkage long sys_linkat(int olddfd, c
490          new_dentry = lookup_create(&nd, 0);          new_dentry = lookup_create(&nd, 0);
491          error = PTR_ERR(new_dentry);          error = PTR_ERR(new_dentry);
492          if (!IS_ERR(new_dentry)) {          if (!IS_ERR(new_dentry)) {
493  +               error = ccs_check_link_permission(old_nd.dentry,  +               error = ccs_link_permission(old_nd.dentry, nd.dentry->d_inode,
494  +                                                 nd.dentry->d_inode,  +                                           new_dentry, nd.mnt);
 +                                                 new_dentry, nd.mnt);  
495  +               if (!error)  +               if (!error)
496                  error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);                  error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
497                  dput(new_dentry);                  dput(new_dentry);
498          }          }
499  @@ -2504,6 +2537,11 @@ static int do_rename(int olddfd, const c  @@ -2504,6 +2533,11 @@ static int do_rename(int olddfd, const c
500          if (new_dentry == trap)          if (new_dentry == trap)
501                  goto exit5;                  goto exit5;
502    
503  +       error = ccs_check_rename_permission(old_dir->d_inode, old_dentry,  +       error = ccs_rename_permission(old_dir->d_inode, old_dentry,
504  +                                           new_dir->d_inode, new_dentry,  +                                     new_dir->d_inode, new_dentry, newnd.mnt);
505  +                                           newnd.mnt);  +       if (error)
506  +       if (!error)  +               goto exit5;
507  +  +
508          error = vfs_rename(old_dir->d_inode, old_dentry,          error = vfs_rename(old_dir->d_inode, old_dentry,
509                                     new_dir->d_inode, new_dentry);                                     new_dir->d_inode, new_dentry);
# Line 573  Source code for this patch is http://upd Line 568  Source code for this patch is http://upd
568    
569          newmnt->mnt_flags = mnt_flags;          newmnt->mnt_flags = mnt_flags;
570          if ((err = graft_tree(newmnt, nd)))          if ((err = graft_tree(newmnt, nd)))
571  @@ -1287,6 +1301,11 @@ long do_mount(char *dev_name, char *dir_  @@ -1287,6 +1301,10 @@ long do_mount(char *dev_name, char *dir_
572          if (data_page)          if (data_page)
573                  ((char *)data_page)[PAGE_SIZE - 1] = 0;                  ((char *)data_page)[PAGE_SIZE - 1] = 0;
574    
575  +       retval = ccs_check_mount_permission(dev_name, dir_name, type_page,  +       retval = ccs_mount_permission(dev_name, dir_name, type_page, &flags);
 +                                           &flags);  
576  +       if (retval)  +       if (retval)
577  +               return retval;  +               return retval;
578  +  +
579          /* Separate the per-mountpoint flags */          /* Separate the per-mountpoint flags */
580          if (flags & MS_NOSUID)          if (flags & MS_NOSUID)
581                  mnt_flags |= MNT_NOSUID;                  mnt_flags |= MNT_NOSUID;
582  @@ -1585,6 +1604,8 @@ asmlinkage long sys_pivot_root(const cha  @@ -1585,6 +1603,8 @@ asmlinkage long sys_pivot_root(const cha
583    
584          if (!capable(CAP_SYS_ADMIN))          if (!capable(CAP_SYS_ADMIN))
585                  return -EPERM;                  return -EPERM;
# Line 594  Source code for this patch is http://upd Line 588  Source code for this patch is http://upd
588    
589          lock_kernel();          lock_kernel();
590    
591  @@ -1601,6 +1622,8 @@ asmlinkage long sys_pivot_root(const cha  @@ -1601,6 +1621,8 @@ asmlinkage long sys_pivot_root(const cha
592                  goto out1;                  goto out1;
593    
594          error = security_sb_pivotroot(&old_nd, &new_nd);          error = security_sb_pivotroot(&old_nd, &new_nd);
595  +       if (!error)  +       if (!error)
596  +               error = ccs_check_pivot_root_permission(&old_nd, &new_nd);  +               error = ccs_pivot_root_permission(&old_nd, &new_nd);
597          if (error) {          if (error) {
598                  path_release(&old_nd);                  path_release(&old_nd);
599                  goto out1;                  goto out1;
# Line 618  Source code for this patch is http://upd Line 612  Source code for this patch is http://upd
612          if (error)          if (error)
613                  goto dput_and_out;                  goto dput_and_out;
614    
615  +       error = ccs_check_truncate_permission(nd.dentry, nd.mnt, length, 0);  +       error = ccs_truncate_permission(nd.dentry, nd.mnt, length, 0);
616  +       if (!error)  +       if (!error)
617          error = locks_verify_truncate(inode, NULL, length);          error = locks_verify_truncate(inode, NULL, length);
618          if (!error) {          if (!error) {
619                  DQUOT_INIT(inode);                  DQUOT_INIT(inode);
620  @@ -321,7 +325,10 @@ static long do_sys_ftruncate(unsigned in  @@ -321,7 +325,9 @@ static long do_sys_ftruncate(unsigned in
621          error = -EPERM;          error = -EPERM;
622          if (IS_APPEND(inode))          if (IS_APPEND(inode))
623                  goto out_putf;                  goto out_putf;
624  -  -
625  +       error = ccs_check_truncate_permission(dentry, file->f_vfsmnt, length,  +       error = ccs_truncate_permission(dentry, file->f_vfsmnt, length, 0);
 +                                             0);  
626  +       if (error)  +       if (error)
627  +               goto out_putf;  +               goto out_putf;
628          error = locks_verify_truncate(inode, file, length);          error = locks_verify_truncate(inode, file, length);
629          if (!error)          if (!error)
630                  error = do_truncate(dentry, length, 0, file);                  error = do_truncate(dentry, length, 0, file);
631  @@ -610,6 +617,10 @@ asmlinkage long sys_chroot(const char __  @@ -610,6 +616,10 @@ asmlinkage long sys_chroot(const char __
632          error = -EPERM;          error = -EPERM;
633          if (!capable(CAP_SYS_CHROOT))          if (!capable(CAP_SYS_CHROOT))
634                  goto dput_and_out;                  goto dput_and_out;
635  +       if (!ccs_capable(CCS_SYS_CHROOT))  +       if (!ccs_capable(CCS_SYS_CHROOT))
636  +               goto dput_and_out;  +               goto dput_and_out;
637  +       if (ccs_check_chroot_permission(&nd))  +       if (ccs_chroot_permission(&nd))
638  +               goto dput_and_out;  +               goto dput_and_out;
639    
640          set_fs_root(current->fs, nd.mnt, nd.dentry);          set_fs_root(current->fs, nd.mnt, nd.dentry);
641          set_fs_altroot();          set_fs_altroot();
642  @@ -641,6 +652,9 @@ asmlinkage long sys_fchmod(unsigned int  @@ -641,6 +651,9 @@ asmlinkage long sys_fchmod(unsigned int
643          err = -EPERM;          err = -EPERM;
644          if (IS_IMMUTABLE(inode) || IS_APPEND(inode))          if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
645                  goto out_putf;                  goto out_putf;
# Line 656  Source code for this patch is http://upd Line 649  Source code for this patch is http://upd
649          mutex_lock(&inode->i_mutex);          mutex_lock(&inode->i_mutex);
650          if (mode == (mode_t) -1)          if (mode == (mode_t) -1)
651                  mode = inode->i_mode;                  mode = inode->i_mode;
652  @@ -675,6 +689,9 @@ asmlinkage long sys_fchmodat(int dfd, co  @@ -675,6 +688,9 @@ asmlinkage long sys_fchmodat(int dfd, co
653          error = -EPERM;          error = -EPERM;
654          if (IS_IMMUTABLE(inode) || IS_APPEND(inode))          if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
655                  goto dput_and_out;                  goto dput_and_out;
# Line 666  Source code for this patch is http://upd Line 659  Source code for this patch is http://upd
659    
660          mutex_lock(&inode->i_mutex);          mutex_lock(&inode->i_mutex);
661          if (mode == (mode_t) -1)          if (mode == (mode_t) -1)
662  @@ -737,6 +754,8 @@ asmlinkage long sys_chown(const char __u  @@ -737,6 +753,8 @@ asmlinkage long sys_chown(const char __u
663    
664          error = user_path_walk(filename, &nd);          error = user_path_walk(filename, &nd);
665          if (!error) {          if (!error) {
# Line 675  Source code for this patch is http://upd Line 668  Source code for this patch is http://upd
668                  error = chown_common(nd.dentry, user, group);                  error = chown_common(nd.dentry, user, group);
669                  path_release(&nd);                  path_release(&nd);
670          }          }
671  @@ -756,6 +775,8 @@ asmlinkage long sys_fchownat(int dfd, co  @@ -756,6 +774,8 @@ asmlinkage long sys_fchownat(int dfd, co
672          follow = (flag & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW;          follow = (flag & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW;
673          error = __user_walk_fd(dfd, filename, follow, &nd);          error = __user_walk_fd(dfd, filename, follow, &nd);
674          if (!error) {          if (!error) {
# Line 684  Source code for this patch is http://upd Line 677  Source code for this patch is http://upd
677                  error = chown_common(nd.dentry, user, group);                  error = chown_common(nd.dentry, user, group);
678                  path_release(&nd);                  path_release(&nd);
679          }          }
680  @@ -770,6 +791,8 @@ asmlinkage long sys_lchown(const char __  @@ -770,6 +790,8 @@ asmlinkage long sys_lchown(const char __
681    
682          error = user_path_walk_link(filename, &nd);          error = user_path_walk_link(filename, &nd);
683          if (!error) {          if (!error) {
# Line 693  Source code for this patch is http://upd Line 686  Source code for this patch is http://upd
686                  error = chown_common(nd.dentry, user, group);                  error = chown_common(nd.dentry, user, group);
687                  path_release(&nd);                  path_release(&nd);
688          }          }
689  @@ -784,6 +807,9 @@ asmlinkage long sys_fchown(unsigned int  @@ -784,6 +806,9 @@ asmlinkage long sys_fchown(unsigned int
690    
691          file = fget(fd);          file = fget(fd);
692          if (file) {          if (file) {
# Line 703  Source code for this patch is http://upd Line 696  Source code for this patch is http://upd
696                  error = chown_common(file->f_dentry, user, group);                  error = chown_common(file->f_dentry, user, group);
697                  fput(file);                  fput(file);
698          }          }
699  @@ -1192,6 +1218,8 @@ EXPORT_SYMBOL(sys_close);  @@ -1192,6 +1217,8 @@ EXPORT_SYMBOL(sys_close);
700    */    */
701   asmlinkage long sys_vhangup(void)   asmlinkage long sys_vhangup(void)
702   {   {
# Line 718  Source code for this patch is http://upd Line 711  Source code for this patch is http://upd
711          if (entry)          if (entry)
712                  entry->proc_fops = &proc_sysrq_trigger_operations;                  entry->proc_fops = &proc_sysrq_trigger_operations;
713   #endif   #endif
714  +       printk(KERN_INFO "Hook version: 2.6.16-76.51vl4 2009/08/09\n");  +       printk(KERN_INFO "Hook version: 2.6.16-76.51vl4 2009/08/20\n");
715   }   }
716  --- linux-2.6.16-76.51vl4.orig/include/linux/init_task.h  --- linux-2.6.16-76.51vl4.orig/include/linux/init_task.h
717  +++ linux-2.6.16-76.51vl4/include/linux/init_task.h  +++ linux-2.6.16-76.51vl4/include/linux/init_task.h
718  @@ -121,6 +121,8 @@ extern struct group_info init_groups;  @@ -72,6 +72,14 @@
719    
720     extern struct group_info init_groups;
721    
722    +#ifdef CONFIG_CCSECURITY
723    +#define INIT_CCSECURITY          \
724    +       .ccs_domain_info = NULL, \
725    +       .ccs_flags = 0,
726    +#else
727    +#define INIT_CCSECURITY
728    +#endif
729    +
730     /*
731      *  INIT_TASK is used to set up the first task table, touch at
732      * your own risk!. Base=0, limit=0x1fffff (=2MB)
733    @@ -121,6 +129,7 @@ extern struct group_info init_groups;
734          .journal_info   = NULL,                                         \          .journal_info   = NULL,                                         \
735          .cpu_timers     = INIT_CPU_TIMERS(tsk.cpu_timers),              \          .cpu_timers     = INIT_CPU_TIMERS(tsk.cpu_timers),              \
736          .fs_excl        = ATOMIC_INIT(0),                               \          .fs_excl        = ATOMIC_INIT(0),                               \
737  +       .ccs_domain_info = NULL,                 \  +       INIT_CCSECURITY                                                 \
 +       .ccs_flags = 0,                          \  
738   }   }
739    
740    
# Line 742  Source code for this patch is http://upd Line 749  Source code for this patch is http://upd
749   /*   /*
750    * cloning flags:    * cloning flags:
751    */    */
752  @@ -873,6 +875,8 @@ struct task_struct {  @@ -873,6 +875,10 @@ struct task_struct {
753          struct rcu_head rcu;          struct rcu_head rcu;
754    
755          struct list_head        *scm_work_list;          struct list_head        *scm_work_list;
756    +#ifdef CONFIG_CCSECURITY
757  +       struct ccs_domain_info *ccs_domain_info;  +       struct ccs_domain_info *ccs_domain_info;
758  +       u32 ccs_flags;  +       u32 ccs_flags;
759    +#endif
760   };   };
761    
762   static inline pid_t process_group(struct task_struct *tsk)   static inline pid_t process_group(struct task_struct *tsk)
# Line 791  Source code for this patch is http://upd Line 800  Source code for this patch is http://upd
800           * Verify we have a legal set of flags           * Verify we have a legal set of flags
801  --- linux-2.6.16-76.51vl4.orig/kernel/kmod.c  --- linux-2.6.16-76.51vl4.orig/kernel/kmod.c
802  +++ linux-2.6.16-76.51vl4/kernel/kmod.c  +++ linux-2.6.16-76.51vl4/kernel/kmod.c
803  @@ -150,6 +150,9 @@ static int ____call_usermodehelper(void  @@ -150,6 +150,11 @@ static int ____call_usermodehelper(void
804          /* We can run anywhere, unlike our parent keventd(). */          /* We can run anywhere, unlike our parent keventd(). */
805          set_cpus_allowed(current, CPU_MASK_ALL);          set_cpus_allowed(current, CPU_MASK_ALL);
806    
807    +#ifdef CONFIG_CCSECURITY
808  +       current->ccs_domain_info = NULL;  +       current->ccs_domain_info = NULL;
809  +       current->ccs_flags = 0;  +       current->ccs_flags = 0;
810    +#endif
811  +  +
812          retval = -EPERM;          retval = -EPERM;
813          if (current->fs->root)          if (current->fs->root)
# Line 1312  Source code for this patch is http://upd Line 1323  Source code for this patch is http://upd
1323                   */                   */
1324                  mode = S_IFSOCK |                  mode = S_IFSOCK |
1325                         (SOCK_INODE(sock)->i_mode & ~current->fs->umask);                         (SOCK_INODE(sock)->i_mode & ~current->fs->umask);
1326  +               err = ccs_check_mknod_permission(nd.dentry->d_inode, dentry,  +               err = ccs_mknod_permission(nd.dentry->d_inode, dentry, nd.mnt,
1327  +                                                nd.mnt, mode, 0);  +                                          mode, 0);
1328  +               if (!err)  +               if (!err)
1329                  err = vfs_mknod(nd.dentry->d_inode, dentry, mode, 0);                  err = vfs_mknod(nd.dentry->d_inode, dentry, mode, 0);
1330                  if (err)                  if (err)

Legend:
Removed from v.2882  
changed lines
  Added in v.2944

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26