Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/caitsith-patch/patches/ccs-patch-5.4.diff

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

revision 309 by kumaneko, Tue Jun 9 14:29:47 2020 UTC revision 311 by kumaneko, Tue Jun 16 11:18:03 2020 UTC
# Line 1  Line 1 
1  This is TOMOYO Linux patch for kernel 5.4.45.  This is TOMOYO Linux patch for kernel 5.4.46.
2    
3  Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.45.tar.xz  Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.46.tar.xz
4  ---  ---
5   fs/exec.c                 |    2 -   fs/exec.c                 |    2 -
6   fs/open.c                 |    2 +   fs/open.c                 |    2 +
# Line 28  Source code for this patch is https://ww Line 28  Source code for this patch is https://ww
28   security/security.c       |    5 ++-   security/security.c       |    5 ++-
29   24 files changed, 160 insertions(+), 30 deletions(-)   24 files changed, 160 insertions(+), 30 deletions(-)
30    
31  --- linux-5.4.45.orig/fs/exec.c  --- linux-5.4.46.orig/fs/exec.c
32  +++ linux-5.4.45/fs/exec.c  +++ linux-5.4.46/fs/exec.c
33  @@ -1701,7 +1701,7 @@ static int exec_binprm(struct linux_binp  @@ -1701,7 +1701,7 @@ static int exec_binprm(struct linux_binp
34          old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));          old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));
35          rcu_read_unlock();          rcu_read_unlock();
# Line 39  Source code for this patch is https://ww Line 39  Source code for this patch is https://ww
39          if (ret >= 0) {          if (ret >= 0) {
40                  audit_bprm(bprm);                  audit_bprm(bprm);
41                  trace_sched_process_exec(current, old_pid, bprm);                  trace_sched_process_exec(current, old_pid, bprm);
42  --- linux-5.4.45.orig/fs/open.c  --- linux-5.4.46.orig/fs/open.c
43  +++ linux-5.4.45/fs/open.c  +++ linux-5.4.46/fs/open.c
44  @@ -1205,6 +1205,8 @@ SYSCALL_DEFINE1(close, unsigned int, fd)  @@ -1205,6 +1205,8 @@ SYSCALL_DEFINE1(close, unsigned int, fd)
45    */    */
46   SYSCALL_DEFINE0(vhangup)   SYSCALL_DEFINE0(vhangup)
# Line 50  Source code for this patch is https://ww Line 50  Source code for this patch is https://ww
50          if (capable(CAP_SYS_TTY_CONFIG)) {          if (capable(CAP_SYS_TTY_CONFIG)) {
51                  tty_vhangup_self();                  tty_vhangup_self();
52                  return 0;                  return 0;
53  --- linux-5.4.45.orig/fs/proc/version.c  --- linux-5.4.46.orig/fs/proc/version.c
54  +++ linux-5.4.45/fs/proc/version.c  +++ linux-5.4.46/fs/proc/version.c
55  @@ -21,3 +21,10 @@ static int __init proc_version_init(void  @@ -21,3 +21,10 @@ static int __init proc_version_init(void
56          return 0;          return 0;
57   }   }
# Line 59  Source code for this patch is https://ww Line 59  Source code for this patch is https://ww
59  +  +
60  +static int __init ccs_show_version(void)  +static int __init ccs_show_version(void)
61  +{  +{
62  +       printk(KERN_INFO "Hook version: 5.4.45 2020/06/09\n");  +       printk(KERN_INFO "Hook version: 5.4.46 2020/06/16\n");
63  +       return 0;  +       return 0;
64  +}  +}
65  +fs_initcall(ccs_show_version);  +fs_initcall(ccs_show_version);
66  --- linux-5.4.45.orig/include/linux/sched.h  --- linux-5.4.46.orig/include/linux/sched.h
67  +++ linux-5.4.45/include/linux/sched.h  +++ linux-5.4.46/include/linux/sched.h
68  @@ -38,6 +38,7 @@ struct backing_dev_info;  @@ -38,6 +38,7 @@ struct backing_dev_info;
69   struct bio_list;   struct bio_list;
70   struct blk_plug;   struct blk_plug;
# Line 84  Source code for this patch is https://ww Line 84  Source code for this patch is https://ww
84    
85   #ifdef CONFIG_GCC_PLUGIN_STACKLEAK   #ifdef CONFIG_GCC_PLUGIN_STACKLEAK
86          unsigned long                   lowest_stack;          unsigned long                   lowest_stack;
87  --- linux-5.4.45.orig/include/linux/security.h  --- linux-5.4.46.orig/include/linux/security.h
88  +++ linux-5.4.45/include/linux/security.h  +++ linux-5.4.46/include/linux/security.h
89  @@ -57,6 +57,7 @@ struct mm_struct;  @@ -57,6 +57,7 @@ struct mm_struct;
90   struct fs_context;   struct fs_context;
91   struct fs_parameter;   struct fs_parameter;
# Line 315  Source code for this patch is https://ww Line 315  Source code for this patch is https://ww
315   }   }
316   #endif /* CONFIG_SECURITY_PATH */   #endif /* CONFIG_SECURITY_PATH */
317    
318  --- linux-5.4.45.orig/include/net/ip.h  --- linux-5.4.46.orig/include/net/ip.h
319  +++ linux-5.4.45/include/net/ip.h  +++ linux-5.4.46/include/net/ip.h
320  @@ -341,6 +341,8 @@ void inet_get_local_port_range(struct ne  @@ -341,6 +341,8 @@ void inet_get_local_port_range(struct ne
321   #ifdef CONFIG_SYSCTL   #ifdef CONFIG_SYSCTL
322   static inline int inet_is_local_reserved_port(struct net *net, int port)   static inline int inet_is_local_reserved_port(struct net *net, int port)
# Line 335  Source code for this patch is https://ww Line 335  Source code for this patch is https://ww
335          return 0;          return 0;
336   }   }
337    
338  --- linux-5.4.45.orig/init/init_task.c  --- linux-5.4.46.orig/init/init_task.c
339  +++ linux-5.4.45/init/init_task.c  +++ linux-5.4.46/init/init_task.c
340  @@ -181,6 +181,10 @@ struct task_struct init_task  @@ -181,6 +181,10 @@ struct task_struct init_task
341   #ifdef CONFIG_SECURITY   #ifdef CONFIG_SECURITY
342          .security       = NULL,          .security       = NULL,
# Line 348  Source code for this patch is https://ww Line 348  Source code for this patch is https://ww
348   };   };
349   EXPORT_SYMBOL(init_task);   EXPORT_SYMBOL(init_task);
350    
351  --- linux-5.4.45.orig/kernel/kexec.c  --- linux-5.4.46.orig/kernel/kexec.c
352  +++ linux-5.4.45/kernel/kexec.c  +++ linux-5.4.46/kernel/kexec.c
353  @@ -16,7 +16,7 @@  @@ -16,7 +16,7 @@
354   #include <linux/syscalls.h>   #include <linux/syscalls.h>
355   #include <linux/vmalloc.h>   #include <linux/vmalloc.h>
# Line 368  Source code for this patch is https://ww Line 368  Source code for this patch is https://ww
368    
369          /* Permit LSMs and IMA to fail the kexec */          /* Permit LSMs and IMA to fail the kexec */
370          result = security_kernel_load_data(LOADING_KEXEC_IMAGE);          result = security_kernel_load_data(LOADING_KEXEC_IMAGE);
371  --- linux-5.4.45.orig/kernel/module.c  --- linux-5.4.46.orig/kernel/module.c
372  +++ linux-5.4.45/kernel/module.c  +++ linux-5.4.46/kernel/module.c
373  @@ -55,6 +55,7 @@  @@ -55,6 +55,7 @@
374   #include <linux/audit.h>   #include <linux/audit.h>
375   #include <uapi/linux/module.h>   #include <uapi/linux/module.h>
# Line 396  Source code for this patch is https://ww Line 396  Source code for this patch is https://ww
396    
397          return 0;          return 0;
398   }   }
399  --- linux-5.4.45.orig/kernel/ptrace.c  --- linux-5.4.46.orig/kernel/ptrace.c
400  +++ linux-5.4.45/kernel/ptrace.c  +++ linux-5.4.46/kernel/ptrace.c
401  @@ -1244,6 +1244,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l  @@ -1244,6 +1244,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l
402   {   {
403          struct task_struct *child;          struct task_struct *child;
# Line 422  Source code for this patch is https://ww Line 422  Source code for this patch is https://ww
422    
423          if (request == PTRACE_TRACEME) {          if (request == PTRACE_TRACEME) {
424                  ret = ptrace_traceme();                  ret = ptrace_traceme();
425  --- linux-5.4.45.orig/kernel/reboot.c  --- linux-5.4.46.orig/kernel/reboot.c
426  +++ linux-5.4.45/kernel/reboot.c  +++ linux-5.4.46/kernel/reboot.c
427  @@ -17,6 +17,7 @@  @@ -17,6 +17,7 @@
428   #include <linux/syscalls.h>   #include <linux/syscalls.h>
429   #include <linux/syscore_ops.h>   #include <linux/syscore_ops.h>
# Line 441  Source code for this patch is https://ww Line 441  Source code for this patch is https://ww
441    
442          /*          /*
443           * If pid namespaces are enabled and the current task is in a child           * If pid namespaces are enabled and the current task is in a child
444  --- linux-5.4.45.orig/kernel/sched/core.c  --- linux-5.4.46.orig/kernel/sched/core.c
445  +++ linux-5.4.45/kernel/sched/core.c  +++ linux-5.4.46/kernel/sched/core.c
446  @@ -4571,6 +4571,8 @@ int can_nice(const struct task_struct *p  @@ -4571,6 +4571,8 @@ int can_nice(const struct task_struct *p
447   SYSCALL_DEFINE1(nice, int, increment)   SYSCALL_DEFINE1(nice, int, increment)
448   {   {
# Line 452  Source code for this patch is https://ww Line 452  Source code for this patch is https://ww
452    
453          /*          /*
454           * Setpriority might change our priority at the same moment.           * Setpriority might change our priority at the same moment.
455  --- linux-5.4.45.orig/kernel/signal.c  --- linux-5.4.46.orig/kernel/signal.c
456  +++ linux-5.4.45/kernel/signal.c  +++ linux-5.4.46/kernel/signal.c
457  @@ -3643,6 +3643,8 @@ static inline void prepare_kill_siginfo(  @@ -3643,6 +3643,8 @@ static inline void prepare_kill_siginfo(
458   SYSCALL_DEFINE2(kill, pid_t, pid, int, sig)   SYSCALL_DEFINE2(kill, pid_t, pid, int, sig)
459   {   {
# Line 521  Source code for this patch is https://ww Line 521  Source code for this patch is https://ww
521    
522          return do_send_specific(tgid, pid, sig, info);          return do_send_specific(tgid, pid, sig, info);
523   }   }
524  --- linux-5.4.45.orig/kernel/sys.c  --- linux-5.4.46.orig/kernel/sys.c
525  +++ linux-5.4.45/kernel/sys.c  +++ linux-5.4.46/kernel/sys.c
526  @@ -204,6 +204,10 @@ SYSCALL_DEFINE3(setpriority, int, which,  @@ -204,6 +204,10 @@ SYSCALL_DEFINE3(setpriority, int, which,
527    
528          if (which > PRIO_USER || which < PRIO_PROCESS)          if (which > PRIO_USER || which < PRIO_PROCESS)
# Line 552  Source code for this patch is https://ww Line 552  Source code for this patch is https://ww
552    
553          errno = -EFAULT;          errno = -EFAULT;
554          if (!copy_from_user(tmp, name, len)) {          if (!copy_from_user(tmp, name, len)) {
555  --- linux-5.4.45.orig/kernel/time/timekeeping.c  --- linux-5.4.46.orig/kernel/time/timekeeping.c
556  +++ linux-5.4.45/kernel/time/timekeeping.c  +++ linux-5.4.46/kernel/time/timekeeping.c
557  @@ -22,6 +22,7 @@  @@ -22,6 +22,7 @@
558   #include <linux/pvclock_gtod.h>   #include <linux/pvclock_gtod.h>
559   #include <linux/compiler.h>   #include <linux/compiler.h>
# Line 587  Source code for this patch is https://ww Line 587  Source code for this patch is https://ww
587    
588                  /*                  /*
589                   * Validate if a timespec/timeval used to inject a time                   * Validate if a timespec/timeval used to inject a time
590  --- linux-5.4.45.orig/net/ipv4/raw.c  --- linux-5.4.46.orig/net/ipv4/raw.c
591  +++ linux-5.4.45/net/ipv4/raw.c  +++ linux-5.4.46/net/ipv4/raw.c
592  @@ -767,6 +767,10 @@ static int raw_recvmsg(struct sock *sk,  @@ -767,6 +767,10 @@ static int raw_recvmsg(struct sock *sk,
593          skb = skb_recv_datagram(sk, flags, noblock, &err);          skb = skb_recv_datagram(sk, flags, noblock, &err);
594          if (!skb)          if (!skb)
# Line 600  Source code for this patch is https://ww Line 600  Source code for this patch is https://ww
600    
601          copied = skb->len;          copied = skb->len;
602          if (len < copied) {          if (len < copied) {
603  --- linux-5.4.45.orig/net/ipv4/udp.c  --- linux-5.4.46.orig/net/ipv4/udp.c
604  +++ linux-5.4.45/net/ipv4/udp.c  +++ linux-5.4.46/net/ipv4/udp.c
605  @@ -1741,6 +1741,8 @@ try_again:  @@ -1741,6 +1741,8 @@ try_again:
606          skb = __skb_recv_udp(sk, flags, noblock, &off, &err);          skb = __skb_recv_udp(sk, flags, noblock, &off, &err);
607          if (!skb)          if (!skb)
# Line 611  Source code for this patch is https://ww Line 611  Source code for this patch is https://ww
611    
612          ulen = udp_skb_len(skb);          ulen = udp_skb_len(skb);
613          copied = len;          copied = len;
614  --- linux-5.4.45.orig/net/ipv6/raw.c  --- linux-5.4.46.orig/net/ipv6/raw.c
615  +++ linux-5.4.45/net/ipv6/raw.c  +++ linux-5.4.46/net/ipv6/raw.c
616  @@ -480,6 +480,10 @@ static int rawv6_recvmsg(struct sock *sk  @@ -480,6 +480,10 @@ static int rawv6_recvmsg(struct sock *sk
617          skb = skb_recv_datagram(sk, flags, noblock, &err);          skb = skb_recv_datagram(sk, flags, noblock, &err);
618          if (!skb)          if (!skb)
# Line 624  Source code for this patch is https://ww Line 624  Source code for this patch is https://ww
624    
625          copied = skb->len;          copied = skb->len;
626          if (copied > len) {          if (copied > len) {
627  --- linux-5.4.45.orig/net/ipv6/udp.c  --- linux-5.4.46.orig/net/ipv6/udp.c
628  +++ linux-5.4.45/net/ipv6/udp.c  +++ linux-5.4.46/net/ipv6/udp.c
629  @@ -288,6 +288,8 @@ try_again:  @@ -288,6 +288,8 @@ try_again:
630          skb = __skb_recv_udp(sk, flags, noblock, &off, &err);          skb = __skb_recv_udp(sk, flags, noblock, &off, &err);
631          if (!skb)          if (!skb)
# Line 635  Source code for this patch is https://ww Line 635  Source code for this patch is https://ww
635    
636          ulen = udp6_skb_len(skb);          ulen = udp6_skb_len(skb);
637          copied = len;          copied = len;
638  --- linux-5.4.45.orig/net/socket.c  --- linux-5.4.46.orig/net/socket.c
639  +++ linux-5.4.45/net/socket.c  +++ linux-5.4.46/net/socket.c
640  @@ -1755,6 +1755,10 @@ int __sys_accept4(int fd, struct sockadd  @@ -1755,6 +1755,10 @@ int __sys_accept4(int fd, struct sockadd
641          if (err < 0)          if (err < 0)
642                  goto out_fd;                  goto out_fd;
# Line 648  Source code for this patch is https://ww Line 648  Source code for this patch is https://ww
648          if (upeer_sockaddr) {          if (upeer_sockaddr) {
649                  len = newsock->ops->getname(newsock,                  len = newsock->ops->getname(newsock,
650                                          (struct sockaddr *)&address, 2);                                          (struct sockaddr *)&address, 2);
651  --- linux-5.4.45.orig/net/unix/af_unix.c  --- linux-5.4.46.orig/net/unix/af_unix.c
652  +++ linux-5.4.45/net/unix/af_unix.c  +++ linux-5.4.46/net/unix/af_unix.c
653  @@ -2087,6 +2087,10 @@ static int unix_dgram_recvmsg(struct soc  @@ -2087,6 +2087,10 @@ static int unix_dgram_recvmsg(struct soc
654                                                  EPOLLOUT | EPOLLWRNORM |                                                  EPOLLOUT | EPOLLWRNORM |
655                                                  EPOLLWRBAND);                                                  EPOLLWRBAND);
# Line 669  Source code for this patch is https://ww Line 669  Source code for this patch is https://ww
669          mutex_unlock(&u->iolock);          mutex_unlock(&u->iolock);
670   out:   out:
671          return err;          return err;
672  --- linux-5.4.45.orig/security/Kconfig  --- linux-5.4.46.orig/security/Kconfig
673  +++ linux-5.4.45/security/Kconfig  +++ linux-5.4.46/security/Kconfig
674  @@ -291,5 +291,7 @@ config LSM  @@ -291,5 +291,7 @@ config LSM
675    
676   source "security/Kconfig.hardening"   source "security/Kconfig.hardening"
# Line 679  Source code for this patch is https://ww Line 679  Source code for this patch is https://ww
679  +  +
680   endmenu   endmenu
681    
682  --- linux-5.4.45.orig/security/Makefile  --- linux-5.4.46.orig/security/Makefile
683  +++ linux-5.4.45/security/Makefile  +++ linux-5.4.46/security/Makefile
684  @@ -34,3 +34,6 @@ obj-$(CONFIG_CGROUP_DEVICE)           += device_c  @@ -34,3 +34,6 @@ obj-$(CONFIG_CGROUP_DEVICE)           += device_c
685   # Object integrity file lists   # Object integrity file lists
686   subdir-$(CONFIG_INTEGRITY)             += integrity   subdir-$(CONFIG_INTEGRITY)             += integrity
# Line 688  Source code for this patch is https://ww Line 688  Source code for this patch is https://ww
688  +  +
689  +subdir-$(CONFIG_CCSECURITY)            += ccsecurity  +subdir-$(CONFIG_CCSECURITY)            += ccsecurity
690  +obj-$(CONFIG_CCSECURITY)               += ccsecurity/  +obj-$(CONFIG_CCSECURITY)               += ccsecurity/
691  --- linux-5.4.45.orig/security/security.c  --- linux-5.4.46.orig/security/security.c
692  +++ linux-5.4.45/security/security.c  +++ linux-5.4.46/security/security.c
693  @@ -1507,7 +1507,9 @@ int security_task_alloc(struct task_stru  @@ -1507,7 +1507,9 @@ int security_task_alloc(struct task_stru
694    
695          if (rc)          if (rc)

Legend:
Removed from v.309  
changed lines
  Added in v.311

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