(empty log message)
@@ -1,6 +1,6 @@ | ||
1 | -This is TOMOYO Linux patch for kernel 4.19.260. | |
1 | +This is TOMOYO Linux patch for kernel 4.19.261. | |
2 | 2 | |
3 | -Source code for this patch is https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.19.260.tar.xz | |
3 | +Source code for this patch is https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.19.261.tar.xz | |
4 | 4 | --- |
5 | 5 | fs/exec.c | 2 - |
6 | 6 | fs/open.c | 2 + |
@@ -28,8 +28,8 @@ | ||
28 | 28 | security/security.c | 9 +++++- |
29 | 29 | 24 files changed, 148 insertions(+), 29 deletions(-) |
30 | 30 | |
31 | ---- linux-4.19.260.orig/fs/exec.c | |
32 | -+++ linux-4.19.260/fs/exec.c | |
31 | +--- linux-4.19.261.orig/fs/exec.c | |
32 | ++++ linux-4.19.261/fs/exec.c | |
33 | 33 | @@ -1707,7 +1707,7 @@ static int exec_binprm(struct linux_binp |
34 | 34 | old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent)); |
35 | 35 | rcu_read_unlock(); |
@@ -39,8 +39,8 @@ | ||
39 | 39 | if (ret >= 0) { |
40 | 40 | audit_bprm(bprm); |
41 | 41 | trace_sched_process_exec(current, old_pid, bprm); |
42 | ---- linux-4.19.260.orig/fs/open.c | |
43 | -+++ linux-4.19.260/fs/open.c | |
42 | +--- linux-4.19.261.orig/fs/open.c | |
43 | ++++ linux-4.19.261/fs/open.c | |
44 | 44 | @@ -1196,6 +1196,8 @@ SYSCALL_DEFINE1(close, unsigned int, fd) |
45 | 45 | */ |
46 | 46 | SYSCALL_DEFINE0(vhangup) |
@@ -50,8 +50,8 @@ | ||
50 | 50 | if (capable(CAP_SYS_TTY_CONFIG)) { |
51 | 51 | tty_vhangup_self(); |
52 | 52 | return 0; |
53 | ---- linux-4.19.260.orig/fs/proc/version.c | |
54 | -+++ linux-4.19.260/fs/proc/version.c | |
53 | +--- linux-4.19.261.orig/fs/proc/version.c | |
54 | ++++ linux-4.19.261/fs/proc/version.c | |
55 | 55 | @@ -21,3 +21,10 @@ static int __init proc_version_init(void |
56 | 56 | return 0; |
57 | 57 | } |
@@ -59,12 +59,12 @@ | ||
59 | 59 | + |
60 | 60 | +static int __init ccs_show_version(void) |
61 | 61 | +{ |
62 | -+ printk(KERN_INFO "Hook version: 4.19.260 2022/10/04\n"); | |
62 | ++ printk(KERN_INFO "Hook version: 4.19.261 2022/10/24\n"); | |
63 | 63 | + return 0; |
64 | 64 | +} |
65 | 65 | +fs_initcall(ccs_show_version); |
66 | ---- linux-4.19.260.orig/include/linux/sched.h | |
67 | -+++ linux-4.19.260/include/linux/sched.h | |
66 | +--- linux-4.19.261.orig/include/linux/sched.h | |
67 | ++++ linux-4.19.261/include/linux/sched.h | |
68 | 68 | @@ -34,6 +34,7 @@ struct audit_context; |
69 | 69 | struct backing_dev_info; |
70 | 70 | struct bio_list; |
@@ -84,8 +84,8 @@ | ||
84 | 84 | |
85 | 85 | /* |
86 | 86 | * New fields for task_struct should be added above here, so that |
87 | ---- linux-4.19.260.orig/include/linux/security.h | |
88 | -+++ linux-4.19.260/include/linux/security.h | |
87 | +--- linux-4.19.261.orig/include/linux/security.h | |
88 | ++++ linux-4.19.261/include/linux/security.h | |
89 | 89 | @@ -53,6 +53,7 @@ struct msg_msg; |
90 | 90 | struct xattr; |
91 | 91 | struct xfrm_sec_ctx; |
@@ -306,8 +306,8 @@ | ||
306 | 306 | } |
307 | 307 | #endif /* CONFIG_SECURITY_PATH */ |
308 | 308 | |
309 | ---- linux-4.19.260.orig/include/net/ip.h | |
310 | -+++ linux-4.19.260/include/net/ip.h | |
309 | +--- linux-4.19.261.orig/include/net/ip.h | |
310 | ++++ linux-4.19.261/include/net/ip.h | |
311 | 311 | @@ -302,6 +302,8 @@ void inet_get_local_port_range(struct ne |
312 | 312 | #ifdef CONFIG_SYSCTL |
313 | 313 | static inline int inet_is_local_reserved_port(struct net *net, int port) |
@@ -326,8 +326,8 @@ | ||
326 | 326 | return 0; |
327 | 327 | } |
328 | 328 | |
329 | ---- linux-4.19.260.orig/init/init_task.c | |
330 | -+++ linux-4.19.260/init/init_task.c | |
329 | +--- linux-4.19.261.orig/init/init_task.c | |
330 | ++++ linux-4.19.261/init/init_task.c | |
331 | 331 | @@ -180,6 +180,10 @@ struct task_struct init_task |
332 | 332 | #ifdef CONFIG_SECURITY |
333 | 333 | .security = NULL, |
@@ -339,8 +339,8 @@ | ||
339 | 339 | }; |
340 | 340 | EXPORT_SYMBOL(init_task); |
341 | 341 | |
342 | ---- linux-4.19.260.orig/kernel/kexec.c | |
343 | -+++ linux-4.19.260/kernel/kexec.c | |
342 | +--- linux-4.19.261.orig/kernel/kexec.c | |
343 | ++++ linux-4.19.261/kernel/kexec.c | |
344 | 344 | @@ -18,7 +18,7 @@ |
345 | 345 | #include <linux/syscalls.h> |
346 | 346 | #include <linux/vmalloc.h> |
@@ -359,8 +359,8 @@ | ||
359 | 359 | |
360 | 360 | /* Permit LSMs and IMA to fail the kexec */ |
361 | 361 | result = security_kernel_load_data(LOADING_KEXEC_IMAGE); |
362 | ---- linux-4.19.260.orig/kernel/module.c | |
363 | -+++ linux-4.19.260/kernel/module.c | |
362 | +--- linux-4.19.261.orig/kernel/module.c | |
363 | ++++ linux-4.19.261/kernel/module.c | |
364 | 364 | @@ -66,6 +66,7 @@ |
365 | 365 | #include <linux/audit.h> |
366 | 366 | #include <uapi/linux/module.h> |
@@ -387,8 +387,8 @@ | ||
387 | 387 | |
388 | 388 | return 0; |
389 | 389 | } |
390 | ---- linux-4.19.260.orig/kernel/ptrace.c | |
391 | -+++ linux-4.19.260/kernel/ptrace.c | |
390 | +--- linux-4.19.261.orig/kernel/ptrace.c | |
391 | ++++ linux-4.19.261/kernel/ptrace.c | |
392 | 392 | @@ -1168,6 +1168,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l |
393 | 393 | { |
394 | 394 | struct task_struct *child; |
@@ -413,8 +413,8 @@ | ||
413 | 413 | |
414 | 414 | if (request == PTRACE_TRACEME) { |
415 | 415 | ret = ptrace_traceme(); |
416 | ---- linux-4.19.260.orig/kernel/reboot.c | |
417 | -+++ linux-4.19.260/kernel/reboot.c | |
416 | +--- linux-4.19.261.orig/kernel/reboot.c | |
417 | ++++ linux-4.19.261/kernel/reboot.c | |
418 | 418 | @@ -16,6 +16,7 @@ |
419 | 419 | #include <linux/syscalls.h> |
420 | 420 | #include <linux/syscore_ops.h> |
@@ -432,8 +432,8 @@ | ||
432 | 432 | |
433 | 433 | /* |
434 | 434 | * If pid namespaces are enabled and the current task is in a child |
435 | ---- linux-4.19.260.orig/kernel/sched/core.c | |
436 | -+++ linux-4.19.260/kernel/sched/core.c | |
435 | +--- linux-4.19.261.orig/kernel/sched/core.c | |
436 | ++++ linux-4.19.261/kernel/sched/core.c | |
437 | 437 | @@ -3993,6 +3993,8 @@ int can_nice(const struct task_struct *p |
438 | 438 | SYSCALL_DEFINE1(nice, int, increment) |
439 | 439 | { |
@@ -443,8 +443,8 @@ | ||
443 | 443 | |
444 | 444 | /* |
445 | 445 | * Setpriority might change our priority at the same moment. |
446 | ---- linux-4.19.260.orig/kernel/signal.c | |
447 | -+++ linux-4.19.260/kernel/signal.c | |
446 | +--- linux-4.19.261.orig/kernel/signal.c | |
447 | ++++ linux-4.19.261/kernel/signal.c | |
448 | 448 | @@ -3276,6 +3276,8 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, |
449 | 449 | SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
450 | 450 | { |
@@ -490,8 +490,8 @@ | ||
490 | 490 | |
491 | 491 | return do_send_specific(tgid, pid, sig, info); |
492 | 492 | } |
493 | ---- linux-4.19.260.orig/kernel/sys.c | |
494 | -+++ linux-4.19.260/kernel/sys.c | |
493 | +--- linux-4.19.261.orig/kernel/sys.c | |
494 | ++++ linux-4.19.261/kernel/sys.c | |
495 | 495 | @@ -201,6 +201,10 @@ SYSCALL_DEFINE3(setpriority, int, which, |
496 | 496 | |
497 | 497 | if (which > PRIO_USER || which < PRIO_PROCESS) |
@@ -521,8 +521,8 @@ | ||
521 | 521 | |
522 | 522 | errno = -EFAULT; |
523 | 523 | if (!copy_from_user(tmp, name, len)) { |
524 | ---- linux-4.19.260.orig/kernel/time/timekeeping.c | |
525 | -+++ linux-4.19.260/kernel/time/timekeeping.c | |
524 | +--- linux-4.19.261.orig/kernel/time/timekeeping.c | |
525 | ++++ linux-4.19.261/kernel/time/timekeeping.c | |
526 | 526 | @@ -27,6 +27,7 @@ |
527 | 527 | #include <linux/stop_machine.h> |
528 | 528 | #include <linux/pvclock_gtod.h> |
@@ -556,8 +556,8 @@ | ||
556 | 556 | |
557 | 557 | /* |
558 | 558 | * Validate if a timespec/timeval used to inject a time |
559 | ---- linux-4.19.260.orig/net/ipv4/raw.c | |
560 | -+++ linux-4.19.260/net/ipv4/raw.c | |
559 | +--- linux-4.19.261.orig/net/ipv4/raw.c | |
560 | ++++ linux-4.19.261/net/ipv4/raw.c | |
561 | 561 | @@ -775,6 +775,10 @@ static int raw_recvmsg(struct sock *sk, |
562 | 562 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
563 | 563 | if (!skb) |
@@ -569,8 +569,8 @@ | ||
569 | 569 | |
570 | 570 | copied = skb->len; |
571 | 571 | if (len < copied) { |
572 | ---- linux-4.19.260.orig/net/ipv4/udp.c | |
573 | -+++ linux-4.19.260/net/ipv4/udp.c | |
572 | +--- linux-4.19.261.orig/net/ipv4/udp.c | |
573 | ++++ linux-4.19.261/net/ipv4/udp.c | |
574 | 574 | @@ -1686,6 +1686,8 @@ try_again: |
575 | 575 | skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err); |
576 | 576 | if (!skb) |
@@ -580,8 +580,8 @@ | ||
580 | 580 | |
581 | 581 | ulen = udp_skb_len(skb); |
582 | 582 | copied = len; |
583 | ---- linux-4.19.260.orig/net/ipv6/raw.c | |
584 | -+++ linux-4.19.260/net/ipv6/raw.c | |
583 | +--- linux-4.19.261.orig/net/ipv6/raw.c | |
584 | ++++ linux-4.19.261/net/ipv6/raw.c | |
585 | 585 | @@ -485,6 +485,10 @@ static int rawv6_recvmsg(struct sock *sk |
586 | 586 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
587 | 587 | if (!skb) |
@@ -593,8 +593,8 @@ | ||
593 | 593 | |
594 | 594 | copied = skb->len; |
595 | 595 | if (copied > len) { |
596 | ---- linux-4.19.260.orig/net/ipv6/udp.c | |
597 | -+++ linux-4.19.260/net/ipv6/udp.c | |
596 | +--- linux-4.19.261.orig/net/ipv6/udp.c | |
597 | ++++ linux-4.19.261/net/ipv6/udp.c | |
598 | 598 | @@ -347,6 +347,8 @@ try_again: |
599 | 599 | skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err); |
600 | 600 | if (!skb) |
@@ -604,8 +604,8 @@ | ||
604 | 604 | |
605 | 605 | ulen = udp6_skb_len(skb); |
606 | 606 | copied = len; |
607 | ---- linux-4.19.260.orig/net/socket.c | |
608 | -+++ linux-4.19.260/net/socket.c | |
607 | +--- linux-4.19.261.orig/net/socket.c | |
608 | ++++ linux-4.19.261/net/socket.c | |
609 | 609 | @@ -1702,6 +1702,10 @@ int __sys_accept4(int fd, struct sockadd |
610 | 610 | if (err < 0) |
611 | 611 | goto out_fd; |
@@ -617,8 +617,8 @@ | ||
617 | 617 | if (upeer_sockaddr) { |
618 | 618 | len = newsock->ops->getname(newsock, |
619 | 619 | (struct sockaddr *)&address, 2); |
620 | ---- linux-4.19.260.orig/net/unix/af_unix.c | |
621 | -+++ linux-4.19.260/net/unix/af_unix.c | |
620 | +--- linux-4.19.261.orig/net/unix/af_unix.c | |
621 | ++++ linux-4.19.261/net/unix/af_unix.c | |
622 | 622 | @@ -2169,6 +2169,10 @@ static int unix_dgram_recvmsg(struct soc |
623 | 623 | EPOLLOUT | EPOLLWRNORM | |
624 | 624 | EPOLLWRBAND); |
@@ -638,8 +638,8 @@ | ||
638 | 638 | mutex_unlock(&u->iolock); |
639 | 639 | out: |
640 | 640 | return err; |
641 | ---- linux-4.19.260.orig/security/Kconfig | |
642 | -+++ linux-4.19.260/security/Kconfig | |
641 | +--- linux-4.19.261.orig/security/Kconfig | |
642 | ++++ linux-4.19.261/security/Kconfig | |
643 | 643 | @@ -279,5 +279,7 @@ config DEFAULT_SECURITY |
644 | 644 | default "apparmor" if DEFAULT_SECURITY_APPARMOR |
645 | 645 | default "" if DEFAULT_SECURITY_DAC |
@@ -648,8 +648,8 @@ | ||
648 | 648 | + |
649 | 649 | endmenu |
650 | 650 | |
651 | ---- linux-4.19.260.orig/security/Makefile | |
652 | -+++ linux-4.19.260/security/Makefile | |
651 | +--- linux-4.19.261.orig/security/Makefile | |
652 | ++++ linux-4.19.261/security/Makefile | |
653 | 653 | @@ -30,3 +30,6 @@ obj-$(CONFIG_CGROUP_DEVICE) += device_c |
654 | 654 | # Object integrity file lists |
655 | 655 | subdir-$(CONFIG_INTEGRITY) += integrity |
@@ -657,8 +657,8 @@ | ||
657 | 657 | + |
658 | 658 | +subdir-$(CONFIG_CCSECURITY) += ccsecurity |
659 | 659 | +obj-$(CONFIG_CCSECURITY) += ccsecurity/ |
660 | ---- linux-4.19.260.orig/security/security.c | |
661 | -+++ linux-4.19.260/security/security.c | |
660 | +--- linux-4.19.261.orig/security/security.c | |
661 | ++++ linux-4.19.261/security/security.c | |
662 | 662 | @@ -984,12 +984,19 @@ int security_file_open(struct file *file |
663 | 663 | |
664 | 664 | int security_task_alloc(struct task_struct *task, unsigned long clone_flags) |
@@ -1,6 +1,6 @@ | ||
1 | -This is TOMOYO Linux patch for kernel 5.10.146. | |
1 | +This is TOMOYO Linux patch for kernel 5.10.149. | |
2 | 2 | |
3 | -Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.146.tar.xz | |
3 | +Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.149.tar.xz | |
4 | 4 | --- |
5 | 5 | fs/exec.c | 2 - |
6 | 6 | fs/open.c | 2 + |
@@ -28,8 +28,8 @@ | ||
28 | 28 | security/security.c | 5 ++- |
29 | 29 | 24 files changed, 160 insertions(+), 30 deletions(-) |
30 | 30 | |
31 | ---- linux-5.10.146.orig/fs/exec.c | |
32 | -+++ linux-5.10.146/fs/exec.c | |
31 | +--- linux-5.10.149.orig/fs/exec.c | |
32 | ++++ linux-5.10.149/fs/exec.c | |
33 | 33 | @@ -1826,7 +1826,7 @@ static int bprm_execve(struct linux_binp |
34 | 34 | if (retval) |
35 | 35 | goto out; |
@@ -39,8 +39,8 @@ | ||
39 | 39 | if (retval < 0) |
40 | 40 | goto out; |
41 | 41 | |
42 | ---- linux-5.10.146.orig/fs/open.c | |
43 | -+++ linux-5.10.146/fs/open.c | |
42 | +--- linux-5.10.149.orig/fs/open.c | |
43 | ++++ linux-5.10.149/fs/open.c | |
44 | 44 | @@ -1339,6 +1339,8 @@ SYSCALL_DEFINE3(close_range, unsigned in |
45 | 45 | */ |
46 | 46 | SYSCALL_DEFINE0(vhangup) |
@@ -50,8 +50,8 @@ | ||
50 | 50 | if (capable(CAP_SYS_TTY_CONFIG)) { |
51 | 51 | tty_vhangup_self(); |
52 | 52 | return 0; |
53 | ---- linux-5.10.146.orig/fs/proc/version.c | |
54 | -+++ linux-5.10.146/fs/proc/version.c | |
53 | +--- linux-5.10.149.orig/fs/proc/version.c | |
54 | ++++ linux-5.10.149/fs/proc/version.c | |
55 | 55 | @@ -21,3 +21,10 @@ static int __init proc_version_init(void |
56 | 56 | return 0; |
57 | 57 | } |
@@ -59,12 +59,12 @@ | ||
59 | 59 | + |
60 | 60 | +static int __init ccs_show_version(void) |
61 | 61 | +{ |
62 | -+ printk(KERN_INFO "Hook version: 5.10.146 2022/10/04\n"); | |
62 | ++ printk(KERN_INFO "Hook version: 5.10.149 2022/10/24\n"); | |
63 | 63 | + return 0; |
64 | 64 | +} |
65 | 65 | +fs_initcall(ccs_show_version); |
66 | ---- linux-5.10.146.orig/include/linux/sched.h | |
67 | -+++ linux-5.10.146/include/linux/sched.h | |
66 | +--- linux-5.10.149.orig/include/linux/sched.h | |
67 | ++++ linux-5.10.149/include/linux/sched.h | |
68 | 68 | @@ -41,6 +41,7 @@ struct backing_dev_info; |
69 | 69 | struct bio_list; |
70 | 70 | struct blk_plug; |
@@ -84,8 +84,8 @@ | ||
84 | 84 | |
85 | 85 | #ifdef CONFIG_GCC_PLUGIN_STACKLEAK |
86 | 86 | unsigned long lowest_stack; |
87 | ---- linux-5.10.146.orig/include/linux/security.h | |
88 | -+++ linux-5.10.146/include/linux/security.h | |
87 | +--- linux-5.10.149.orig/include/linux/security.h | |
88 | ++++ linux-5.10.149/include/linux/security.h | |
89 | 89 | @@ -59,6 +59,7 @@ struct fs_parameter; |
90 | 90 | enum fs_value_type; |
91 | 91 | struct watch; |
@@ -315,8 +315,8 @@ | ||
315 | 315 | } |
316 | 316 | #endif /* CONFIG_SECURITY_PATH */ |
317 | 317 | |
318 | ---- linux-5.10.146.orig/include/net/ip.h | |
319 | -+++ linux-5.10.146/include/net/ip.h | |
318 | +--- linux-5.10.149.orig/include/net/ip.h | |
319 | ++++ linux-5.10.149/include/net/ip.h | |
320 | 320 | @@ -340,6 +340,8 @@ void inet_get_local_port_range(struct ne |
321 | 321 | #ifdef CONFIG_SYSCTL |
322 | 322 | static inline bool inet_is_local_reserved_port(struct net *net, unsigned short port) |
@@ -335,8 +335,8 @@ | ||
335 | 335 | return false; |
336 | 336 | } |
337 | 337 | |
338 | ---- linux-5.10.146.orig/init/init_task.c | |
339 | -+++ linux-5.10.146/init/init_task.c | |
338 | +--- linux-5.10.149.orig/init/init_task.c | |
339 | ++++ linux-5.10.149/init/init_task.c | |
340 | 340 | @@ -213,6 +213,10 @@ struct task_struct init_task |
341 | 341 | #ifdef CONFIG_SECCOMP_FILTER |
342 | 342 | .seccomp = { .filter_count = ATOMIC_INIT(0) }, |
@@ -348,8 +348,8 @@ | ||
348 | 348 | }; |
349 | 349 | EXPORT_SYMBOL(init_task); |
350 | 350 | |
351 | ---- linux-5.10.146.orig/kernel/kexec.c | |
352 | -+++ linux-5.10.146/kernel/kexec.c | |
351 | +--- linux-5.10.149.orig/kernel/kexec.c | |
352 | ++++ linux-5.10.149/kernel/kexec.c | |
353 | 353 | @@ -16,7 +16,7 @@ |
354 | 354 | #include <linux/syscalls.h> |
355 | 355 | #include <linux/vmalloc.h> |
@@ -368,8 +368,8 @@ | ||
368 | 368 | |
369 | 369 | /* Permit LSMs and IMA to fail the kexec */ |
370 | 370 | result = security_kernel_load_data(LOADING_KEXEC_IMAGE, false); |
371 | ---- linux-5.10.146.orig/kernel/module.c | |
372 | -+++ linux-5.10.146/kernel/module.c | |
371 | +--- linux-5.10.149.orig/kernel/module.c | |
372 | ++++ linux-5.10.149/kernel/module.c | |
373 | 373 | @@ -59,6 +59,7 @@ |
374 | 374 | #include <linux/audit.h> |
375 | 375 | #include <uapi/linux/module.h> |
@@ -396,8 +396,8 @@ | ||
396 | 396 | |
397 | 397 | return 0; |
398 | 398 | } |
399 | ---- linux-5.10.146.orig/kernel/ptrace.c | |
400 | -+++ linux-5.10.146/kernel/ptrace.c | |
399 | +--- linux-5.10.149.orig/kernel/ptrace.c | |
400 | ++++ linux-5.10.149/kernel/ptrace.c | |
401 | 401 | @@ -1270,6 +1270,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l |
402 | 402 | { |
403 | 403 | struct task_struct *child; |
@@ -422,8 +422,8 @@ | ||
422 | 422 | |
423 | 423 | if (request == PTRACE_TRACEME) { |
424 | 424 | ret = ptrace_traceme(); |
425 | ---- linux-5.10.146.orig/kernel/reboot.c | |
426 | -+++ linux-5.10.146/kernel/reboot.c | |
425 | +--- linux-5.10.149.orig/kernel/reboot.c | |
426 | ++++ linux-5.10.149/kernel/reboot.c | |
427 | 427 | @@ -17,6 +17,7 @@ |
428 | 428 | #include <linux/syscalls.h> |
429 | 429 | #include <linux/syscore_ops.h> |
@@ -441,8 +441,8 @@ | ||
441 | 441 | |
442 | 442 | /* |
443 | 443 | * If pid namespaces are enabled and the current task is in a child |
444 | ---- linux-5.10.146.orig/kernel/sched/core.c | |
445 | -+++ linux-5.10.146/kernel/sched/core.c | |
444 | +--- linux-5.10.149.orig/kernel/sched/core.c | |
445 | ++++ linux-5.10.149/kernel/sched/core.c | |
446 | 446 | @@ -5062,6 +5062,8 @@ int can_nice(const struct task_struct *p |
447 | 447 | SYSCALL_DEFINE1(nice, int, increment) |
448 | 448 | { |
@@ -452,8 +452,8 @@ | ||
452 | 452 | |
453 | 453 | /* |
454 | 454 | * Setpriority might change our priority at the same moment. |
455 | ---- linux-5.10.146.orig/kernel/signal.c | |
456 | -+++ linux-5.10.146/kernel/signal.c | |
455 | +--- linux-5.10.149.orig/kernel/signal.c | |
456 | ++++ linux-5.10.149/kernel/signal.c | |
457 | 457 | @@ -3648,6 +3648,8 @@ static inline void prepare_kill_siginfo( |
458 | 458 | SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
459 | 459 | { |
@@ -521,8 +521,8 @@ | ||
521 | 521 | |
522 | 522 | return do_send_specific(tgid, pid, sig, info); |
523 | 523 | } |
524 | ---- linux-5.10.146.orig/kernel/sys.c | |
525 | -+++ linux-5.10.146/kernel/sys.c | |
524 | +--- linux-5.10.149.orig/kernel/sys.c | |
525 | ++++ linux-5.10.149/kernel/sys.c | |
526 | 526 | @@ -205,6 +205,10 @@ SYSCALL_DEFINE3(setpriority, int, which, |
527 | 527 | |
528 | 528 | if (which > PRIO_USER || which < PRIO_PROCESS) |
@@ -552,8 +552,8 @@ | ||
552 | 552 | |
553 | 553 | errno = -EFAULT; |
554 | 554 | if (!copy_from_user(tmp, name, len)) { |
555 | ---- linux-5.10.146.orig/kernel/time/timekeeping.c | |
556 | -+++ linux-5.10.146/kernel/time/timekeeping.c | |
555 | +--- linux-5.10.149.orig/kernel/time/timekeeping.c | |
556 | ++++ linux-5.10.149/kernel/time/timekeeping.c | |
557 | 557 | @@ -24,6 +24,7 @@ |
558 | 558 | #include <linux/compiler.h> |
559 | 559 | #include <linux/audit.h> |
@@ -587,8 +587,8 @@ | ||
587 | 587 | |
588 | 588 | /* |
589 | 589 | * Validate if a timespec/timeval used to inject a time |
590 | ---- linux-5.10.146.orig/net/ipv4/raw.c | |
591 | -+++ linux-5.10.146/net/ipv4/raw.c | |
590 | +--- linux-5.10.149.orig/net/ipv4/raw.c | |
591 | ++++ linux-5.10.149/net/ipv4/raw.c | |
592 | 592 | @@ -771,6 +771,10 @@ static int raw_recvmsg(struct sock *sk, |
593 | 593 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
594 | 594 | if (!skb) |
@@ -600,8 +600,8 @@ | ||
600 | 600 | |
601 | 601 | copied = skb->len; |
602 | 602 | if (len < copied) { |
603 | ---- linux-5.10.146.orig/net/ipv4/udp.c | |
604 | -+++ linux-5.10.146/net/ipv4/udp.c | |
603 | +--- linux-5.10.149.orig/net/ipv4/udp.c | |
604 | ++++ linux-5.10.149/net/ipv4/udp.c | |
605 | 605 | @@ -1808,6 +1808,8 @@ try_again: |
606 | 606 | skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
607 | 607 | if (!skb) |
@@ -611,8 +611,8 @@ | ||
611 | 611 | |
612 | 612 | ulen = udp_skb_len(skb); |
613 | 613 | copied = len; |
614 | ---- linux-5.10.146.orig/net/ipv6/raw.c | |
615 | -+++ linux-5.10.146/net/ipv6/raw.c | |
614 | +--- linux-5.10.149.orig/net/ipv6/raw.c | |
615 | ++++ linux-5.10.149/net/ipv6/raw.c | |
616 | 616 | @@ -480,6 +480,10 @@ static int rawv6_recvmsg(struct sock *sk |
617 | 617 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
618 | 618 | if (!skb) |
@@ -624,8 +624,8 @@ | ||
624 | 624 | |
625 | 625 | copied = skb->len; |
626 | 626 | if (copied > len) { |
627 | ---- linux-5.10.146.orig/net/ipv6/udp.c | |
628 | -+++ linux-5.10.146/net/ipv6/udp.c | |
627 | +--- linux-5.10.149.orig/net/ipv6/udp.c | |
628 | ++++ linux-5.10.149/net/ipv6/udp.c | |
629 | 629 | @@ -344,6 +344,8 @@ try_again: |
630 | 630 | skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
631 | 631 | if (!skb) |
@@ -635,8 +635,8 @@ | ||
635 | 635 | |
636 | 636 | ulen = udp6_skb_len(skb); |
637 | 637 | copied = len; |
638 | ---- linux-5.10.146.orig/net/socket.c | |
639 | -+++ linux-5.10.146/net/socket.c | |
638 | +--- linux-5.10.149.orig/net/socket.c | |
639 | ++++ linux-5.10.149/net/socket.c | |
640 | 640 | @@ -1744,6 +1744,10 @@ int __sys_accept4_file(struct file *file |
641 | 641 | if (err < 0) |
642 | 642 | goto out_fd; |
@@ -648,8 +648,8 @@ | ||
648 | 648 | if (upeer_sockaddr) { |
649 | 649 | len = newsock->ops->getname(newsock, |
650 | 650 | (struct sockaddr *)&address, 2); |
651 | ---- linux-5.10.146.orig/net/unix/af_unix.c | |
652 | -+++ linux-5.10.146/net/unix/af_unix.c | |
651 | +--- linux-5.10.149.orig/net/unix/af_unix.c | |
652 | ++++ linux-5.10.149/net/unix/af_unix.c | |
653 | 653 | @@ -2197,6 +2197,10 @@ static int unix_dgram_recvmsg(struct soc |
654 | 654 | EPOLLOUT | EPOLLWRNORM | |
655 | 655 | EPOLLWRBAND); |
@@ -669,8 +669,8 @@ | ||
669 | 669 | mutex_unlock(&u->iolock); |
670 | 670 | out: |
671 | 671 | return err; |
672 | ---- linux-5.10.146.orig/security/Kconfig | |
673 | -+++ linux-5.10.146/security/Kconfig | |
672 | +--- linux-5.10.149.orig/security/Kconfig | |
673 | ++++ linux-5.10.149/security/Kconfig | |
674 | 674 | @@ -283,5 +283,7 @@ config LSM |
675 | 675 | |
676 | 676 | source "security/Kconfig.hardening" |
@@ -679,8 +679,8 @@ | ||
679 | 679 | + |
680 | 680 | endmenu |
681 | 681 | |
682 | ---- linux-5.10.146.orig/security/Makefile | |
683 | -+++ linux-5.10.146/security/Makefile | |
682 | +--- linux-5.10.149.orig/security/Makefile | |
683 | ++++ linux-5.10.149/security/Makefile | |
684 | 684 | @@ -36,3 +36,6 @@ obj-$(CONFIG_BPF_LSM) += bpf/ |
685 | 685 | # Object integrity file lists |
686 | 686 | subdir-$(CONFIG_INTEGRITY) += integrity |
@@ -688,8 +688,8 @@ | ||
688 | 688 | + |
689 | 689 | +subdir-$(CONFIG_CCSECURITY) += ccsecurity |
690 | 690 | +obj-$(CONFIG_CCSECURITY) += ccsecurity/ |
691 | ---- linux-5.10.146.orig/security/security.c | |
692 | -+++ linux-5.10.146/security/security.c | |
691 | +--- linux-5.10.149.orig/security/security.c | |
692 | ++++ linux-5.10.149/security/security.c | |
693 | 693 | @@ -1601,7 +1601,9 @@ int security_task_alloc(struct task_stru |
694 | 694 | |
695 | 695 | if (rc) |
@@ -1,6 +1,6 @@ | ||
1 | -This is TOMOYO Linux patch for kernel 5.15.71. | |
1 | +This is TOMOYO Linux patch for kernel 5.15.74. | |
2 | 2 | |
3 | -Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.15.71.tar.xz | |
3 | +Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.15.74.tar.xz | |
4 | 4 | --- |
5 | 5 | fs/exec.c | 2 - |
6 | 6 | fs/open.c | 2 + |
@@ -28,8 +28,8 @@ | ||
28 | 28 | security/security.c | 5 ++- |
29 | 29 | 24 files changed, 160 insertions(+), 30 deletions(-) |
30 | 30 | |
31 | ---- linux-5.15.71.orig/fs/exec.c | |
32 | -+++ linux-5.15.71/fs/exec.c | |
31 | +--- linux-5.15.74.orig/fs/exec.c | |
32 | ++++ linux-5.15.74/fs/exec.c | |
33 | 33 | @@ -1841,7 +1841,7 @@ static int bprm_execve(struct linux_binp |
34 | 34 | if (retval) |
35 | 35 | goto out; |
@@ -39,8 +39,8 @@ | ||
39 | 39 | if (retval < 0) |
40 | 40 | goto out; |
41 | 41 | |
42 | ---- linux-5.15.71.orig/fs/open.c | |
43 | -+++ linux-5.15.71/fs/open.c | |
42 | +--- linux-5.15.74.orig/fs/open.c | |
43 | ++++ linux-5.15.74/fs/open.c | |
44 | 44 | @@ -1373,6 +1373,8 @@ SYSCALL_DEFINE3(close_range, unsigned in |
45 | 45 | */ |
46 | 46 | SYSCALL_DEFINE0(vhangup) |
@@ -50,8 +50,8 @@ | ||
50 | 50 | if (capable(CAP_SYS_TTY_CONFIG)) { |
51 | 51 | tty_vhangup_self(); |
52 | 52 | return 0; |
53 | ---- linux-5.15.71.orig/fs/proc/version.c | |
54 | -+++ linux-5.15.71/fs/proc/version.c | |
53 | +--- linux-5.15.74.orig/fs/proc/version.c | |
54 | ++++ linux-5.15.74/fs/proc/version.c | |
55 | 55 | @@ -21,3 +21,10 @@ static int __init proc_version_init(void |
56 | 56 | return 0; |
57 | 57 | } |
@@ -59,12 +59,12 @@ | ||
59 | 59 | + |
60 | 60 | +static int __init ccs_show_version(void) |
61 | 61 | +{ |
62 | -+ printk(KERN_INFO "Hook version: 5.15.71 2022/10/04\n"); | |
62 | ++ printk(KERN_INFO "Hook version: 5.15.74 2022/10/24\n"); | |
63 | 63 | + return 0; |
64 | 64 | +} |
65 | 65 | +fs_initcall(ccs_show_version); |
66 | ---- linux-5.15.71.orig/include/linux/sched.h | |
67 | -+++ linux-5.15.71/include/linux/sched.h | |
66 | +--- linux-5.15.74.orig/include/linux/sched.h | |
67 | ++++ linux-5.15.74/include/linux/sched.h | |
68 | 68 | @@ -44,6 +44,7 @@ struct blk_plug; |
69 | 69 | struct bpf_local_storage; |
70 | 70 | struct bpf_run_ctx; |
@@ -84,8 +84,8 @@ | ||
84 | 84 | |
85 | 85 | #ifdef CONFIG_TRACING |
86 | 86 | /* State flags for use by tracers: */ |
87 | ---- linux-5.15.71.orig/include/linux/security.h | |
88 | -+++ linux-5.15.71/include/linux/security.h | |
87 | +--- linux-5.15.74.orig/include/linux/security.h | |
88 | ++++ linux-5.15.74/include/linux/security.h | |
89 | 89 | @@ -59,6 +59,7 @@ struct fs_parameter; |
90 | 90 | enum fs_value_type; |
91 | 91 | struct watch; |
@@ -315,8 +315,8 @@ | ||
315 | 315 | } |
316 | 316 | #endif /* CONFIG_SECURITY_PATH */ |
317 | 317 | |
318 | ---- linux-5.15.71.orig/include/net/ip.h | |
319 | -+++ linux-5.15.71/include/net/ip.h | |
318 | +--- linux-5.15.74.orig/include/net/ip.h | |
319 | ++++ linux-5.15.74/include/net/ip.h | |
320 | 320 | @@ -340,6 +340,8 @@ void inet_get_local_port_range(struct ne |
321 | 321 | #ifdef CONFIG_SYSCTL |
322 | 322 | static inline bool inet_is_local_reserved_port(struct net *net, unsigned short port) |
@@ -335,8 +335,8 @@ | ||
335 | 335 | return false; |
336 | 336 | } |
337 | 337 | |
338 | ---- linux-5.15.71.orig/init/init_task.c | |
339 | -+++ linux-5.15.71/init/init_task.c | |
338 | +--- linux-5.15.74.orig/init/init_task.c | |
339 | ++++ linux-5.15.74/init/init_task.c | |
340 | 340 | @@ -214,6 +214,10 @@ struct task_struct init_task |
341 | 341 | #ifdef CONFIG_SECCOMP_FILTER |
342 | 342 | .seccomp = { .filter_count = ATOMIC_INIT(0) }, |
@@ -348,8 +348,8 @@ | ||
348 | 348 | }; |
349 | 349 | EXPORT_SYMBOL(init_task); |
350 | 350 | |
351 | ---- linux-5.15.71.orig/kernel/kexec.c | |
352 | -+++ linux-5.15.71/kernel/kexec.c | |
351 | +--- linux-5.15.74.orig/kernel/kexec.c | |
352 | ++++ linux-5.15.74/kernel/kexec.c | |
353 | 353 | @@ -16,7 +16,7 @@ |
354 | 354 | #include <linux/syscalls.h> |
355 | 355 | #include <linux/vmalloc.h> |
@@ -368,8 +368,8 @@ | ||
368 | 368 | |
369 | 369 | /* Permit LSMs and IMA to fail the kexec */ |
370 | 370 | result = security_kernel_load_data(LOADING_KEXEC_IMAGE, false); |
371 | ---- linux-5.15.71.orig/kernel/module.c | |
372 | -+++ linux-5.15.71/kernel/module.c | |
371 | +--- linux-5.15.74.orig/kernel/module.c | |
372 | ++++ linux-5.15.74/kernel/module.c | |
373 | 373 | @@ -59,6 +59,7 @@ |
374 | 374 | #include <linux/audit.h> |
375 | 375 | #include <uapi/linux/module.h> |
@@ -396,8 +396,8 @@ | ||
396 | 396 | |
397 | 397 | return 0; |
398 | 398 | } |
399 | ---- linux-5.15.71.orig/kernel/ptrace.c | |
400 | -+++ linux-5.15.71/kernel/ptrace.c | |
399 | +--- linux-5.15.74.orig/kernel/ptrace.c | |
400 | ++++ linux-5.15.74/kernel/ptrace.c | |
401 | 401 | @@ -1295,6 +1295,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l |
402 | 402 | { |
403 | 403 | struct task_struct *child; |
@@ -422,8 +422,8 @@ | ||
422 | 422 | |
423 | 423 | if (request == PTRACE_TRACEME) { |
424 | 424 | ret = ptrace_traceme(); |
425 | ---- linux-5.15.71.orig/kernel/reboot.c | |
426 | -+++ linux-5.15.71/kernel/reboot.c | |
425 | +--- linux-5.15.74.orig/kernel/reboot.c | |
426 | ++++ linux-5.15.74/kernel/reboot.c | |
427 | 427 | @@ -18,6 +18,7 @@ |
428 | 428 | #include <linux/syscalls.h> |
429 | 429 | #include <linux/syscore_ops.h> |
@@ -441,8 +441,8 @@ | ||
441 | 441 | |
442 | 442 | /* |
443 | 443 | * If pid namespaces are enabled and the current task is in a child |
444 | ---- linux-5.15.71.orig/kernel/sched/core.c | |
445 | -+++ linux-5.15.71/kernel/sched/core.c | |
444 | +--- linux-5.15.74.orig/kernel/sched/core.c | |
445 | ++++ linux-5.15.74/kernel/sched/core.c | |
446 | 446 | @@ -7002,6 +7002,8 @@ int can_nice(const struct task_struct *p |
447 | 447 | SYSCALL_DEFINE1(nice, int, increment) |
448 | 448 | { |
@@ -452,8 +452,8 @@ | ||
452 | 452 | |
453 | 453 | /* |
454 | 454 | * Setpriority might change our priority at the same moment. |
455 | ---- linux-5.15.71.orig/kernel/signal.c | |
456 | -+++ linux-5.15.71/kernel/signal.c | |
455 | +--- linux-5.15.74.orig/kernel/signal.c | |
456 | ++++ linux-5.15.74/kernel/signal.c | |
457 | 457 | @@ -3800,6 +3800,8 @@ static inline void prepare_kill_siginfo( |
458 | 458 | SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
459 | 459 | { |
@@ -521,8 +521,8 @@ | ||
521 | 521 | |
522 | 522 | return do_send_specific(tgid, pid, sig, info); |
523 | 523 | } |
524 | ---- linux-5.15.71.orig/kernel/sys.c | |
525 | -+++ linux-5.15.71/kernel/sys.c | |
524 | +--- linux-5.15.74.orig/kernel/sys.c | |
525 | ++++ linux-5.15.74/kernel/sys.c | |
526 | 526 | @@ -211,6 +211,10 @@ SYSCALL_DEFINE3(setpriority, int, which, |
527 | 527 | |
528 | 528 | if (which > PRIO_USER || which < PRIO_PROCESS) |
@@ -552,8 +552,8 @@ | ||
552 | 552 | |
553 | 553 | errno = -EFAULT; |
554 | 554 | if (!copy_from_user(tmp, name, len)) { |
555 | ---- linux-5.15.71.orig/kernel/time/timekeeping.c | |
556 | -+++ linux-5.15.71/kernel/time/timekeeping.c | |
555 | +--- linux-5.15.74.orig/kernel/time/timekeeping.c | |
556 | ++++ linux-5.15.74/kernel/time/timekeeping.c | |
557 | 557 | @@ -24,6 +24,7 @@ |
558 | 558 | #include <linux/compiler.h> |
559 | 559 | #include <linux/audit.h> |
@@ -587,8 +587,8 @@ | ||
587 | 587 | |
588 | 588 | /* |
589 | 589 | * Validate if a timespec/timeval used to inject a time |
590 | ---- linux-5.15.71.orig/net/ipv4/raw.c | |
591 | -+++ linux-5.15.71/net/ipv4/raw.c | |
590 | +--- linux-5.15.74.orig/net/ipv4/raw.c | |
591 | ++++ linux-5.15.74/net/ipv4/raw.c | |
592 | 592 | @@ -771,6 +771,10 @@ static int raw_recvmsg(struct sock *sk, |
593 | 593 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
594 | 594 | if (!skb) |
@@ -600,8 +600,8 @@ | ||
600 | 600 | |
601 | 601 | copied = skb->len; |
602 | 602 | if (len < copied) { |
603 | ---- linux-5.15.71.orig/net/ipv4/udp.c | |
604 | -+++ linux-5.15.71/net/ipv4/udp.c | |
603 | +--- linux-5.15.74.orig/net/ipv4/udp.c | |
604 | ++++ linux-5.15.74/net/ipv4/udp.c | |
605 | 605 | @@ -1864,6 +1864,8 @@ try_again: |
606 | 606 | skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
607 | 607 | if (!skb) |
@@ -611,8 +611,8 @@ | ||
611 | 611 | |
612 | 612 | ulen = udp_skb_len(skb); |
613 | 613 | copied = len; |
614 | ---- linux-5.15.71.orig/net/ipv6/raw.c | |
615 | -+++ linux-5.15.71/net/ipv6/raw.c | |
614 | +--- linux-5.15.74.orig/net/ipv6/raw.c | |
615 | ++++ linux-5.15.74/net/ipv6/raw.c | |
616 | 616 | @@ -480,6 +480,10 @@ static int rawv6_recvmsg(struct sock *sk |
617 | 617 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
618 | 618 | if (!skb) |
@@ -624,8 +624,8 @@ | ||
624 | 624 | |
625 | 625 | copied = skb->len; |
626 | 626 | if (copied > len) { |
627 | ---- linux-5.15.71.orig/net/ipv6/udp.c | |
628 | -+++ linux-5.15.71/net/ipv6/udp.c | |
627 | +--- linux-5.15.74.orig/net/ipv6/udp.c | |
628 | ++++ linux-5.15.74/net/ipv6/udp.c | |
629 | 629 | @@ -344,6 +344,8 @@ try_again: |
630 | 630 | skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
631 | 631 | if (!skb) |
@@ -635,8 +635,8 @@ | ||
635 | 635 | |
636 | 636 | ulen = udp6_skb_len(skb); |
637 | 637 | copied = len; |
638 | ---- linux-5.15.71.orig/net/socket.c | |
639 | -+++ linux-5.15.71/net/socket.c | |
638 | +--- linux-5.15.74.orig/net/socket.c | |
639 | ++++ linux-5.15.74/net/socket.c | |
640 | 640 | @@ -1778,6 +1778,10 @@ struct file *do_accept(struct file *file |
641 | 641 | if (err < 0) |
642 | 642 | goto out_fd; |
@@ -648,8 +648,8 @@ | ||
648 | 648 | if (upeer_sockaddr) { |
649 | 649 | len = newsock->ops->getname(newsock, |
650 | 650 | (struct sockaddr *)&address, 2); |
651 | ---- linux-5.15.71.orig/net/unix/af_unix.c | |
652 | -+++ linux-5.15.71/net/unix/af_unix.c | |
651 | +--- linux-5.15.74.orig/net/unix/af_unix.c | |
652 | ++++ linux-5.15.74/net/unix/af_unix.c | |
653 | 653 | @@ -2331,6 +2331,10 @@ int __unix_dgram_recvmsg(struct sock *sk |
654 | 654 | EPOLLOUT | EPOLLWRNORM | |
655 | 655 | EPOLLWRBAND); |
@@ -669,8 +669,8 @@ | ||
669 | 669 | mutex_unlock(&u->iolock); |
670 | 670 | out: |
671 | 671 | return err; |
672 | ---- linux-5.15.71.orig/security/Kconfig | |
673 | -+++ linux-5.15.71/security/Kconfig | |
672 | +--- linux-5.15.74.orig/security/Kconfig | |
673 | ++++ linux-5.15.74/security/Kconfig | |
674 | 674 | @@ -284,5 +284,7 @@ config LSM |
675 | 675 | |
676 | 676 | source "security/Kconfig.hardening" |
@@ -679,8 +679,8 @@ | ||
679 | 679 | + |
680 | 680 | endmenu |
681 | 681 | |
682 | ---- linux-5.15.71.orig/security/Makefile | |
683 | -+++ linux-5.15.71/security/Makefile | |
682 | +--- linux-5.15.74.orig/security/Makefile | |
683 | ++++ linux-5.15.74/security/Makefile | |
684 | 684 | @@ -27,3 +27,6 @@ obj-$(CONFIG_SECURITY_LANDLOCK) += land |
685 | 685 | |
686 | 686 | # Object integrity file lists |
@@ -688,8 +688,8 @@ | ||
688 | 688 | + |
689 | 689 | +subdir-$(CONFIG_CCSECURITY) += ccsecurity |
690 | 690 | +obj-$(CONFIG_CCSECURITY) += ccsecurity/ |
691 | ---- linux-5.15.71.orig/security/security.c | |
692 | -+++ linux-5.15.71/security/security.c | |
691 | +--- linux-5.15.74.orig/security/security.c | |
692 | ++++ linux-5.15.74/security/security.c | |
693 | 693 | @@ -1659,7 +1659,9 @@ int security_task_alloc(struct task_stru |
694 | 694 | |
695 | 695 | if (rc) |
@@ -1,6 +1,6 @@ | ||
1 | -This is TOMOYO Linux patch for kernel 5.19.12. | |
1 | +This is TOMOYO Linux patch for kernel 5.19.17. | |
2 | 2 | |
3 | -Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.19.12.tar.xz | |
3 | +Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.19.17.tar.xz | |
4 | 4 | --- |
5 | 5 | fs/exec.c | 2 - |
6 | 6 | fs/open.c | 2 + |
@@ -28,8 +28,8 @@ | ||
28 | 28 | security/security.c | 5 +++ |
29 | 29 | 24 files changed, 150 insertions(+), 30 deletions(-) |
30 | 30 | |
31 | ---- linux-5.19.12.orig/fs/exec.c | |
32 | -+++ linux-5.19.12/fs/exec.c | |
31 | +--- linux-5.19.17.orig/fs/exec.c | |
32 | ++++ linux-5.19.17/fs/exec.c | |
33 | 33 | @@ -1838,7 +1838,7 @@ static int bprm_execve(struct linux_binp |
34 | 34 | if (retval) |
35 | 35 | goto out; |
@@ -39,9 +39,9 @@ | ||
39 | 39 | if (retval < 0) |
40 | 40 | goto out; |
41 | 41 | |
42 | ---- linux-5.19.12.orig/fs/open.c | |
43 | -+++ linux-5.19.12/fs/open.c | |
44 | -@@ -1439,6 +1439,8 @@ SYSCALL_DEFINE3(close_range, unsigned in | |
42 | +--- linux-5.19.17.orig/fs/open.c | |
43 | ++++ linux-5.19.17/fs/open.c | |
44 | +@@ -1436,6 +1436,8 @@ SYSCALL_DEFINE3(close_range, unsigned in | |
45 | 45 | */ |
46 | 46 | SYSCALL_DEFINE0(vhangup) |
47 | 47 | { |
@@ -50,8 +50,8 @@ | ||
50 | 50 | if (capable(CAP_SYS_TTY_CONFIG)) { |
51 | 51 | tty_vhangup_self(); |
52 | 52 | return 0; |
53 | ---- linux-5.19.12.orig/fs/proc/version.c | |
54 | -+++ linux-5.19.12/fs/proc/version.c | |
53 | +--- linux-5.19.17.orig/fs/proc/version.c | |
54 | ++++ linux-5.19.17/fs/proc/version.c | |
55 | 55 | @@ -21,3 +21,10 @@ static int __init proc_version_init(void |
56 | 56 | return 0; |
57 | 57 | } |
@@ -59,12 +59,12 @@ | ||
59 | 59 | + |
60 | 60 | +static int __init ccs_show_version(void) |
61 | 61 | +{ |
62 | -+ printk(KERN_INFO "Hook version: 5.19.12 2022/10/04\n"); | |
62 | ++ printk(KERN_INFO "Hook version: 5.19.17 2022/10/24\n"); | |
63 | 63 | + return 0; |
64 | 64 | +} |
65 | 65 | +fs_initcall(ccs_show_version); |
66 | ---- linux-5.19.12.orig/include/linux/sched.h | |
67 | -+++ linux-5.19.12/include/linux/sched.h | |
66 | +--- linux-5.19.17.orig/include/linux/sched.h | |
67 | ++++ linux-5.19.17/include/linux/sched.h | |
68 | 68 | @@ -44,6 +44,7 @@ struct blk_plug; |
69 | 69 | struct bpf_local_storage; |
70 | 70 | struct bpf_run_ctx; |
@@ -84,8 +84,8 @@ | ||
84 | 84 | |
85 | 85 | #ifdef CONFIG_TRACING |
86 | 86 | /* State flags for use by tracers: */ |
87 | ---- linux-5.19.12.orig/include/linux/security.h | |
88 | -+++ linux-5.19.12/include/linux/security.h | |
87 | +--- linux-5.19.17.orig/include/linux/security.h | |
88 | ++++ linux-5.19.17/include/linux/security.h | |
89 | 89 | @@ -59,6 +59,7 @@ struct fs_parameter; |
90 | 90 | enum fs_value_type; |
91 | 91 | struct watch; |
@@ -305,8 +305,8 @@ | ||
305 | 305 | } |
306 | 306 | #endif /* CONFIG_SECURITY_PATH */ |
307 | 307 | |
308 | ---- linux-5.19.12.orig/include/net/ip.h | |
309 | -+++ linux-5.19.12/include/net/ip.h | |
308 | +--- linux-5.19.17.orig/include/net/ip.h | |
309 | ++++ linux-5.19.17/include/net/ip.h | |
310 | 310 | @@ -345,6 +345,8 @@ void inet_get_local_port_range(struct ne |
311 | 311 | #ifdef CONFIG_SYSCTL |
312 | 312 | static inline bool inet_is_local_reserved_port(struct net *net, unsigned short port) |
@@ -325,8 +325,8 @@ | ||
325 | 325 | return false; |
326 | 326 | } |
327 | 327 | |
328 | ---- linux-5.19.12.orig/init/init_task.c | |
329 | -+++ linux-5.19.12/init/init_task.c | |
328 | +--- linux-5.19.17.orig/init/init_task.c | |
329 | ++++ linux-5.19.17/init/init_task.c | |
330 | 330 | @@ -209,6 +209,10 @@ struct task_struct init_task |
331 | 331 | #ifdef CONFIG_SECCOMP_FILTER |
332 | 332 | .seccomp = { .filter_count = ATOMIC_INIT(0) }, |
@@ -338,8 +338,8 @@ | ||
338 | 338 | }; |
339 | 339 | EXPORT_SYMBOL(init_task); |
340 | 340 | |
341 | ---- linux-5.19.12.orig/kernel/kexec.c | |
342 | -+++ linux-5.19.12/kernel/kexec.c | |
341 | +--- linux-5.19.17.orig/kernel/kexec.c | |
342 | ++++ linux-5.19.17/kernel/kexec.c | |
343 | 343 | @@ -16,7 +16,7 @@ |
344 | 344 | #include <linux/syscalls.h> |
345 | 345 | #include <linux/vmalloc.h> |
@@ -358,8 +358,8 @@ | ||
358 | 358 | |
359 | 359 | /* Permit LSMs and IMA to fail the kexec */ |
360 | 360 | result = security_kernel_load_data(LOADING_KEXEC_IMAGE, false); |
361 | ---- linux-5.19.12.orig/kernel/module/main.c | |
362 | -+++ linux-5.19.12/kernel/module/main.c | |
361 | +--- linux-5.19.17.orig/kernel/module/main.c | |
362 | ++++ linux-5.19.17/kernel/module/main.c | |
363 | 363 | @@ -58,6 +58,7 @@ |
364 | 364 | |
365 | 365 | #define CREATE_TRACE_POINTS |
@@ -386,8 +386,8 @@ | ||
386 | 386 | |
387 | 387 | return 0; |
388 | 388 | } |
389 | ---- linux-5.19.12.orig/kernel/ptrace.c | |
390 | -+++ linux-5.19.12/kernel/ptrace.c | |
389 | +--- linux-5.19.17.orig/kernel/ptrace.c | |
390 | ++++ linux-5.19.17/kernel/ptrace.c | |
391 | 391 | @@ -1271,6 +1271,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l |
392 | 392 | { |
393 | 393 | struct task_struct *child; |
@@ -412,8 +412,8 @@ | ||
412 | 412 | |
413 | 413 | if (request == PTRACE_TRACEME) { |
414 | 414 | ret = ptrace_traceme(); |
415 | ---- linux-5.19.12.orig/kernel/reboot.c | |
416 | -+++ linux-5.19.12/kernel/reboot.c | |
415 | +--- linux-5.19.17.orig/kernel/reboot.c | |
416 | ++++ linux-5.19.17/kernel/reboot.c | |
417 | 417 | @@ -18,6 +18,7 @@ |
418 | 418 | #include <linux/syscalls.h> |
419 | 419 | #include <linux/syscore_ops.h> |
@@ -431,8 +431,8 @@ | ||
431 | 431 | |
432 | 432 | /* |
433 | 433 | * If pid namespaces are enabled and the current task is in a child |
434 | ---- linux-5.19.12.orig/kernel/sched/core.c | |
435 | -+++ linux-5.19.12/kernel/sched/core.c | |
434 | +--- linux-5.19.17.orig/kernel/sched/core.c | |
435 | ++++ linux-5.19.17/kernel/sched/core.c | |
436 | 436 | @@ -7049,6 +7049,8 @@ int can_nice(const struct task_struct *p |
437 | 437 | SYSCALL_DEFINE1(nice, int, increment) |
438 | 438 | { |
@@ -442,8 +442,8 @@ | ||
442 | 442 | |
443 | 443 | /* |
444 | 444 | * Setpriority might change our priority at the same moment. |
445 | ---- linux-5.19.12.orig/kernel/signal.c | |
446 | -+++ linux-5.19.12/kernel/signal.c | |
445 | +--- linux-5.19.17.orig/kernel/signal.c | |
446 | ++++ linux-5.19.17/kernel/signal.c | |
447 | 447 | @@ -3770,6 +3770,8 @@ static inline void prepare_kill_siginfo( |
448 | 448 | SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
449 | 449 | { |
@@ -511,8 +511,8 @@ | ||
511 | 511 | |
512 | 512 | return do_send_specific(tgid, pid, sig, info); |
513 | 513 | } |
514 | ---- linux-5.19.12.orig/kernel/sys.c | |
515 | -+++ linux-5.19.12/kernel/sys.c | |
514 | +--- linux-5.19.17.orig/kernel/sys.c | |
515 | ++++ linux-5.19.17/kernel/sys.c | |
516 | 516 | @@ -218,6 +218,10 @@ SYSCALL_DEFINE3(setpriority, int, which, |
517 | 517 | |
518 | 518 | if (which > PRIO_USER || which < PRIO_PROCESS) |
@@ -542,8 +542,8 @@ | ||
542 | 542 | |
543 | 543 | errno = -EFAULT; |
544 | 544 | if (!copy_from_user(tmp, name, len)) { |
545 | ---- linux-5.19.12.orig/kernel/time/timekeeping.c | |
546 | -+++ linux-5.19.12/kernel/time/timekeeping.c | |
545 | +--- linux-5.19.17.orig/kernel/time/timekeeping.c | |
546 | ++++ linux-5.19.17/kernel/time/timekeeping.c | |
547 | 547 | @@ -24,6 +24,7 @@ |
548 | 548 | #include <linux/compiler.h> |
549 | 549 | #include <linux/audit.h> |
@@ -577,8 +577,8 @@ | ||
577 | 577 | |
578 | 578 | /* |
579 | 579 | * Validate if a timespec/timeval used to inject a time |
580 | ---- linux-5.19.12.orig/net/ipv4/raw.c | |
581 | -+++ linux-5.19.12/net/ipv4/raw.c | |
580 | +--- linux-5.19.17.orig/net/ipv4/raw.c | |
581 | ++++ linux-5.19.17/net/ipv4/raw.c | |
582 | 582 | @@ -744,6 +744,10 @@ static int raw_recvmsg(struct sock *sk, |
583 | 583 | skb = skb_recv_datagram(sk, flags, &err); |
584 | 584 | if (!skb) |
@@ -590,8 +590,8 @@ | ||
590 | 590 | |
591 | 591 | copied = skb->len; |
592 | 592 | if (len < copied) { |
593 | ---- linux-5.19.12.orig/net/ipv4/udp.c | |
594 | -+++ linux-5.19.12/net/ipv4/udp.c | |
593 | +--- linux-5.19.17.orig/net/ipv4/udp.c | |
594 | ++++ linux-5.19.17/net/ipv4/udp.c | |
595 | 595 | @@ -1863,6 +1863,8 @@ try_again: |
596 | 596 | skb = __skb_recv_udp(sk, flags, &off, &err); |
597 | 597 | if (!skb) |
@@ -601,8 +601,8 @@ | ||
601 | 601 | |
602 | 602 | ulen = udp_skb_len(skb); |
603 | 603 | copied = len; |
604 | ---- linux-5.19.12.orig/net/ipv6/raw.c | |
605 | -+++ linux-5.19.12/net/ipv6/raw.c | |
604 | +--- linux-5.19.17.orig/net/ipv6/raw.c | |
605 | ++++ linux-5.19.17/net/ipv6/raw.c | |
606 | 606 | @@ -446,6 +446,10 @@ static int rawv6_recvmsg(struct sock *sk |
607 | 607 | skb = skb_recv_datagram(sk, flags, &err); |
608 | 608 | if (!skb) |
@@ -614,8 +614,8 @@ | ||
614 | 614 | |
615 | 615 | copied = skb->len; |
616 | 616 | if (copied > len) { |
617 | ---- linux-5.19.12.orig/net/ipv6/udp.c | |
618 | -+++ linux-5.19.12/net/ipv6/udp.c | |
617 | +--- linux-5.19.17.orig/net/ipv6/udp.c | |
618 | ++++ linux-5.19.17/net/ipv6/udp.c | |
619 | 619 | @@ -346,6 +346,8 @@ try_again: |
620 | 620 | skb = __skb_recv_udp(sk, flags, &off, &err); |
621 | 621 | if (!skb) |
@@ -625,8 +625,8 @@ | ||
625 | 625 | |
626 | 626 | ulen = udp6_skb_len(skb); |
627 | 627 | copied = len; |
628 | ---- linux-5.19.12.orig/net/socket.c | |
629 | -+++ linux-5.19.12/net/socket.c | |
628 | +--- linux-5.19.17.orig/net/socket.c | |
629 | ++++ linux-5.19.17/net/socket.c | |
630 | 630 | @@ -1858,6 +1858,10 @@ struct file *do_accept(struct file *file |
631 | 631 | if (err < 0) |
632 | 632 | goto out_fd; |
@@ -638,9 +638,9 @@ | ||
638 | 638 | if (upeer_sockaddr) { |
639 | 639 | len = newsock->ops->getname(newsock, |
640 | 640 | (struct sockaddr *)&address, 2); |
641 | ---- linux-5.19.12.orig/net/unix/af_unix.c | |
642 | -+++ linux-5.19.12/net/unix/af_unix.c | |
643 | -@@ -2418,6 +2418,10 @@ int __unix_dgram_recvmsg(struct sock *sk | |
641 | +--- linux-5.19.17.orig/net/unix/af_unix.c | |
642 | ++++ linux-5.19.17/net/unix/af_unix.c | |
643 | +@@ -2419,6 +2419,10 @@ int __unix_dgram_recvmsg(struct sock *sk | |
644 | 644 | EPOLLOUT | EPOLLWRNORM | |
645 | 645 | EPOLLWRBAND); |
646 | 646 |
@@ -651,7 +651,7 @@ | ||
651 | 651 | if (msg->msg_name) |
652 | 652 | unix_copy_addr(msg, skb->sk); |
653 | 653 | |
654 | -@@ -2468,6 +2472,7 @@ int __unix_dgram_recvmsg(struct sock *sk | |
654 | +@@ -2469,6 +2473,7 @@ int __unix_dgram_recvmsg(struct sock *sk | |
655 | 655 | |
656 | 656 | out_free: |
657 | 657 | skb_free_datagram(sk, skb); |
@@ -659,8 +659,8 @@ | ||
659 | 659 | mutex_unlock(&u->iolock); |
660 | 660 | out: |
661 | 661 | return err; |
662 | ---- linux-5.19.12.orig/security/Kconfig | |
663 | -+++ linux-5.19.12/security/Kconfig | |
662 | +--- linux-5.19.17.orig/security/Kconfig | |
663 | ++++ linux-5.19.17/security/Kconfig | |
664 | 664 | @@ -260,5 +260,7 @@ config LSM |
665 | 665 | |
666 | 666 | source "security/Kconfig.hardening" |
@@ -669,8 +669,8 @@ | ||
669 | 669 | + |
670 | 670 | endmenu |
671 | 671 | |
672 | ---- linux-5.19.12.orig/security/Makefile | |
673 | -+++ linux-5.19.12/security/Makefile | |
672 | +--- linux-5.19.17.orig/security/Makefile | |
673 | ++++ linux-5.19.17/security/Makefile | |
674 | 674 | @@ -27,3 +27,6 @@ obj-$(CONFIG_SECURITY_LANDLOCK) += land |
675 | 675 | |
676 | 676 | # Object integrity file lists |
@@ -678,8 +678,8 @@ | ||
678 | 678 | + |
679 | 679 | +subdir-$(CONFIG_CCSECURITY) += ccsecurity |
680 | 680 | +obj-$(CONFIG_CCSECURITY) += ccsecurity/ |
681 | ---- linux-5.19.12.orig/security/security.c | |
682 | -+++ linux-5.19.12/security/security.c | |
681 | +--- linux-5.19.17.orig/security/security.c | |
682 | ++++ linux-5.19.17/security/security.c | |
683 | 683 | @@ -1655,7 +1655,9 @@ int security_task_alloc(struct task_stru |
684 | 684 | |
685 | 685 | if (rc) |
@@ -1,6 +1,6 @@ | ||
1 | -This is TOMOYO Linux patch for kernel 5.4.215. | |
1 | +This is TOMOYO Linux patch for kernel 5.4.219. | |
2 | 2 | |
3 | -Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.215.tar.xz | |
3 | +Source code for this patch is https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.219.tar.xz | |
4 | 4 | --- |
5 | 5 | fs/exec.c | 2 - |
6 | 6 | fs/open.c | 2 + |
@@ -28,8 +28,8 @@ | ||
28 | 28 | security/security.c | 5 ++- |
29 | 29 | 24 files changed, 160 insertions(+), 30 deletions(-) |
30 | 30 | |
31 | ---- linux-5.4.215.orig/fs/exec.c | |
32 | -+++ linux-5.4.215/fs/exec.c | |
31 | +--- linux-5.4.219.orig/fs/exec.c | |
32 | ++++ linux-5.4.219/fs/exec.c | |
33 | 33 | @@ -1739,7 +1739,7 @@ static int exec_binprm(struct linux_binp |
34 | 34 | old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent)); |
35 | 35 | rcu_read_unlock(); |
@@ -39,8 +39,8 @@ | ||
39 | 39 | if (ret >= 0) { |
40 | 40 | audit_bprm(bprm); |
41 | 41 | trace_sched_process_exec(current, old_pid, bprm); |
42 | ---- linux-5.4.215.orig/fs/open.c | |
43 | -+++ linux-5.4.215/fs/open.c | |
42 | +--- linux-5.4.219.orig/fs/open.c | |
43 | ++++ linux-5.4.219/fs/open.c | |
44 | 44 | @@ -1205,6 +1205,8 @@ SYSCALL_DEFINE1(close, unsigned int, fd) |
45 | 45 | */ |
46 | 46 | SYSCALL_DEFINE0(vhangup) |
@@ -50,8 +50,8 @@ | ||
50 | 50 | if (capable(CAP_SYS_TTY_CONFIG)) { |
51 | 51 | tty_vhangup_self(); |
52 | 52 | return 0; |
53 | ---- linux-5.4.215.orig/fs/proc/version.c | |
54 | -+++ linux-5.4.215/fs/proc/version.c | |
53 | +--- linux-5.4.219.orig/fs/proc/version.c | |
54 | ++++ linux-5.4.219/fs/proc/version.c | |
55 | 55 | @@ -21,3 +21,10 @@ static int __init proc_version_init(void |
56 | 56 | return 0; |
57 | 57 | } |
@@ -59,12 +59,12 @@ | ||
59 | 59 | + |
60 | 60 | +static int __init ccs_show_version(void) |
61 | 61 | +{ |
62 | -+ printk(KERN_INFO "Hook version: 5.4.215 2022/10/04\n"); | |
62 | ++ printk(KERN_INFO "Hook version: 5.4.219 2022/10/24\n"); | |
63 | 63 | + return 0; |
64 | 64 | +} |
65 | 65 | +fs_initcall(ccs_show_version); |
66 | ---- linux-5.4.215.orig/include/linux/sched.h | |
67 | -+++ linux-5.4.215/include/linux/sched.h | |
66 | +--- linux-5.4.219.orig/include/linux/sched.h | |
67 | ++++ linux-5.4.219/include/linux/sched.h | |
68 | 68 | @@ -38,6 +38,7 @@ struct backing_dev_info; |
69 | 69 | struct bio_list; |
70 | 70 | struct blk_plug; |
@@ -84,8 +84,8 @@ | ||
84 | 84 | |
85 | 85 | #ifdef CONFIG_GCC_PLUGIN_STACKLEAK |
86 | 86 | unsigned long lowest_stack; |
87 | ---- linux-5.4.215.orig/include/linux/security.h | |
88 | -+++ linux-5.4.215/include/linux/security.h | |
87 | +--- linux-5.4.219.orig/include/linux/security.h | |
88 | ++++ linux-5.4.219/include/linux/security.h | |
89 | 89 | @@ -57,6 +57,7 @@ struct mm_struct; |
90 | 90 | struct fs_context; |
91 | 91 | struct fs_parameter; |
@@ -315,8 +315,8 @@ | ||
315 | 315 | } |
316 | 316 | #endif /* CONFIG_SECURITY_PATH */ |
317 | 317 | |
318 | ---- linux-5.4.215.orig/include/net/ip.h | |
319 | -+++ linux-5.4.215/include/net/ip.h | |
318 | +--- linux-5.4.219.orig/include/net/ip.h | |
319 | ++++ linux-5.4.219/include/net/ip.h | |
320 | 320 | @@ -342,6 +342,8 @@ void inet_get_local_port_range(struct ne |
321 | 321 | #ifdef CONFIG_SYSCTL |
322 | 322 | static inline int inet_is_local_reserved_port(struct net *net, int port) |
@@ -335,8 +335,8 @@ | ||
335 | 335 | return 0; |
336 | 336 | } |
337 | 337 | |
338 | ---- linux-5.4.215.orig/init/init_task.c | |
339 | -+++ linux-5.4.215/init/init_task.c | |
338 | +--- linux-5.4.219.orig/init/init_task.c | |
339 | ++++ linux-5.4.219/init/init_task.c | |
340 | 340 | @@ -183,6 +183,10 @@ struct task_struct init_task |
341 | 341 | #ifdef CONFIG_SECURITY |
342 | 342 | .security = NULL, |
@@ -348,8 +348,8 @@ | ||
348 | 348 | }; |
349 | 349 | EXPORT_SYMBOL(init_task); |
350 | 350 | |
351 | ---- linux-5.4.215.orig/kernel/kexec.c | |
352 | -+++ linux-5.4.215/kernel/kexec.c | |
351 | +--- linux-5.4.219.orig/kernel/kexec.c | |
352 | ++++ linux-5.4.219/kernel/kexec.c | |
353 | 353 | @@ -16,7 +16,7 @@ |
354 | 354 | #include <linux/syscalls.h> |
355 | 355 | #include <linux/vmalloc.h> |
@@ -368,8 +368,8 @@ | ||
368 | 368 | |
369 | 369 | /* Permit LSMs and IMA to fail the kexec */ |
370 | 370 | result = security_kernel_load_data(LOADING_KEXEC_IMAGE); |
371 | ---- linux-5.4.215.orig/kernel/module.c | |
372 | -+++ linux-5.4.215/kernel/module.c | |
371 | +--- linux-5.4.219.orig/kernel/module.c | |
372 | ++++ linux-5.4.219/kernel/module.c | |
373 | 373 | @@ -55,6 +55,7 @@ |
374 | 374 | #include <linux/audit.h> |
375 | 375 | #include <uapi/linux/module.h> |
@@ -396,8 +396,8 @@ | ||
396 | 396 | |
397 | 397 | return 0; |
398 | 398 | } |
399 | ---- linux-5.4.215.orig/kernel/ptrace.c | |
400 | -+++ linux-5.4.215/kernel/ptrace.c | |
399 | +--- linux-5.4.219.orig/kernel/ptrace.c | |
400 | ++++ linux-5.4.219/kernel/ptrace.c | |
401 | 401 | @@ -1270,6 +1270,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l |
402 | 402 | { |
403 | 403 | struct task_struct *child; |
@@ -422,8 +422,8 @@ | ||
422 | 422 | |
423 | 423 | if (request == PTRACE_TRACEME) { |
424 | 424 | ret = ptrace_traceme(); |
425 | ---- linux-5.4.215.orig/kernel/reboot.c | |
426 | -+++ linux-5.4.215/kernel/reboot.c | |
425 | +--- linux-5.4.219.orig/kernel/reboot.c | |
426 | ++++ linux-5.4.219/kernel/reboot.c | |
427 | 427 | @@ -17,6 +17,7 @@ |
428 | 428 | #include <linux/syscalls.h> |
429 | 429 | #include <linux/syscore_ops.h> |
@@ -441,8 +441,8 @@ | ||
441 | 441 | |
442 | 442 | /* |
443 | 443 | * If pid namespaces are enabled and the current task is in a child |
444 | ---- linux-5.4.215.orig/kernel/sched/core.c | |
445 | -+++ linux-5.4.215/kernel/sched/core.c | |
444 | +--- linux-5.4.219.orig/kernel/sched/core.c | |
445 | ++++ linux-5.4.219/kernel/sched/core.c | |
446 | 446 | @@ -4678,6 +4678,8 @@ int can_nice(const struct task_struct *p |
447 | 447 | SYSCALL_DEFINE1(nice, int, increment) |
448 | 448 | { |
@@ -452,8 +452,8 @@ | ||
452 | 452 | |
453 | 453 | /* |
454 | 454 | * Setpriority might change our priority at the same moment. |
455 | ---- linux-5.4.215.orig/kernel/signal.c | |
456 | -+++ linux-5.4.215/kernel/signal.c | |
455 | +--- linux-5.4.219.orig/kernel/signal.c | |
456 | ++++ linux-5.4.219/kernel/signal.c | |
457 | 457 | @@ -3634,6 +3634,8 @@ static inline void prepare_kill_siginfo( |
458 | 458 | SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
459 | 459 | { |
@@ -521,8 +521,8 @@ | ||
521 | 521 | |
522 | 522 | return do_send_specific(tgid, pid, sig, info); |
523 | 523 | } |
524 | ---- linux-5.4.215.orig/kernel/sys.c | |
525 | -+++ linux-5.4.215/kernel/sys.c | |
524 | +--- linux-5.4.219.orig/kernel/sys.c | |
525 | ++++ linux-5.4.219/kernel/sys.c | |
526 | 526 | @@ -204,6 +204,10 @@ SYSCALL_DEFINE3(setpriority, int, which, |
527 | 527 | |
528 | 528 | if (which > PRIO_USER || which < PRIO_PROCESS) |
@@ -552,8 +552,8 @@ | ||
552 | 552 | |
553 | 553 | errno = -EFAULT; |
554 | 554 | if (!copy_from_user(tmp, name, len)) { |
555 | ---- linux-5.4.215.orig/kernel/time/timekeeping.c | |
556 | -+++ linux-5.4.215/kernel/time/timekeeping.c | |
555 | +--- linux-5.4.219.orig/kernel/time/timekeeping.c | |
556 | ++++ linux-5.4.219/kernel/time/timekeeping.c | |
557 | 557 | @@ -24,6 +24,7 @@ |
558 | 558 | #include <linux/compiler.h> |
559 | 559 | #include <linux/audit.h> |
@@ -587,8 +587,8 @@ | ||
587 | 587 | |
588 | 588 | /* |
589 | 589 | * Validate if a timespec/timeval used to inject a time |
590 | ---- linux-5.4.215.orig/net/ipv4/raw.c | |
591 | -+++ linux-5.4.215/net/ipv4/raw.c | |
590 | +--- linux-5.4.219.orig/net/ipv4/raw.c | |
591 | ++++ linux-5.4.219/net/ipv4/raw.c | |
592 | 592 | @@ -770,6 +770,10 @@ static int raw_recvmsg(struct sock *sk, |
593 | 593 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
594 | 594 | if (!skb) |
@@ -600,8 +600,8 @@ | ||
600 | 600 | |
601 | 601 | copied = skb->len; |
602 | 602 | if (len < copied) { |
603 | ---- linux-5.4.215.orig/net/ipv4/udp.c | |
604 | -+++ linux-5.4.215/net/ipv4/udp.c | |
603 | +--- linux-5.4.219.orig/net/ipv4/udp.c | |
604 | ++++ linux-5.4.219/net/ipv4/udp.c | |
605 | 605 | @@ -1751,6 +1751,8 @@ try_again: |
606 | 606 | skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
607 | 607 | if (!skb) |
@@ -611,8 +611,8 @@ | ||
611 | 611 | |
612 | 612 | ulen = udp_skb_len(skb); |
613 | 613 | copied = len; |
614 | ---- linux-5.4.215.orig/net/ipv6/raw.c | |
615 | -+++ linux-5.4.215/net/ipv6/raw.c | |
614 | +--- linux-5.4.219.orig/net/ipv6/raw.c | |
615 | ++++ linux-5.4.219/net/ipv6/raw.c | |
616 | 616 | @@ -480,6 +480,10 @@ static int rawv6_recvmsg(struct sock *sk |
617 | 617 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
618 | 618 | if (!skb) |
@@ -624,8 +624,8 @@ | ||
624 | 624 | |
625 | 625 | copied = skb->len; |
626 | 626 | if (copied > len) { |
627 | ---- linux-5.4.215.orig/net/ipv6/udp.c | |
628 | -+++ linux-5.4.215/net/ipv6/udp.c | |
627 | +--- linux-5.4.219.orig/net/ipv6/udp.c | |
628 | ++++ linux-5.4.219/net/ipv6/udp.c | |
629 | 629 | @@ -292,6 +292,8 @@ try_again: |
630 | 630 | skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
631 | 631 | if (!skb) |
@@ -635,8 +635,8 @@ | ||
635 | 635 | |
636 | 636 | ulen = udp6_skb_len(skb); |
637 | 637 | copied = len; |
638 | ---- linux-5.4.215.orig/net/socket.c | |
639 | -+++ linux-5.4.215/net/socket.c | |
638 | +--- linux-5.4.219.orig/net/socket.c | |
639 | ++++ linux-5.4.219/net/socket.c | |
640 | 640 | @@ -1744,6 +1744,10 @@ int __sys_accept4(int fd, struct sockadd |
641 | 641 | if (err < 0) |
642 | 642 | goto out_fd; |
@@ -648,8 +648,8 @@ | ||
648 | 648 | if (upeer_sockaddr) { |
649 | 649 | len = newsock->ops->getname(newsock, |
650 | 650 | (struct sockaddr *)&address, 2); |
651 | ---- linux-5.4.215.orig/net/unix/af_unix.c | |
652 | -+++ linux-5.4.215/net/unix/af_unix.c | |
651 | +--- linux-5.4.219.orig/net/unix/af_unix.c | |
652 | ++++ linux-5.4.219/net/unix/af_unix.c | |
653 | 653 | @@ -2164,6 +2164,10 @@ static int unix_dgram_recvmsg(struct soc |
654 | 654 | EPOLLOUT | EPOLLWRNORM | |
655 | 655 | EPOLLWRBAND); |
@@ -669,8 +669,8 @@ | ||
669 | 669 | mutex_unlock(&u->iolock); |
670 | 670 | out: |
671 | 671 | return err; |
672 | ---- linux-5.4.215.orig/security/Kconfig | |
673 | -+++ linux-5.4.215/security/Kconfig | |
672 | +--- linux-5.4.219.orig/security/Kconfig | |
673 | ++++ linux-5.4.219/security/Kconfig | |
674 | 674 | @@ -294,5 +294,7 @@ config LSM |
675 | 675 | |
676 | 676 | source "security/Kconfig.hardening" |
@@ -679,8 +679,8 @@ | ||
679 | 679 | + |
680 | 680 | endmenu |
681 | 681 | |
682 | ---- linux-5.4.215.orig/security/Makefile | |
683 | -+++ linux-5.4.215/security/Makefile | |
682 | +--- linux-5.4.219.orig/security/Makefile | |
683 | ++++ linux-5.4.219/security/Makefile | |
684 | 684 | @@ -34,3 +34,6 @@ obj-$(CONFIG_CGROUP_DEVICE) += device_c |
685 | 685 | # Object integrity file lists |
686 | 686 | subdir-$(CONFIG_INTEGRITY) += integrity |
@@ -688,8 +688,8 @@ | ||
688 | 688 | + |
689 | 689 | +subdir-$(CONFIG_CCSECURITY) += ccsecurity |
690 | 690 | +obj-$(CONFIG_CCSECURITY) += ccsecurity/ |
691 | ---- linux-5.4.215.orig/security/security.c | |
692 | -+++ linux-5.4.215/security/security.c | |
691 | +--- linux-5.4.219.orig/security/security.c | |
692 | ++++ linux-5.4.219/security/security.c | |
693 | 693 | @@ -1520,7 +1520,9 @@ int security_task_alloc(struct task_stru |
694 | 694 | |
695 | 695 | if (rc) |
@@ -1,6 +1,6 @@ | ||
1 | -This is TOMOYO Linux patch for kernel 6.0. | |
1 | +This is TOMOYO Linux patch for kernel 6.0.3. | |
2 | 2 | |
3 | -Source code for this patch is https://www.kernel.org/pub/linux/kernel/v6.x/linux-6.0.tar.xz | |
3 | +Source code for this patch is https://www.kernel.org/pub/linux/kernel/v6.x/linux-6.0.3.tar.xz | |
4 | 4 | --- |
5 | 5 | fs/exec.c | 2 - |
6 | 6 | fs/open.c | 2 + |
@@ -28,8 +28,8 @@ | ||
28 | 28 | security/security.c | 5 +++ |
29 | 29 | 24 files changed, 150 insertions(+), 30 deletions(-) |
30 | 30 | |
31 | ---- linux-6.0.orig/fs/exec.c | |
32 | -+++ linux-6.0/fs/exec.c | |
31 | +--- linux-6.0.3.orig/fs/exec.c | |
32 | ++++ linux-6.0.3/fs/exec.c | |
33 | 33 | @@ -1834,7 +1834,7 @@ static int bprm_execve(struct linux_binp |
34 | 34 | if (retval) |
35 | 35 | goto out; |
@@ -39,9 +39,9 @@ | ||
39 | 39 | if (retval < 0) |
40 | 40 | goto out; |
41 | 41 | |
42 | ---- linux-6.0.orig/fs/open.c | |
43 | -+++ linux-6.0/fs/open.c | |
44 | -@@ -1474,6 +1474,8 @@ SYSCALL_DEFINE3(close_range, unsigned in | |
42 | +--- linux-6.0.3.orig/fs/open.c | |
43 | ++++ linux-6.0.3/fs/open.c | |
44 | +@@ -1471,6 +1471,8 @@ SYSCALL_DEFINE3(close_range, unsigned in | |
45 | 45 | */ |
46 | 46 | SYSCALL_DEFINE0(vhangup) |
47 | 47 | { |
@@ -50,8 +50,8 @@ | ||
50 | 50 | if (capable(CAP_SYS_TTY_CONFIG)) { |
51 | 51 | tty_vhangup_self(); |
52 | 52 | return 0; |
53 | ---- linux-6.0.orig/fs/proc/version.c | |
54 | -+++ linux-6.0/fs/proc/version.c | |
53 | +--- linux-6.0.3.orig/fs/proc/version.c | |
54 | ++++ linux-6.0.3/fs/proc/version.c | |
55 | 55 | @@ -21,3 +21,10 @@ static int __init proc_version_init(void |
56 | 56 | return 0; |
57 | 57 | } |
@@ -59,12 +59,12 @@ | ||
59 | 59 | + |
60 | 60 | +static int __init ccs_show_version(void) |
61 | 61 | +{ |
62 | -+ printk(KERN_INFO "Hook version: 6.0 2022/10/04\n"); | |
62 | ++ printk(KERN_INFO "Hook version: 6.0.3 2022/10/24\n"); | |
63 | 63 | + return 0; |
64 | 64 | +} |
65 | 65 | +fs_initcall(ccs_show_version); |
66 | ---- linux-6.0.orig/include/linux/sched.h | |
67 | -+++ linux-6.0/include/linux/sched.h | |
66 | +--- linux-6.0.3.orig/include/linux/sched.h | |
67 | ++++ linux-6.0.3/include/linux/sched.h | |
68 | 68 | @@ -45,6 +45,7 @@ struct blk_plug; |
69 | 69 | struct bpf_local_storage; |
70 | 70 | struct bpf_run_ctx; |
@@ -84,8 +84,8 @@ | ||
84 | 84 | |
85 | 85 | #ifdef CONFIG_TRACING |
86 | 86 | /* State flags for use by tracers: */ |
87 | ---- linux-6.0.orig/include/linux/security.h | |
88 | -+++ linux-6.0/include/linux/security.h | |
87 | +--- linux-6.0.3.orig/include/linux/security.h | |
88 | ++++ linux-6.0.3/include/linux/security.h | |
89 | 89 | @@ -59,6 +59,7 @@ struct fs_parameter; |
90 | 90 | enum fs_value_type; |
91 | 91 | struct watch; |
@@ -305,8 +305,8 @@ | ||
305 | 305 | } |
306 | 306 | #endif /* CONFIG_SECURITY_PATH */ |
307 | 307 | |
308 | ---- linux-6.0.orig/include/net/ip.h | |
309 | -+++ linux-6.0/include/net/ip.h | |
308 | +--- linux-6.0.3.orig/include/net/ip.h | |
309 | ++++ linux-6.0.3/include/net/ip.h | |
310 | 310 | @@ -345,6 +345,8 @@ void inet_get_local_port_range(struct ne |
311 | 311 | #ifdef CONFIG_SYSCTL |
312 | 312 | static inline bool inet_is_local_reserved_port(struct net *net, unsigned short port) |
@@ -325,8 +325,8 @@ | ||
325 | 325 | return false; |
326 | 326 | } |
327 | 327 | |
328 | ---- linux-6.0.orig/init/init_task.c | |
329 | -+++ linux-6.0/init/init_task.c | |
328 | +--- linux-6.0.3.orig/init/init_task.c | |
329 | ++++ linux-6.0.3/init/init_task.c | |
330 | 330 | @@ -210,6 +210,10 @@ struct task_struct init_task |
331 | 331 | #ifdef CONFIG_SECCOMP_FILTER |
332 | 332 | .seccomp = { .filter_count = ATOMIC_INIT(0) }, |
@@ -338,8 +338,8 @@ | ||
338 | 338 | }; |
339 | 339 | EXPORT_SYMBOL(init_task); |
340 | 340 | |
341 | ---- linux-6.0.orig/kernel/kexec.c | |
342 | -+++ linux-6.0/kernel/kexec.c | |
341 | +--- linux-6.0.3.orig/kernel/kexec.c | |
342 | ++++ linux-6.0.3/kernel/kexec.c | |
343 | 343 | @@ -16,7 +16,7 @@ |
344 | 344 | #include <linux/syscalls.h> |
345 | 345 | #include <linux/vmalloc.h> |
@@ -358,8 +358,8 @@ | ||
358 | 358 | |
359 | 359 | /* Permit LSMs and IMA to fail the kexec */ |
360 | 360 | result = security_kernel_load_data(LOADING_KEXEC_IMAGE, false); |
361 | ---- linux-6.0.orig/kernel/module/main.c | |
362 | -+++ linux-6.0/kernel/module/main.c | |
361 | +--- linux-6.0.3.orig/kernel/module/main.c | |
362 | ++++ linux-6.0.3/kernel/module/main.c | |
363 | 363 | @@ -58,6 +58,7 @@ |
364 | 364 | |
365 | 365 | #define CREATE_TRACE_POINTS |
@@ -386,8 +386,8 @@ | ||
386 | 386 | |
387 | 387 | return 0; |
388 | 388 | } |
389 | ---- linux-6.0.orig/kernel/ptrace.c | |
390 | -+++ linux-6.0/kernel/ptrace.c | |
389 | +--- linux-6.0.3.orig/kernel/ptrace.c | |
390 | ++++ linux-6.0.3/kernel/ptrace.c | |
391 | 391 | @@ -1271,6 +1271,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l |
392 | 392 | { |
393 | 393 | struct task_struct *child; |
@@ -412,8 +412,8 @@ | ||
412 | 412 | |
413 | 413 | if (request == PTRACE_TRACEME) { |
414 | 414 | ret = ptrace_traceme(); |
415 | ---- linux-6.0.orig/kernel/reboot.c | |
416 | -+++ linux-6.0/kernel/reboot.c | |
415 | +--- linux-6.0.3.orig/kernel/reboot.c | |
416 | ++++ linux-6.0.3/kernel/reboot.c | |
417 | 417 | @@ -18,6 +18,7 @@ |
418 | 418 | #include <linux/syscalls.h> |
419 | 419 | #include <linux/syscore_ops.h> |
@@ -431,8 +431,8 @@ | ||
431 | 431 | |
432 | 432 | /* |
433 | 433 | * If pid namespaces are enabled and the current task is in a child |
434 | ---- linux-6.0.orig/kernel/sched/core.c | |
435 | -+++ linux-6.0/kernel/sched/core.c | |
434 | +--- linux-6.0.3.orig/kernel/sched/core.c | |
435 | ++++ linux-6.0.3/kernel/sched/core.c | |
436 | 436 | @@ -7075,6 +7075,8 @@ int can_nice(const struct task_struct *p |
437 | 437 | SYSCALL_DEFINE1(nice, int, increment) |
438 | 438 | { |
@@ -442,8 +442,8 @@ | ||
442 | 442 | |
443 | 443 | /* |
444 | 444 | * Setpriority might change our priority at the same moment. |
445 | ---- linux-6.0.orig/kernel/signal.c | |
446 | -+++ linux-6.0/kernel/signal.c | |
445 | +--- linux-6.0.3.orig/kernel/signal.c | |
446 | ++++ linux-6.0.3/kernel/signal.c | |
447 | 447 | @@ -3770,6 +3770,8 @@ static inline void prepare_kill_siginfo( |
448 | 448 | SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
449 | 449 | { |
@@ -511,8 +511,8 @@ | ||
511 | 511 | |
512 | 512 | return do_send_specific(tgid, pid, sig, info); |
513 | 513 | } |
514 | ---- linux-6.0.orig/kernel/sys.c | |
515 | -+++ linux-6.0/kernel/sys.c | |
514 | +--- linux-6.0.3.orig/kernel/sys.c | |
515 | ++++ linux-6.0.3/kernel/sys.c | |
516 | 516 | @@ -218,6 +218,10 @@ SYSCALL_DEFINE3(setpriority, int, which, |
517 | 517 | |
518 | 518 | if (which > PRIO_USER || which < PRIO_PROCESS) |
@@ -542,8 +542,8 @@ | ||
542 | 542 | |
543 | 543 | errno = -EFAULT; |
544 | 544 | if (!copy_from_user(tmp, name, len)) { |
545 | ---- linux-6.0.orig/kernel/time/timekeeping.c | |
546 | -+++ linux-6.0/kernel/time/timekeeping.c | |
545 | +--- linux-6.0.3.orig/kernel/time/timekeeping.c | |
546 | ++++ linux-6.0.3/kernel/time/timekeeping.c | |
547 | 547 | @@ -24,6 +24,7 @@ |
548 | 548 | #include <linux/compiler.h> |
549 | 549 | #include <linux/audit.h> |
@@ -577,8 +577,8 @@ | ||
577 | 577 | |
578 | 578 | /* |
579 | 579 | * Validate if a timespec/timeval used to inject a time |
580 | ---- linux-6.0.orig/net/ipv4/raw.c | |
581 | -+++ linux-6.0/net/ipv4/raw.c | |
580 | +--- linux-6.0.3.orig/net/ipv4/raw.c | |
581 | ++++ linux-6.0.3/net/ipv4/raw.c | |
582 | 582 | @@ -744,6 +744,10 @@ static int raw_recvmsg(struct sock *sk, |
583 | 583 | skb = skb_recv_datagram(sk, flags, &err); |
584 | 584 | if (!skb) |
@@ -590,8 +590,8 @@ | ||
590 | 590 | |
591 | 591 | copied = skb->len; |
592 | 592 | if (len < copied) { |
593 | ---- linux-6.0.orig/net/ipv4/udp.c | |
594 | -+++ linux-6.0/net/ipv4/udp.c | |
593 | +--- linux-6.0.3.orig/net/ipv4/udp.c | |
594 | ++++ linux-6.0.3/net/ipv4/udp.c | |
595 | 595 | @@ -1864,6 +1864,8 @@ try_again: |
596 | 596 | skb = __skb_recv_udp(sk, flags, &off, &err); |
597 | 597 | if (!skb) |
@@ -601,8 +601,8 @@ | ||
601 | 601 | |
602 | 602 | ulen = udp_skb_len(skb); |
603 | 603 | copied = len; |
604 | ---- linux-6.0.orig/net/ipv6/raw.c | |
605 | -+++ linux-6.0/net/ipv6/raw.c | |
604 | +--- linux-6.0.3.orig/net/ipv6/raw.c | |
605 | ++++ linux-6.0.3/net/ipv6/raw.c | |
606 | 606 | @@ -446,6 +446,10 @@ static int rawv6_recvmsg(struct sock *sk |
607 | 607 | skb = skb_recv_datagram(sk, flags, &err); |
608 | 608 | if (!skb) |
@@ -614,8 +614,8 @@ | ||
614 | 614 | |
615 | 615 | copied = skb->len; |
616 | 616 | if (copied > len) { |
617 | ---- linux-6.0.orig/net/ipv6/udp.c | |
618 | -+++ linux-6.0/net/ipv6/udp.c | |
617 | +--- linux-6.0.3.orig/net/ipv6/udp.c | |
618 | ++++ linux-6.0.3/net/ipv6/udp.c | |
619 | 619 | @@ -346,6 +346,8 @@ try_again: |
620 | 620 | skb = __skb_recv_udp(sk, flags, &off, &err); |
621 | 621 | if (!skb) |
@@ -625,8 +625,8 @@ | ||
625 | 625 | |
626 | 626 | ulen = udp6_skb_len(skb); |
627 | 627 | copied = len; |
628 | ---- linux-6.0.orig/net/socket.c | |
629 | -+++ linux-6.0/net/socket.c | |
628 | +--- linux-6.0.3.orig/net/socket.c | |
629 | ++++ linux-6.0.3/net/socket.c | |
630 | 630 | @@ -1858,6 +1858,10 @@ struct file *do_accept(struct file *file |
631 | 631 | if (err < 0) |
632 | 632 | goto out_fd; |
@@ -638,9 +638,9 @@ | ||
638 | 638 | if (upeer_sockaddr) { |
639 | 639 | len = newsock->ops->getname(newsock, |
640 | 640 | (struct sockaddr *)&address, 2); |
641 | ---- linux-6.0.orig/net/unix/af_unix.c | |
642 | -+++ linux-6.0/net/unix/af_unix.c | |
643 | -@@ -2435,6 +2435,10 @@ int __unix_dgram_recvmsg(struct sock *sk | |
641 | +--- linux-6.0.3.orig/net/unix/af_unix.c | |
642 | ++++ linux-6.0.3/net/unix/af_unix.c | |
643 | +@@ -2436,6 +2436,10 @@ int __unix_dgram_recvmsg(struct sock *sk | |
644 | 644 | EPOLLOUT | EPOLLWRNORM | |
645 | 645 | EPOLLWRBAND); |
646 | 646 |
@@ -651,7 +651,7 @@ | ||
651 | 651 | if (msg->msg_name) |
652 | 652 | unix_copy_addr(msg, skb->sk); |
653 | 653 | |
654 | -@@ -2485,6 +2489,7 @@ int __unix_dgram_recvmsg(struct sock *sk | |
654 | +@@ -2486,6 +2490,7 @@ int __unix_dgram_recvmsg(struct sock *sk | |
655 | 655 | |
656 | 656 | out_free: |
657 | 657 | skb_free_datagram(sk, skb); |
@@ -659,8 +659,8 @@ | ||
659 | 659 | mutex_unlock(&u->iolock); |
660 | 660 | out: |
661 | 661 | return err; |
662 | ---- linux-6.0.orig/security/Kconfig | |
663 | -+++ linux-6.0/security/Kconfig | |
662 | +--- linux-6.0.3.orig/security/Kconfig | |
663 | ++++ linux-6.0.3/security/Kconfig | |
664 | 664 | @@ -260,5 +260,7 @@ config LSM |
665 | 665 | |
666 | 666 | source "security/Kconfig.hardening" |
@@ -669,8 +669,8 @@ | ||
669 | 669 | + |
670 | 670 | endmenu |
671 | 671 | |
672 | ---- linux-6.0.orig/security/Makefile | |
673 | -+++ linux-6.0/security/Makefile | |
672 | +--- linux-6.0.3.orig/security/Makefile | |
673 | ++++ linux-6.0.3/security/Makefile | |
674 | 674 | @@ -27,3 +27,6 @@ obj-$(CONFIG_SECURITY_LANDLOCK) += land |
675 | 675 | |
676 | 676 | # Object integrity file lists |
@@ -678,8 +678,8 @@ | ||
678 | 678 | + |
679 | 679 | +subdir-$(CONFIG_CCSECURITY) += ccsecurity |
680 | 680 | +obj-$(CONFIG_CCSECURITY) += ccsecurity/ |
681 | ---- linux-6.0.orig/security/security.c | |
682 | -+++ linux-6.0/security/security.c | |
681 | +--- linux-6.0.3.orig/security/security.c | |
682 | ++++ linux-6.0.3/security/security.c | |
683 | 683 | @@ -1656,7 +1656,9 @@ int security_task_alloc(struct task_stru |
684 | 684 | |
685 | 685 | if (rc) |
@@ -0,0 +1,701 @@ | ||
1 | +This is TOMOYO Linux patch for kernel 6.1-rc2. | |
2 | + | |
3 | +Source code for this patch is https://git.kernel.org/torvalds/t/linux-6.1-rc2.tar.gz | |
4 | +--- | |
5 | + fs/exec.c | 2 - | |
6 | + fs/open.c | 2 + | |
7 | + fs/proc/version.c | 7 +++++ | |
8 | + include/linux/sched.h | 5 +++ | |
9 | + include/linux/security.h | 60 +++++++++++++++++++++++++--------------------- | |
10 | + include/net/ip.h | 4 +++ | |
11 | + init/init_task.c | 4 +++ | |
12 | + kernel/kexec.c | 4 ++- | |
13 | + kernel/module/main.c | 5 +++ | |
14 | + kernel/ptrace.c | 10 +++++++ | |
15 | + kernel/reboot.c | 3 ++ | |
16 | + kernel/sched/core.c | 2 + | |
17 | + kernel/signal.c | 25 +++++++++++++++++++ | |
18 | + kernel/sys.c | 8 ++++++ | |
19 | + kernel/time/timekeeping.c | 8 ++++++ | |
20 | + net/ipv4/raw.c | 4 +++ | |
21 | + net/ipv4/udp.c | 2 + | |
22 | + net/ipv6/raw.c | 4 +++ | |
23 | + net/ipv6/udp.c | 2 + | |
24 | + net/socket.c | 4 +++ | |
25 | + net/unix/af_unix.c | 5 +++ | |
26 | + security/Kconfig | 2 + | |
27 | + security/Makefile | 3 ++ | |
28 | + security/security.c | 5 +++ | |
29 | + 24 files changed, 150 insertions(+), 30 deletions(-) | |
30 | + | |
31 | +--- linux-6.1-rc2.orig/fs/exec.c | |
32 | ++++ linux-6.1-rc2/fs/exec.c | |
33 | +@@ -1834,7 +1834,7 @@ static int bprm_execve(struct linux_binp | |
34 | + if (retval) | |
35 | + goto out; | |
36 | + | |
37 | +- retval = exec_binprm(bprm); | |
38 | ++ retval = ccs_exec_binprm(bprm); | |
39 | + if (retval < 0) | |
40 | + goto out; | |
41 | + | |
42 | +--- linux-6.1-rc2.orig/fs/open.c | |
43 | ++++ linux-6.1-rc2/fs/open.c | |
44 | +@@ -1471,6 +1471,8 @@ SYSCALL_DEFINE3(close_range, unsigned in | |
45 | + */ | |
46 | + SYSCALL_DEFINE0(vhangup) | |
47 | + { | |
48 | ++ if (!ccs_capable(CCS_SYS_VHANGUP)) | |
49 | ++ return -EPERM; | |
50 | + if (capable(CAP_SYS_TTY_CONFIG)) { | |
51 | + tty_vhangup_self(); | |
52 | + return 0; | |
53 | +--- linux-6.1-rc2.orig/fs/proc/version.c | |
54 | ++++ linux-6.1-rc2/fs/proc/version.c | |
55 | +@@ -25,3 +25,10 @@ static int __init proc_version_init(void | |
56 | + return 0; | |
57 | + } | |
58 | + fs_initcall(proc_version_init); | |
59 | ++ | |
60 | ++static int __init ccs_show_version(void) | |
61 | ++{ | |
62 | ++ printk(KERN_INFO "Hook version: 6.1-rc2 2022/10/24\n"); | |
63 | ++ return 0; | |
64 | ++} | |
65 | ++fs_initcall(ccs_show_version); | |
66 | +--- linux-6.1-rc2.orig/include/linux/sched.h | |
67 | ++++ linux-6.1-rc2/include/linux/sched.h | |
68 | +@@ -46,6 +46,7 @@ struct blk_plug; | |
69 | + struct bpf_local_storage; | |
70 | + struct bpf_run_ctx; | |
71 | + struct capture_control; | |
72 | ++struct ccs_domain_info; | |
73 | + struct cfs_rq; | |
74 | + struct fs_struct; | |
75 | + struct futex_pi_state; | |
76 | +@@ -1398,6 +1399,10 @@ struct task_struct { | |
77 | + /* Pause tracing: */ | |
78 | + atomic_t tracing_graph_pause; | |
79 | + #endif | |
80 | ++#if defined(CONFIG_CCSECURITY) && !defined(CONFIG_CCSECURITY_USE_EXTERNAL_TASK_SECURITY) | |
81 | ++ struct ccs_domain_info *ccs_domain_info; | |
82 | ++ u32 ccs_flags; | |
83 | ++#endif | |
84 | + | |
85 | + #ifdef CONFIG_TRACING | |
86 | + /* Bitmask and counter of trace recursion: */ | |
87 | +--- linux-6.1-rc2.orig/include/linux/security.h | |
88 | ++++ linux-6.1-rc2/include/linux/security.h | |
89 | +@@ -59,6 +59,7 @@ struct fs_parameter; | |
90 | + enum fs_value_type; | |
91 | + struct watch; | |
92 | + struct watch_notification; | |
93 | ++#include <linux/ccsecurity.h> | |
94 | + | |
95 | + /* Default (no) options for the capable function */ | |
96 | + #define CAP_OPT_NONE 0x0 | |
97 | +@@ -593,7 +594,10 @@ static inline int security_syslog(int ty | |
98 | + static inline int security_settime64(const struct timespec64 *ts, | |
99 | + const struct timezone *tz) | |
100 | + { | |
101 | +- return cap_settime(ts, tz); | |
102 | ++ int error = cap_settime(ts, tz); | |
103 | ++ if (!error) | |
104 | ++ error = ccs_settime(ts, tz); | |
105 | ++ return error; | |
106 | + } | |
107 | + | |
108 | + static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) | |
109 | +@@ -686,18 +690,18 @@ static inline int security_sb_mount(cons | |
110 | + const char *type, unsigned long flags, | |
111 | + void *data) | |
112 | + { | |
113 | +- return 0; | |
114 | ++ return ccs_sb_mount(dev_name, path, type, flags, data); | |
115 | + } | |
116 | + | |
117 | + static inline int security_sb_umount(struct vfsmount *mnt, int flags) | |
118 | + { | |
119 | +- return 0; | |
120 | ++ return ccs_sb_umount(mnt, flags); | |
121 | + } | |
122 | + | |
123 | + static inline int security_sb_pivotroot(const struct path *old_path, | |
124 | + const struct path *new_path) | |
125 | + { | |
126 | +- return 0; | |
127 | ++ return ccs_sb_pivotroot(old_path, new_path); | |
128 | + } | |
129 | + | |
130 | + static inline int security_sb_set_mnt_opts(struct super_block *sb, | |
131 | +@@ -719,7 +723,7 @@ static inline int security_sb_clone_mnt_ | |
132 | + static inline int security_move_mount(const struct path *from_path, | |
133 | + const struct path *to_path) | |
134 | + { | |
135 | +- return 0; | |
136 | ++ return ccs_move_mount_permission(from_path, to_path); | |
137 | + } | |
138 | + | |
139 | + static inline int security_path_notify(const struct path *path, u64 mask, | |
140 | +@@ -862,7 +866,7 @@ static inline int security_inode_setattr | |
141 | + | |
142 | + static inline int security_inode_getattr(const struct path *path) | |
143 | + { | |
144 | +- return 0; | |
145 | ++ return ccs_inode_getattr(path); | |
146 | + } | |
147 | + | |
148 | + static inline int security_inode_setxattr(struct user_namespace *mnt_userns, | |
149 | +@@ -960,7 +964,7 @@ static inline void security_file_free(st | |
150 | + static inline int security_file_ioctl(struct file *file, unsigned int cmd, | |
151 | + unsigned long arg) | |
152 | + { | |
153 | +- return 0; | |
154 | ++ return ccs_file_ioctl(file, cmd, arg); | |
155 | + } | |
156 | + | |
157 | + static inline int security_mmap_file(struct file *file, unsigned long prot, | |
158 | +@@ -989,7 +993,7 @@ static inline int security_file_lock(str | |
159 | + static inline int security_file_fcntl(struct file *file, unsigned int cmd, | |
160 | + unsigned long arg) | |
161 | + { | |
162 | +- return 0; | |
163 | ++ return ccs_file_fcntl(file, cmd, arg); | |
164 | + } | |
165 | + | |
166 | + static inline void security_file_set_fowner(struct file *file) | |
167 | +@@ -1011,17 +1015,19 @@ static inline int security_file_receive( | |
168 | + | |
169 | + static inline int security_file_open(struct file *file) | |
170 | + { | |
171 | +- return 0; | |
172 | ++ return ccs_file_open(file); | |
173 | + } | |
174 | + | |
175 | + static inline int security_task_alloc(struct task_struct *task, | |
176 | + unsigned long clone_flags) | |
177 | + { | |
178 | +- return 0; | |
179 | ++ return ccs_alloc_task_security(task); | |
180 | + } | |
181 | + | |
182 | + static inline void security_task_free(struct task_struct *task) | |
183 | +-{ } | |
184 | ++{ | |
185 | ++ ccs_free_task_security(task); | |
186 | ++} | |
187 | + | |
188 | + static inline int security_cred_alloc_blank(struct cred *cred, gfp_t gfp) | |
189 | + { | |
190 | +@@ -1461,7 +1467,7 @@ static inline int security_unix_may_send | |
191 | + static inline int security_socket_create(int family, int type, | |
192 | + int protocol, int kern) | |
193 | + { | |
194 | +- return 0; | |
195 | ++ return ccs_socket_create(family, type, protocol, kern); | |
196 | + } | |
197 | + | |
198 | + static inline int security_socket_post_create(struct socket *sock, | |
199 | +@@ -1482,19 +1488,19 @@ static inline int security_socket_bind(s | |
200 | + struct sockaddr *address, | |
201 | + int addrlen) | |
202 | + { | |
203 | +- return 0; | |
204 | ++ return ccs_socket_bind(sock, address, addrlen); | |
205 | + } | |
206 | + | |
207 | + static inline int security_socket_connect(struct socket *sock, | |
208 | + struct sockaddr *address, | |
209 | + int addrlen) | |
210 | + { | |
211 | +- return 0; | |
212 | ++ return ccs_socket_connect(sock, address, addrlen); | |
213 | + } | |
214 | + | |
215 | + static inline int security_socket_listen(struct socket *sock, int backlog) | |
216 | + { | |
217 | +- return 0; | |
218 | ++ return ccs_socket_listen(sock, backlog); | |
219 | + } | |
220 | + | |
221 | + static inline int security_socket_accept(struct socket *sock, | |
222 | +@@ -1506,7 +1512,7 @@ static inline int security_socket_accept | |
223 | + static inline int security_socket_sendmsg(struct socket *sock, | |
224 | + struct msghdr *msg, int size) | |
225 | + { | |
226 | +- return 0; | |
227 | ++ return ccs_socket_sendmsg(sock, msg, size); | |
228 | + } | |
229 | + | |
230 | + static inline int security_socket_recvmsg(struct socket *sock, | |
231 | +@@ -1803,42 +1809,42 @@ int security_path_chroot(const struct pa | |
232 | + #else /* CONFIG_SECURITY_PATH */ | |
233 | + static inline int security_path_unlink(const struct path *dir, struct dentry *dentry) | |
234 | + { | |
235 | +- return 0; | |
236 | ++ return ccs_path_unlink(dir, dentry); | |
237 | + } | |
238 | + | |
239 | + static inline int security_path_mkdir(const struct path *dir, struct dentry *dentry, | |
240 | + umode_t mode) | |
241 | + { | |
242 | +- return 0; | |
243 | ++ return ccs_path_mkdir(dir, dentry, mode); | |
244 | + } | |
245 | + | |
246 | + static inline int security_path_rmdir(const struct path *dir, struct dentry *dentry) | |
247 | + { | |
248 | +- return 0; | |
249 | ++ return ccs_path_rmdir(dir, dentry); | |
250 | + } | |
251 | + | |
252 | + static inline int security_path_mknod(const struct path *dir, struct dentry *dentry, | |
253 | + umode_t mode, unsigned int dev) | |
254 | + { | |
255 | +- return 0; | |
256 | ++ return ccs_path_mknod(dir, dentry, mode, dev); | |
257 | + } | |
258 | + | |
259 | + static inline int security_path_truncate(const struct path *path) | |
260 | + { | |
261 | +- return 0; | |
262 | ++ return ccs_path_truncate(path); | |
263 | + } | |
264 | + | |
265 | + static inline int security_path_symlink(const struct path *dir, struct dentry *dentry, | |
266 | + const char *old_name) | |
267 | + { | |
268 | +- return 0; | |
269 | ++ return ccs_path_symlink(dir, dentry, old_name); | |
270 | + } | |
271 | + | |
272 | + static inline int security_path_link(struct dentry *old_dentry, | |
273 | + const struct path *new_dir, | |
274 | + struct dentry *new_dentry) | |
275 | + { | |
276 | +- return 0; | |
277 | ++ return ccs_path_link(old_dentry, new_dir, new_dentry); | |
278 | + } | |
279 | + | |
280 | + static inline int security_path_rename(const struct path *old_dir, | |
281 | +@@ -1847,22 +1853,22 @@ static inline int security_path_rename(c | |
282 | + struct dentry *new_dentry, | |
283 | + unsigned int flags) | |
284 | + { | |
285 | +- return 0; | |
286 | ++ return ccs_path_rename(old_dir, old_dentry, new_dir, new_dentry, flags); | |
287 | + } | |
288 | + | |
289 | + static inline int security_path_chmod(const struct path *path, umode_t mode) | |
290 | + { | |
291 | +- return 0; | |
292 | ++ return ccs_path_chmod(path, mode); | |
293 | + } | |
294 | + | |
295 | + static inline int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) | |
296 | + { | |
297 | +- return 0; | |
298 | ++ return ccs_path_chown(path, uid, gid); | |
299 | + } | |
300 | + | |
301 | + static inline int security_path_chroot(const struct path *path) | |
302 | + { | |
303 | +- return 0; | |
304 | ++ return ccs_path_chroot(path); | |
305 | + } | |
306 | + #endif /* CONFIG_SECURITY_PATH */ | |
307 | + | |
308 | +--- linux-6.1-rc2.orig/include/net/ip.h | |
309 | ++++ linux-6.1-rc2/include/net/ip.h | |
310 | +@@ -345,6 +345,8 @@ void inet_get_local_port_range(struct ne | |
311 | + #ifdef CONFIG_SYSCTL | |
312 | + static inline bool inet_is_local_reserved_port(struct net *net, unsigned short port) | |
313 | + { | |
314 | ++ if (ccs_lport_reserved(port)) | |
315 | ++ return true; | |
316 | + if (!net->ipv4.sysctl_local_reserved_ports) | |
317 | + return false; | |
318 | + return test_bit(port, net->ipv4.sysctl_local_reserved_ports); | |
319 | +@@ -363,6 +365,8 @@ static inline bool inet_port_requires_bi | |
320 | + #else | |
321 | + static inline bool inet_is_local_reserved_port(struct net *net, unsigned short port) | |
322 | + { | |
323 | ++ if (ccs_lport_reserved(port)) | |
324 | ++ return true; | |
325 | + return false; | |
326 | + } | |
327 | + | |
328 | +--- linux-6.1-rc2.orig/init/init_task.c | |
329 | ++++ linux-6.1-rc2/init/init_task.c | |
330 | +@@ -210,6 +210,10 @@ struct task_struct init_task | |
331 | + #ifdef CONFIG_SECCOMP_FILTER | |
332 | + .seccomp = { .filter_count = ATOMIC_INIT(0) }, | |
333 | + #endif | |
334 | ++#if defined(CONFIG_CCSECURITY) && !defined(CONFIG_CCSECURITY_USE_EXTERNAL_TASK_SECURITY) | |
335 | ++ .ccs_domain_info = NULL, | |
336 | ++ .ccs_flags = 0, | |
337 | ++#endif | |
338 | + }; | |
339 | + EXPORT_SYMBOL(init_task); | |
340 | + | |
341 | +--- linux-6.1-rc2.orig/kernel/kexec.c | |
342 | ++++ linux-6.1-rc2/kernel/kexec.c | |
343 | +@@ -16,7 +16,7 @@ | |
344 | + #include <linux/syscalls.h> | |
345 | + #include <linux/vmalloc.h> | |
346 | + #include <linux/slab.h> | |
347 | +- | |
348 | ++#include <linux/ccsecurity.h> | |
349 | + #include "kexec_internal.h" | |
350 | + | |
351 | + static int kimage_alloc_init(struct kimage **rimage, unsigned long entry, | |
352 | +@@ -195,6 +195,8 @@ static inline int kexec_load_check(unsig | |
353 | + /* We only trust the superuser with rebooting the system. */ | |
354 | + if (!capable(CAP_SYS_BOOT) || kexec_load_disabled) | |
355 | + return -EPERM; | |
356 | ++ if (!ccs_capable(CCS_SYS_KEXEC_LOAD)) | |
357 | ++ return -EPERM; | |
358 | + | |
359 | + /* Permit LSMs and IMA to fail the kexec */ | |
360 | + result = security_kernel_load_data(LOADING_KEXEC_IMAGE, false); | |
361 | +--- linux-6.1-rc2.orig/kernel/module/main.c | |
362 | ++++ linux-6.1-rc2/kernel/module/main.c | |
363 | +@@ -59,6 +59,7 @@ | |
364 | + | |
365 | + #define CREATE_TRACE_POINTS | |
366 | + #include <trace/events/module.h> | |
367 | ++#include <linux/ccsecurity.h> | |
368 | + | |
369 | + /* | |
370 | + * Mutex protects: | |
371 | +@@ -703,6 +704,8 @@ SYSCALL_DEFINE2(delete_module, const cha | |
372 | + | |
373 | + if (!capable(CAP_SYS_MODULE) || modules_disabled) | |
374 | + return -EPERM; | |
375 | ++ if (!ccs_capable(CCS_USE_KERNEL_MODULE)) | |
376 | ++ return -EPERM; | |
377 | + | |
378 | + if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0) | |
379 | + return -EFAULT; | |
380 | +@@ -2546,6 +2549,8 @@ static int may_init_module(void) | |
381 | + { | |
382 | + if (!capable(CAP_SYS_MODULE) || modules_disabled) | |
383 | + return -EPERM; | |
384 | ++ if (!ccs_capable(CCS_USE_KERNEL_MODULE)) | |
385 | ++ return -EPERM; | |
386 | + | |
387 | + return 0; | |
388 | + } | |
389 | +--- linux-6.1-rc2.orig/kernel/ptrace.c | |
390 | ++++ linux-6.1-rc2/kernel/ptrace.c | |
391 | +@@ -1271,6 +1271,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l | |
392 | + { | |
393 | + struct task_struct *child; | |
394 | + long ret; | |
395 | ++ { | |
396 | ++ const int rc = ccs_ptrace_permission(request, pid); | |
397 | ++ if (rc) | |
398 | ++ return rc; | |
399 | ++ } | |
400 | + | |
401 | + if (request == PTRACE_TRACEME) { | |
402 | + ret = ptrace_traceme(); | |
403 | +@@ -1410,6 +1415,11 @@ COMPAT_SYSCALL_DEFINE4(ptrace, compat_lo | |
404 | + { | |
405 | + struct task_struct *child; | |
406 | + long ret; | |
407 | ++ { | |
408 | ++ const int rc = ccs_ptrace_permission(request, pid); | |
409 | ++ if (rc) | |
410 | ++ return rc; | |
411 | ++ } | |
412 | + | |
413 | + if (request == PTRACE_TRACEME) { | |
414 | + ret = ptrace_traceme(); | |
415 | +--- linux-6.1-rc2.orig/kernel/reboot.c | |
416 | ++++ linux-6.1-rc2/kernel/reboot.c | |
417 | +@@ -18,6 +18,7 @@ | |
418 | + #include <linux/syscalls.h> | |
419 | + #include <linux/syscore_ops.h> | |
420 | + #include <linux/uaccess.h> | |
421 | ++#include <linux/ccsecurity.h> | |
422 | + | |
423 | + /* | |
424 | + * this indicates whether you can reboot with ctrl-alt-del: the default is yes | |
425 | +@@ -715,6 +716,8 @@ SYSCALL_DEFINE4(reboot, int, magic1, int | |
426 | + magic2 != LINUX_REBOOT_MAGIC2B && | |
427 | + magic2 != LINUX_REBOOT_MAGIC2C)) | |
428 | + return -EINVAL; | |
429 | ++ if (!ccs_capable(CCS_SYS_REBOOT)) | |
430 | ++ return -EPERM; | |
431 | + | |
432 | + /* | |
433 | + * If pid namespaces are enabled and the current task is in a child | |
434 | +--- linux-6.1-rc2.orig/kernel/sched/core.c | |
435 | ++++ linux-6.1-rc2/kernel/sched/core.c | |
436 | +@@ -7084,6 +7084,8 @@ int can_nice(const struct task_struct *p | |
437 | + SYSCALL_DEFINE1(nice, int, increment) | |
438 | + { | |
439 | + long nice, retval; | |
440 | ++ if (!ccs_capable(CCS_SYS_NICE)) | |
441 | ++ return -EPERM; | |
442 | + | |
443 | + /* | |
444 | + * Setpriority might change our priority at the same moment. | |
445 | +--- linux-6.1-rc2.orig/kernel/signal.c | |
446 | ++++ linux-6.1-rc2/kernel/signal.c | |
447 | +@@ -3771,6 +3771,8 @@ static inline void prepare_kill_siginfo( | |
448 | + SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) | |
449 | + { | |
450 | + struct kernel_siginfo info; | |
451 | ++ if (ccs_kill_permission(pid, sig)) | |
452 | ++ return -EPERM; | |
453 | + | |
454 | + prepare_kill_siginfo(sig, &info); | |
455 | + | |
456 | +@@ -3870,6 +3872,21 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, | |
457 | + if (!access_pidfd_pidns(pid)) | |
458 | + goto err; | |
459 | + | |
460 | ++ { | |
461 | ++ struct task_struct *task; | |
462 | ++ int id = 0; | |
463 | ++ | |
464 | ++ rcu_read_lock(); | |
465 | ++ task = pid_task(pid, PIDTYPE_PID); | |
466 | ++ if (task) | |
467 | ++ id = task_pid_vnr(task); | |
468 | ++ rcu_read_unlock(); | |
469 | ++ if (task && ccs_kill_permission(id, sig)) { | |
470 | ++ ret = -EPERM; | |
471 | ++ goto err; | |
472 | ++ } | |
473 | ++ } | |
474 | ++ | |
475 | + if (info) { | |
476 | + ret = copy_siginfo_from_user_any(&kinfo, info); | |
477 | + if (unlikely(ret)) | |
478 | +@@ -3954,6 +3971,8 @@ SYSCALL_DEFINE3(tgkill, pid_t, tgid, pid | |
479 | + /* This is only valid for single tasks */ | |
480 | + if (pid <= 0 || tgid <= 0) | |
481 | + return -EINVAL; | |
482 | ++ if (ccs_tgkill_permission(tgid, pid, sig)) | |
483 | ++ return -EPERM; | |
484 | + | |
485 | + return do_tkill(tgid, pid, sig); | |
486 | + } | |
487 | +@@ -3970,6 +3989,8 @@ SYSCALL_DEFINE2(tkill, pid_t, pid, int, | |
488 | + /* This is only valid for single tasks */ | |
489 | + if (pid <= 0) | |
490 | + return -EINVAL; | |
491 | ++ if (ccs_tkill_permission(pid, sig)) | |
492 | ++ return -EPERM; | |
493 | + | |
494 | + return do_tkill(0, pid, sig); | |
495 | + } | |
496 | +@@ -3982,6 +4003,8 @@ static int do_rt_sigqueueinfo(pid_t pid, | |
497 | + if ((info->si_code >= 0 || info->si_code == SI_TKILL) && | |
498 | + (task_pid_vnr(current) != pid)) | |
499 | + return -EPERM; | |
500 | ++ if (ccs_sigqueue_permission(pid, sig)) | |
501 | ++ return -EPERM; | |
502 | + | |
503 | + /* POSIX.1b doesn't mention process groups. */ | |
504 | + return kill_proc_info(sig, info, pid); | |
505 | +@@ -4029,6 +4052,8 @@ static int do_rt_tgsigqueueinfo(pid_t tg | |
506 | + if ((info->si_code >= 0 || info->si_code == SI_TKILL) && | |
507 | + (task_pid_vnr(current) != pid)) | |
508 | + return -EPERM; | |
509 | ++ if (ccs_tgsigqueue_permission(tgid, pid, sig)) | |
510 | ++ return -EPERM; | |
511 | + | |
512 | + return do_send_specific(tgid, pid, sig, info); | |
513 | + } | |
514 | +--- linux-6.1-rc2.orig/kernel/sys.c | |
515 | ++++ linux-6.1-rc2/kernel/sys.c | |
516 | +@@ -219,6 +219,10 @@ SYSCALL_DEFINE3(setpriority, int, which, | |
517 | + | |
518 | + if (which > PRIO_USER || which < PRIO_PROCESS) | |
519 | + goto out; | |
520 | ++ if (!ccs_capable(CCS_SYS_NICE)) { | |
521 | ++ error = -EPERM; | |
522 | ++ goto out; | |
523 | ++ } | |
524 | + | |
525 | + /* normalize: avoid signed division (rounding problems) */ | |
526 | + error = -ESRCH; | |
527 | +@@ -1363,6 +1367,8 @@ SYSCALL_DEFINE2(sethostname, char __user | |
528 | + | |
529 | + if (len < 0 || len > __NEW_UTS_LEN) | |
530 | + return -EINVAL; | |
531 | ++ if (!ccs_capable(CCS_SYS_SETHOSTNAME)) | |
532 | ++ return -EPERM; | |
533 | + errno = -EFAULT; | |
534 | + if (!copy_from_user(tmp, name, len)) { | |
535 | + struct new_utsname *u; | |
536 | +@@ -1416,6 +1422,8 @@ SYSCALL_DEFINE2(setdomainname, char __us | |
537 | + return -EPERM; | |
538 | + if (len < 0 || len > __NEW_UTS_LEN) | |
539 | + return -EINVAL; | |
540 | ++ if (!ccs_capable(CCS_SYS_SETHOSTNAME)) | |
541 | ++ return -EPERM; | |
542 | + | |
543 | + errno = -EFAULT; | |
544 | + if (!copy_from_user(tmp, name, len)) { | |
545 | +--- linux-6.1-rc2.orig/kernel/time/timekeeping.c | |
546 | ++++ linux-6.1-rc2/kernel/time/timekeeping.c | |
547 | +@@ -24,6 +24,7 @@ | |
548 | + #include <linux/compiler.h> | |
549 | + #include <linux/audit.h> | |
550 | + #include <linux/random.h> | |
551 | ++#include <linux/ccsecurity.h> | |
552 | + | |
553 | + #include "tick-internal.h" | |
554 | + #include "ntp_internal.h" | |
555 | +@@ -2348,10 +2349,15 @@ static int timekeeping_validate_timex(co | |
556 | + if (!(txc->modes & ADJ_OFFSET_READONLY) && | |
557 | + !capable(CAP_SYS_TIME)) | |
558 | + return -EPERM; | |
559 | ++ if (!(txc->modes & ADJ_OFFSET_READONLY) && | |
560 | ++ !ccs_capable(CCS_SYS_SETTIME)) | |
561 | ++ return -EPERM; | |
562 | + } else { | |
563 | + /* In order to modify anything, you gotta be super-user! */ | |
564 | + if (txc->modes && !capable(CAP_SYS_TIME)) | |
565 | + return -EPERM; | |
566 | ++ if (txc->modes && !ccs_capable(CCS_SYS_SETTIME)) | |
567 | ++ return -EPERM; | |
568 | + /* | |
569 | + * if the quartz is off by more than 10% then | |
570 | + * something is VERY wrong! | |
571 | +@@ -2366,6 +2372,8 @@ static int timekeeping_validate_timex(co | |
572 | + /* In order to inject time, you gotta be super-user! */ | |
573 | + if (!capable(CAP_SYS_TIME)) | |
574 | + return -EPERM; | |
575 | ++ if (!ccs_capable(CCS_SYS_SETTIME)) | |
576 | ++ return -EPERM; | |
577 | + | |
578 | + /* | |
579 | + * Validate if a timespec/timeval used to inject a time | |
580 | +--- linux-6.1-rc2.orig/net/ipv4/raw.c | |
581 | ++++ linux-6.1-rc2/net/ipv4/raw.c | |
582 | +@@ -744,6 +744,10 @@ static int raw_recvmsg(struct sock *sk, | |
583 | + skb = skb_recv_datagram(sk, flags, &err); | |
584 | + if (!skb) | |
585 | + goto out; | |
586 | ++ if (ccs_socket_post_recvmsg_permission(sk, skb, flags)) { | |
587 | ++ err = -EAGAIN; /* Hope less harmful than -EPERM. */ | |
588 | ++ goto out; | |
589 | ++ } | |
590 | + | |
591 | + copied = skb->len; | |
592 | + if (len < copied) { | |
593 | +--- linux-6.1-rc2.orig/net/ipv4/udp.c | |
594 | ++++ linux-6.1-rc2/net/ipv4/udp.c | |
595 | +@@ -1856,6 +1856,8 @@ try_again: | |
596 | + skb = __skb_recv_udp(sk, flags, &off, &err); | |
597 | + if (!skb) | |
598 | + return err; | |
599 | ++ if (ccs_socket_post_recvmsg_permission(sk, skb, flags)) | |
600 | ++ return -EAGAIN; /* Hope less harmful than -EPERM. */ | |
601 | + | |
602 | + ulen = udp_skb_len(skb); | |
603 | + copied = len; | |
604 | +--- linux-6.1-rc2.orig/net/ipv6/raw.c | |
605 | ++++ linux-6.1-rc2/net/ipv6/raw.c | |
606 | +@@ -446,6 +446,10 @@ static int rawv6_recvmsg(struct sock *sk | |
607 | + skb = skb_recv_datagram(sk, flags, &err); | |
608 | + if (!skb) | |
609 | + goto out; | |
610 | ++ if (ccs_socket_post_recvmsg_permission(sk, skb, flags)) { | |
611 | ++ err = -EAGAIN; /* Hope less harmful than -EPERM. */ | |
612 | ++ goto out; | |
613 | ++ } | |
614 | + | |
615 | + copied = skb->len; | |
616 | + if (copied > len) { | |
617 | +--- linux-6.1-rc2.orig/net/ipv6/udp.c | |
618 | ++++ linux-6.1-rc2/net/ipv6/udp.c | |
619 | +@@ -359,6 +359,8 @@ try_again: | |
620 | + skb = __skb_recv_udp(sk, flags, &off, &err); | |
621 | + if (!skb) | |
622 | + return err; | |
623 | ++ if (ccs_socket_post_recvmsg_permission(sk, skb, flags)) | |
624 | ++ return -EAGAIN; /* Hope less harmful than -EPERM. */ | |
625 | + | |
626 | + ulen = udp6_skb_len(skb); | |
627 | + copied = len; | |
628 | +--- linux-6.1-rc2.orig/net/socket.c | |
629 | ++++ linux-6.1-rc2/net/socket.c | |
630 | +@@ -1858,6 +1858,10 @@ struct file *do_accept(struct file *file | |
631 | + if (err < 0) | |
632 | + goto out_fd; | |
633 | + | |
634 | ++ if (ccs_socket_post_accept_permission(sock, newsock)) { | |
635 | ++ err = -EAGAIN; /* Hope less harmful than -EPERM. */ | |
636 | ++ goto out_fd; | |
637 | ++ } | |
638 | + if (upeer_sockaddr) { | |
639 | + len = newsock->ops->getname(newsock, | |
640 | + (struct sockaddr *)&address, 2); | |
641 | +--- linux-6.1-rc2.orig/net/unix/af_unix.c | |
642 | ++++ linux-6.1-rc2/net/unix/af_unix.c | |
643 | +@@ -2466,6 +2466,10 @@ int __unix_dgram_recvmsg(struct sock *sk | |
644 | + EPOLLOUT | EPOLLWRNORM | | |
645 | + EPOLLWRBAND); | |
646 | + | |
647 | ++ if (ccs_socket_post_recvmsg_permission(sk, skb, flags)) { | |
648 | ++ err = -EAGAIN; /* Hope less harmful than -EPERM. */ | |
649 | ++ goto out_unlock; | |
650 | ++ } | |
651 | + if (msg->msg_name) | |
652 | + unix_copy_addr(msg, skb->sk); | |
653 | + | |
654 | +@@ -2516,6 +2520,7 @@ int __unix_dgram_recvmsg(struct sock *sk | |
655 | + | |
656 | + out_free: | |
657 | + skb_free_datagram(sk, skb); | |
658 | ++out_unlock: | |
659 | + mutex_unlock(&u->iolock); | |
660 | + out: | |
661 | + return err; | |
662 | +--- linux-6.1-rc2.orig/security/Kconfig | |
663 | ++++ linux-6.1-rc2/security/Kconfig | |
664 | +@@ -260,5 +260,7 @@ config LSM | |
665 | + | |
666 | + source "security/Kconfig.hardening" | |
667 | + | |
668 | ++source "security/ccsecurity/Kconfig" | |
669 | ++ | |
670 | + endmenu | |
671 | + | |
672 | +--- linux-6.1-rc2.orig/security/Makefile | |
673 | ++++ linux-6.1-rc2/security/Makefile | |
674 | +@@ -27,3 +27,6 @@ obj-$(CONFIG_SECURITY_LANDLOCK) += land | |
675 | + | |
676 | + # Object integrity file lists | |
677 | + obj-$(CONFIG_INTEGRITY) += integrity/ | |
678 | ++ | |
679 | ++subdir-$(CONFIG_CCSECURITY) += ccsecurity | |
680 | ++obj-$(CONFIG_CCSECURITY) += ccsecurity/ | |
681 | +--- linux-6.1-rc2.orig/security/security.c | |
682 | ++++ linux-6.1-rc2/security/security.c | |
683 | +@@ -1658,7 +1658,9 @@ int security_task_alloc(struct task_stru | |
684 | + | |
685 | + if (rc) | |
686 | + return rc; | |
687 | +- rc = call_int_hook(task_alloc, 0, task, clone_flags); | |
688 | ++ rc = ccs_alloc_task_security(task); | |
689 | ++ if (likely(!rc)) | |
690 | ++ rc = call_int_hook(task_alloc, 0, task, clone_flags); | |
691 | + if (unlikely(rc)) | |
692 | + security_task_free(task); | |
693 | + return rc; | |
694 | +@@ -1667,6 +1669,7 @@ int security_task_alloc(struct task_stru | |
695 | + void security_task_free(struct task_struct *task) | |
696 | + { | |
697 | + call_void_hook(task_free, task); | |
698 | ++ ccs_free_task_security(task); | |
699 | + | |
700 | + kfree(task->security); | |
701 | + task->security = NULL; |