| 1 |
This is TOMOYO Linux patch for linux-next. |
This is TOMOYO Linux patch for kernel 5.4-rc7. |
| 2 |
|
|
| 3 |
Source code for this patch is https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/snapshot/linux-next-next-20190915.tar.gz |
Source code for this patch is https://git.kernel.org/torvalds/t/linux-5.4-rc7.tar.gz |
| 4 |
--- |
--- |
| 5 |
fs/exec.c | 2 - |
fs/exec.c | 2 - |
| 6 |
fs/open.c | 2 + |
fs/open.c | 2 + |
| 28 |
security/security.c | 5 ++- |
security/security.c | 5 ++- |
| 29 |
24 files changed, 160 insertions(+), 30 deletions(-) |
24 files changed, 160 insertions(+), 30 deletions(-) |
| 30 |
|
|
| 31 |
--- linux-next.orig/fs/exec.c |
--- linux-5.4-rc7.orig/fs/exec.c |
| 32 |
+++ linux-next/fs/exec.c |
+++ linux-5.4-rc7/fs/exec.c |
| 33 |
@@ -1698,7 +1698,7 @@ static int exec_binprm(struct linux_binp |
@@ -1699,7 +1699,7 @@ static int exec_binprm(struct linux_binp |
| 34 |
old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent)); |
old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent)); |
| 35 |
rcu_read_unlock(); |
rcu_read_unlock(); |
| 36 |
|
|
| 39 |
if (ret >= 0) { |
if (ret >= 0) { |
| 40 |
audit_bprm(bprm); |
audit_bprm(bprm); |
| 41 |
trace_sched_process_exec(current, old_pid, bprm); |
trace_sched_process_exec(current, old_pid, bprm); |
| 42 |
--- linux-next.orig/fs/open.c |
--- linux-5.4-rc7.orig/fs/open.c |
| 43 |
+++ linux-next/fs/open.c |
+++ linux-5.4-rc7/fs/open.c |
| 44 |
@@ -1208,6 +1208,8 @@ SYSCALL_DEFINE1(close, unsigned int, fd) |
@@ -1208,6 +1208,8 @@ SYSCALL_DEFINE1(close, unsigned int, fd) |
| 45 |
*/ |
*/ |
| 46 |
SYSCALL_DEFINE0(vhangup) |
SYSCALL_DEFINE0(vhangup) |
| 50 |
if (capable(CAP_SYS_TTY_CONFIG)) { |
if (capable(CAP_SYS_TTY_CONFIG)) { |
| 51 |
tty_vhangup_self(); |
tty_vhangup_self(); |
| 52 |
return 0; |
return 0; |
| 53 |
--- linux-next.orig/fs/proc/version.c |
--- linux-5.4-rc7.orig/fs/proc/version.c |
| 54 |
+++ linux-next/fs/proc/version.c |
+++ linux-5.4-rc7/fs/proc/version.c |
| 55 |
@@ -21,3 +21,10 @@ static int __init proc_version_init(void |
@@ -21,3 +21,10 @@ static int __init proc_version_init(void |
| 56 |
return 0; |
return 0; |
| 57 |
} |
} |
| 59 |
+ |
+ |
| 60 |
+static int __init ccs_show_version(void) |
+static int __init ccs_show_version(void) |
| 61 |
+{ |
+{ |
| 62 |
+ printk(KERN_INFO "Hook version: 5.3-rc8-next-20190915 2019/09/16\n"); |
+ printk(KERN_INFO "Hook version: 5.4-rc7 2019/11/11\n"); |
| 63 |
+ return 0; |
+ return 0; |
| 64 |
+} |
+} |
| 65 |
+fs_initcall(ccs_show_version); |
+fs_initcall(ccs_show_version); |
| 66 |
--- linux-next.orig/include/linux/sched.h |
--- linux-5.4-rc7.orig/include/linux/sched.h |
| 67 |
+++ linux-next/include/linux/sched.h |
+++ linux-5.4-rc7/include/linux/sched.h |
| 68 |
@@ -38,6 +38,7 @@ struct backing_dev_info; |
@@ -38,6 +38,7 @@ struct backing_dev_info; |
| 69 |
struct bio_list; |
struct bio_list; |
| 70 |
struct blk_plug; |
struct blk_plug; |
| 73 |
struct cfs_rq; |
struct cfs_rq; |
| 74 |
struct fs_struct; |
struct fs_struct; |
| 75 |
struct futex_pi_state; |
struct futex_pi_state; |
| 76 |
@@ -1258,6 +1259,10 @@ struct task_struct { |
@@ -1260,6 +1261,10 @@ struct task_struct { |
| 77 |
/* Used by LSM modules for access restriction: */ |
/* Used by LSM modules for access restriction: */ |
| 78 |
void *security; |
void *security; |
| 79 |
#endif |
#endif |
| 84 |
|
|
| 85 |
#ifdef CONFIG_GCC_PLUGIN_STACKLEAK |
#ifdef CONFIG_GCC_PLUGIN_STACKLEAK |
| 86 |
unsigned long lowest_stack; |
unsigned long lowest_stack; |
| 87 |
--- linux-next.orig/include/linux/security.h |
--- linux-5.4-rc7.orig/include/linux/security.h |
| 88 |
+++ linux-next/include/linux/security.h |
+++ linux-5.4-rc7/include/linux/security.h |
| 89 |
@@ -59,6 +59,7 @@ struct fs_parameter; |
@@ -57,6 +57,7 @@ struct mm_struct; |
| 90 |
|
struct fs_context; |
| 91 |
|
struct fs_parameter; |
| 92 |
enum fs_value_type; |
enum fs_value_type; |
|
struct watch; |
|
|
struct watch_notification; |
|
| 93 |
+#include <linux/ccsecurity.h> |
+#include <linux/ccsecurity.h> |
| 94 |
|
|
| 95 |
/* Default (no) options for the capable function */ |
/* Default (no) options for the capable function */ |
| 96 |
#define CAP_OPT_NONE 0x0 |
#define CAP_OPT_NONE 0x0 |
| 97 |
@@ -559,7 +560,10 @@ static inline int security_syslog(int ty |
@@ -558,7 +559,10 @@ static inline int security_syslog(int ty |
| 98 |
static inline int security_settime64(const struct timespec64 *ts, |
static inline int security_settime64(const struct timespec64 *ts, |
| 99 |
const struct timezone *tz) |
const struct timezone *tz) |
| 100 |
{ |
{ |
| 106 |
} |
} |
| 107 |
|
|
| 108 |
static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) |
static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) |
| 109 |
@@ -636,18 +640,18 @@ static inline int security_sb_mount(cons |
@@ -635,18 +639,18 @@ static inline int security_sb_mount(cons |
| 110 |
const char *type, unsigned long flags, |
const char *type, unsigned long flags, |
| 111 |
void *data) |
void *data) |
| 112 |
{ |
{ |
| 128 |
} |
} |
| 129 |
|
|
| 130 |
static inline int security_sb_set_mnt_opts(struct super_block *sb, |
static inline int security_sb_set_mnt_opts(struct super_block *sb, |
| 131 |
@@ -675,7 +679,7 @@ static inline int security_add_mnt_opt(c |
@@ -674,7 +678,7 @@ static inline int security_add_mnt_opt(c |
| 132 |
static inline int security_move_mount(const struct path *from_path, |
static inline int security_move_mount(const struct path *from_path, |
| 133 |
const struct path *to_path) |
const struct path *to_path) |
| 134 |
{ |
{ |
| 137 |
} |
} |
| 138 |
|
|
| 139 |
static inline int security_path_notify(const struct path *path, u64 mask, |
static inline int security_path_notify(const struct path *path, u64 mask, |
| 140 |
@@ -809,7 +813,7 @@ static inline int security_inode_setattr |
@@ -808,7 +812,7 @@ static inline int security_inode_setattr |
| 141 |
|
|
| 142 |
static inline int security_inode_getattr(const struct path *path) |
static inline int security_inode_getattr(const struct path *path) |
| 143 |
{ |
{ |
| 146 |
} |
} |
| 147 |
|
|
| 148 |
static inline int security_inode_setxattr(struct dentry *dentry, |
static inline int security_inode_setxattr(struct dentry *dentry, |
| 149 |
@@ -901,7 +905,7 @@ static inline void security_file_free(st |
@@ -900,7 +904,7 @@ static inline void security_file_free(st |
| 150 |
static inline int security_file_ioctl(struct file *file, unsigned int cmd, |
static inline int security_file_ioctl(struct file *file, unsigned int cmd, |
| 151 |
unsigned long arg) |
unsigned long arg) |
| 152 |
{ |
{ |
| 155 |
} |
} |
| 156 |
|
|
| 157 |
static inline int security_mmap_file(struct file *file, unsigned long prot, |
static inline int security_mmap_file(struct file *file, unsigned long prot, |
| 158 |
@@ -930,7 +934,7 @@ static inline int security_file_lock(str |
@@ -929,7 +933,7 @@ static inline int security_file_lock(str |
| 159 |
static inline int security_file_fcntl(struct file *file, unsigned int cmd, |
static inline int security_file_fcntl(struct file *file, unsigned int cmd, |
| 160 |
unsigned long arg) |
unsigned long arg) |
| 161 |
{ |
{ |
| 164 |
} |
} |
| 165 |
|
|
| 166 |
static inline void security_file_set_fowner(struct file *file) |
static inline void security_file_set_fowner(struct file *file) |
| 167 |
@@ -952,17 +956,19 @@ static inline int security_file_receive( |
@@ -951,17 +955,19 @@ static inline int security_file_receive( |
| 168 |
|
|
| 169 |
static inline int security_file_open(struct file *file) |
static inline int security_file_open(struct file *file) |
| 170 |
{ |
{ |
| 187 |
|
|
| 188 |
static inline int security_cred_alloc_blank(struct cred *cred, gfp_t gfp) |
static inline int security_cred_alloc_blank(struct cred *cred, gfp_t gfp) |
| 189 |
{ |
{ |
| 190 |
@@ -1370,7 +1376,7 @@ static inline int security_unix_may_send |
@@ -1340,7 +1346,7 @@ static inline int security_unix_may_send |
| 191 |
static inline int security_socket_create(int family, int type, |
static inline int security_socket_create(int family, int type, |
| 192 |
int protocol, int kern) |
int protocol, int kern) |
| 193 |
{ |
{ |
| 196 |
} |
} |
| 197 |
|
|
| 198 |
static inline int security_socket_post_create(struct socket *sock, |
static inline int security_socket_post_create(struct socket *sock, |
| 199 |
@@ -1391,19 +1397,19 @@ static inline int security_socket_bind(s |
@@ -1361,19 +1367,19 @@ static inline int security_socket_bind(s |
| 200 |
struct sockaddr *address, |
struct sockaddr *address, |
| 201 |
int addrlen) |
int addrlen) |
| 202 |
{ |
{ |
| 219 |
} |
} |
| 220 |
|
|
| 221 |
static inline int security_socket_accept(struct socket *sock, |
static inline int security_socket_accept(struct socket *sock, |
| 222 |
@@ -1415,7 +1421,7 @@ static inline int security_socket_accept |
@@ -1385,7 +1391,7 @@ static inline int security_socket_accept |
| 223 |
static inline int security_socket_sendmsg(struct socket *sock, |
static inline int security_socket_sendmsg(struct socket *sock, |
| 224 |
struct msghdr *msg, int size) |
struct msghdr *msg, int size) |
| 225 |
{ |
{ |
| 228 |
} |
} |
| 229 |
|
|
| 230 |
static inline int security_socket_recvmsg(struct socket *sock, |
static inline int security_socket_recvmsg(struct socket *sock, |
| 231 |
@@ -1702,42 +1708,42 @@ int security_path_chroot(const struct pa |
@@ -1672,42 +1678,42 @@ int security_path_chroot(const struct pa |
| 232 |
#else /* CONFIG_SECURITY_PATH */ |
#else /* CONFIG_SECURITY_PATH */ |
| 233 |
static inline int security_path_unlink(const struct path *dir, struct dentry *dentry) |
static inline int security_path_unlink(const struct path *dir, struct dentry *dentry) |
| 234 |
{ |
{ |
| 278 |
} |
} |
| 279 |
|
|
| 280 |
static inline int security_path_rename(const struct path *old_dir, |
static inline int security_path_rename(const struct path *old_dir, |
| 281 |
@@ -1746,22 +1752,32 @@ static inline int security_path_rename(c |
@@ -1716,22 +1722,32 @@ static inline int security_path_rename(c |
| 282 |
struct dentry *new_dentry, |
struct dentry *new_dentry, |
| 283 |
unsigned int flags) |
unsigned int flags) |
| 284 |
{ |
{ |
| 315 |
} |
} |
| 316 |
#endif /* CONFIG_SECURITY_PATH */ |
#endif /* CONFIG_SECURITY_PATH */ |
| 317 |
|
|
| 318 |
--- linux-next.orig/include/net/ip.h |
--- linux-5.4-rc7.orig/include/net/ip.h |
| 319 |
+++ linux-next/include/net/ip.h |
+++ linux-5.4-rc7/include/net/ip.h |
| 320 |
@@ -341,6 +341,8 @@ void inet_get_local_port_range(struct ne |
@@ -341,6 +341,8 @@ void inet_get_local_port_range(struct ne |
| 321 |
#ifdef CONFIG_SYSCTL |
#ifdef CONFIG_SYSCTL |
| 322 |
static inline int inet_is_local_reserved_port(struct net *net, int port) |
static inline int inet_is_local_reserved_port(struct net *net, int port) |
| 335 |
return 0; |
return 0; |
| 336 |
} |
} |
| 337 |
|
|
| 338 |
--- linux-next.orig/init/init_task.c |
--- linux-5.4-rc7.orig/init/init_task.c |
| 339 |
+++ linux-next/init/init_task.c |
+++ linux-5.4-rc7/init/init_task.c |
| 340 |
@@ -181,6 +181,10 @@ struct task_struct init_task |
@@ -181,6 +181,10 @@ struct task_struct init_task |
| 341 |
#ifdef CONFIG_SECURITY |
#ifdef CONFIG_SECURITY |
| 342 |
.security = NULL, |
.security = NULL, |
| 348 |
}; |
}; |
| 349 |
EXPORT_SYMBOL(init_task); |
EXPORT_SYMBOL(init_task); |
| 350 |
|
|
| 351 |
--- linux-next.orig/kernel/kexec.c |
--- linux-5.4-rc7.orig/kernel/kexec.c |
| 352 |
+++ linux-next/kernel/kexec.c |
+++ linux-5.4-rc7/kernel/kexec.c |
| 353 |
@@ -16,7 +16,7 @@ |
@@ -16,7 +16,7 @@ |
| 354 |
#include <linux/syscalls.h> |
#include <linux/syscalls.h> |
| 355 |
#include <linux/vmalloc.h> |
#include <linux/vmalloc.h> |
| 368 |
|
|
| 369 |
/* Permit LSMs and IMA to fail the kexec */ |
/* Permit LSMs and IMA to fail the kexec */ |
| 370 |
result = security_kernel_load_data(LOADING_KEXEC_IMAGE); |
result = security_kernel_load_data(LOADING_KEXEC_IMAGE); |
| 371 |
--- linux-next.orig/kernel/module.c |
--- linux-5.4-rc7.orig/kernel/module.c |
| 372 |
+++ linux-next/kernel/module.c |
+++ linux-5.4-rc7/kernel/module.c |
| 373 |
@@ -55,6 +55,7 @@ |
@@ -55,6 +55,7 @@ |
| 374 |
#include <linux/audit.h> |
#include <linux/audit.h> |
| 375 |
#include <uapi/linux/module.h> |
#include <uapi/linux/module.h> |
| 378 |
|
|
| 379 |
#define CREATE_TRACE_POINTS |
#define CREATE_TRACE_POINTS |
| 380 |
#include <trace/events/module.h> |
#include <trace/events/module.h> |
| 381 |
@@ -965,6 +966,8 @@ SYSCALL_DEFINE2(delete_module, const cha |
@@ -973,6 +974,8 @@ SYSCALL_DEFINE2(delete_module, const cha |
| 382 |
|
|
| 383 |
if (!capable(CAP_SYS_MODULE) || modules_disabled) |
if (!capable(CAP_SYS_MODULE) || modules_disabled) |
| 384 |
return -EPERM; |
return -EPERM; |
| 387 |
|
|
| 388 |
if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0) |
if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0) |
| 389 |
return -EFAULT; |
return -EFAULT; |
| 390 |
@@ -3607,6 +3610,8 @@ static int may_init_module(void) |
@@ -3669,6 +3672,8 @@ static int may_init_module(void) |
| 391 |
{ |
{ |
| 392 |
if (!capable(CAP_SYS_MODULE) || modules_disabled) |
if (!capable(CAP_SYS_MODULE) || modules_disabled) |
| 393 |
return -EPERM; |
return -EPERM; |
| 396 |
|
|
| 397 |
return 0; |
return 0; |
| 398 |
} |
} |
| 399 |
--- linux-next.orig/kernel/ptrace.c |
--- linux-5.4-rc7.orig/kernel/ptrace.c |
| 400 |
+++ linux-next/kernel/ptrace.c |
+++ linux-5.4-rc7/kernel/ptrace.c |
| 401 |
@@ -1239,6 +1239,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l |
@@ -1239,6 +1239,11 @@ SYSCALL_DEFINE4(ptrace, long, request, l |
| 402 |
{ |
{ |
| 403 |
struct task_struct *child; |
struct task_struct *child; |
| 422 |
|
|
| 423 |
if (request == PTRACE_TRACEME) { |
if (request == PTRACE_TRACEME) { |
| 424 |
ret = ptrace_traceme(); |
ret = ptrace_traceme(); |
| 425 |
--- linux-next.orig/kernel/reboot.c |
--- linux-5.4-rc7.orig/kernel/reboot.c |
| 426 |
+++ linux-next/kernel/reboot.c |
+++ linux-5.4-rc7/kernel/reboot.c |
| 427 |
@@ -17,6 +17,7 @@ |
@@ -17,6 +17,7 @@ |
| 428 |
#include <linux/syscalls.h> |
#include <linux/syscalls.h> |
| 429 |
#include <linux/syscore_ops.h> |
#include <linux/syscore_ops.h> |
| 441 |
|
|
| 442 |
/* |
/* |
| 443 |
* If pid namespaces are enabled and the current task is in a child |
* If pid namespaces are enabled and the current task is in a child |
| 444 |
--- linux-next.orig/kernel/sched/core.c |
--- linux-5.4-rc7.orig/kernel/sched/core.c |
| 445 |
+++ linux-next/kernel/sched/core.c |
+++ linux-5.4-rc7/kernel/sched/core.c |
| 446 |
@@ -4560,6 +4560,8 @@ int can_nice(const struct task_struct *p |
@@ -4572,6 +4572,8 @@ int can_nice(const struct task_struct *p |
| 447 |
SYSCALL_DEFINE1(nice, int, increment) |
SYSCALL_DEFINE1(nice, int, increment) |
| 448 |
{ |
{ |
| 449 |
long nice, retval; |
long nice, retval; |
| 452 |
|
|
| 453 |
/* |
/* |
| 454 |
* Setpriority might change our priority at the same moment. |
* Setpriority might change our priority at the same moment. |
| 455 |
--- linux-next.orig/kernel/signal.c |
--- linux-5.4-rc7.orig/kernel/signal.c |
| 456 |
+++ linux-next/kernel/signal.c |
+++ linux-5.4-rc7/kernel/signal.c |
| 457 |
@@ -3634,6 +3634,8 @@ static inline void prepare_kill_siginfo( |
@@ -3634,6 +3634,8 @@ static inline void prepare_kill_siginfo( |
| 458 |
SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
| 459 |
{ |
{ |
| 521 |
|
|
| 522 |
return do_send_specific(tgid, pid, sig, info); |
return do_send_specific(tgid, pid, sig, info); |
| 523 |
} |
} |
| 524 |
--- linux-next.orig/kernel/sys.c |
--- linux-5.4-rc7.orig/kernel/sys.c |
| 525 |
+++ linux-next/kernel/sys.c |
+++ linux-5.4-rc7/kernel/sys.c |
| 526 |
@@ -204,6 +204,10 @@ SYSCALL_DEFINE3(setpriority, int, which, |
@@ -204,6 +204,10 @@ SYSCALL_DEFINE3(setpriority, int, which, |
| 527 |
|
|
| 528 |
if (which > PRIO_USER || which < PRIO_PROCESS) |
if (which > PRIO_USER || which < PRIO_PROCESS) |
| 552 |
|
|
| 553 |
errno = -EFAULT; |
errno = -EFAULT; |
| 554 |
if (!copy_from_user(tmp, name, len)) { |
if (!copy_from_user(tmp, name, len)) { |
| 555 |
--- linux-next.orig/kernel/time/timekeeping.c |
--- linux-5.4-rc7.orig/kernel/time/timekeeping.c |
| 556 |
+++ linux-next/kernel/time/timekeeping.c |
+++ linux-5.4-rc7/kernel/time/timekeeping.c |
| 557 |
@@ -22,6 +22,7 @@ |
@@ -22,6 +22,7 @@ |
| 558 |
#include <linux/pvclock_gtod.h> |
#include <linux/pvclock_gtod.h> |
| 559 |
#include <linux/compiler.h> |
#include <linux/compiler.h> |
| 587 |
|
|
| 588 |
/* |
/* |
| 589 |
* Validate if a timespec/timeval used to inject a time |
* Validate if a timespec/timeval used to inject a time |
| 590 |
--- linux-next.orig/net/ipv4/raw.c |
--- linux-5.4-rc7.orig/net/ipv4/raw.c |
| 591 |
+++ linux-next/net/ipv4/raw.c |
+++ linux-5.4-rc7/net/ipv4/raw.c |
| 592 |
@@ -767,6 +767,10 @@ static int raw_recvmsg(struct sock *sk, |
@@ -767,6 +767,10 @@ static int raw_recvmsg(struct sock *sk, |
| 593 |
skb = skb_recv_datagram(sk, flags, noblock, &err); |
skb = skb_recv_datagram(sk, flags, noblock, &err); |
| 594 |
if (!skb) |
if (!skb) |
| 600 |
|
|
| 601 |
copied = skb->len; |
copied = skb->len; |
| 602 |
if (len < copied) { |
if (len < copied) { |
| 603 |
--- linux-next.orig/net/ipv4/udp.c |
--- linux-5.4-rc7.orig/net/ipv4/udp.c |
| 604 |
+++ linux-next/net/ipv4/udp.c |
+++ linux-5.4-rc7/net/ipv4/udp.c |
| 605 |
@@ -1708,6 +1708,8 @@ try_again: |
@@ -1723,6 +1723,8 @@ try_again: |
| 606 |
skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
| 607 |
if (!skb) |
if (!skb) |
| 608 |
return err; |
return err; |
| 611 |
|
|
| 612 |
ulen = udp_skb_len(skb); |
ulen = udp_skb_len(skb); |
| 613 |
copied = len; |
copied = len; |
| 614 |
--- linux-next.orig/net/ipv6/raw.c |
--- linux-5.4-rc7.orig/net/ipv6/raw.c |
| 615 |
+++ linux-next/net/ipv6/raw.c |
+++ linux-5.4-rc7/net/ipv6/raw.c |
| 616 |
@@ -480,6 +480,10 @@ static int rawv6_recvmsg(struct sock *sk |
@@ -480,6 +480,10 @@ static int rawv6_recvmsg(struct sock *sk |
| 617 |
skb = skb_recv_datagram(sk, flags, noblock, &err); |
skb = skb_recv_datagram(sk, flags, noblock, &err); |
| 618 |
if (!skb) |
if (!skb) |
| 624 |
|
|
| 625 |
copied = skb->len; |
copied = skb->len; |
| 626 |
if (copied > len) { |
if (copied > len) { |
| 627 |
--- linux-next.orig/net/ipv6/udp.c |
--- linux-5.4-rc7.orig/net/ipv6/udp.c |
| 628 |
+++ linux-next/net/ipv6/udp.c |
+++ linux-5.4-rc7/net/ipv6/udp.c |
| 629 |
@@ -287,6 +287,8 @@ try_again: |
@@ -288,6 +288,8 @@ try_again: |
| 630 |
skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
skb = __skb_recv_udp(sk, flags, noblock, &off, &err); |
| 631 |
if (!skb) |
if (!skb) |
| 632 |
return err; |
return err; |
| 635 |
|
|
| 636 |
ulen = udp6_skb_len(skb); |
ulen = udp6_skb_len(skb); |
| 637 |
copied = len; |
copied = len; |
| 638 |
--- linux-next.orig/net/socket.c |
--- linux-5.4-rc7.orig/net/socket.c |
| 639 |
+++ linux-next/net/socket.c |
+++ linux-5.4-rc7/net/socket.c |
| 640 |
@@ -1756,6 +1756,10 @@ int __sys_accept4(int fd, struct sockadd |
@@ -1755,6 +1755,10 @@ int __sys_accept4(int fd, struct sockadd |
| 641 |
if (err < 0) |
if (err < 0) |
| 642 |
goto out_fd; |
goto out_fd; |
| 643 |
|
|
| 648 |
if (upeer_sockaddr) { |
if (upeer_sockaddr) { |
| 649 |
len = newsock->ops->getname(newsock, |
len = newsock->ops->getname(newsock, |
| 650 |
(struct sockaddr *)&address, 2); |
(struct sockaddr *)&address, 2); |
| 651 |
--- linux-next.orig/net/unix/af_unix.c |
--- linux-5.4-rc7.orig/net/unix/af_unix.c |
| 652 |
+++ linux-next/net/unix/af_unix.c |
+++ linux-5.4-rc7/net/unix/af_unix.c |
| 653 |
@@ -2087,6 +2087,10 @@ static int unix_dgram_recvmsg(struct soc |
@@ -2075,6 +2075,10 @@ static int unix_dgram_recvmsg(struct soc |
| 654 |
EPOLLOUT | EPOLLWRNORM | |
EPOLLOUT | EPOLLWRNORM | |
| 655 |
EPOLLWRBAND); |
EPOLLWRBAND); |
| 656 |
|
|
| 661 |
if (msg->msg_name) |
if (msg->msg_name) |
| 662 |
unix_copy_addr(msg, skb->sk); |
unix_copy_addr(msg, skb->sk); |
| 663 |
|
|
| 664 |
@@ -2137,6 +2141,7 @@ static int unix_dgram_recvmsg(struct soc |
@@ -2125,6 +2129,7 @@ static int unix_dgram_recvmsg(struct soc |
| 665 |
|
|
| 666 |
out_free: |
out_free: |
| 667 |
skb_free_datagram(sk, skb); |
skb_free_datagram(sk, skb); |
| 669 |
mutex_unlock(&u->iolock); |
mutex_unlock(&u->iolock); |
| 670 |
out: |
out: |
| 671 |
return err; |
return err; |
| 672 |
--- linux-next.orig/security/Kconfig |
--- linux-5.4-rc7.orig/security/Kconfig |
| 673 |
+++ linux-next/security/Kconfig |
+++ linux-5.4-rc7/security/Kconfig |
| 674 |
@@ -291,5 +291,7 @@ config LSM |
@@ -291,5 +291,7 @@ config LSM |
| 675 |
|
|
| 676 |
source "security/Kconfig.hardening" |
source "security/Kconfig.hardening" |
| 679 |
+ |
+ |
| 680 |
endmenu |
endmenu |
| 681 |
|
|
| 682 |
--- linux-next.orig/security/Makefile |
--- linux-5.4-rc7.orig/security/Makefile |
| 683 |
+++ linux-next/security/Makefile |
+++ linux-5.4-rc7/security/Makefile |
| 684 |
@@ -34,3 +34,6 @@ obj-$(CONFIG_CGROUP_DEVICE) += device_c |
@@ -34,3 +34,6 @@ obj-$(CONFIG_CGROUP_DEVICE) += device_c |
| 685 |
# Object integrity file lists |
# Object integrity file lists |
| 686 |
subdir-$(CONFIG_INTEGRITY) += integrity |
subdir-$(CONFIG_INTEGRITY) += integrity |
| 688 |
+ |
+ |
| 689 |
+subdir-$(CONFIG_CCSECURITY) += ccsecurity |
+subdir-$(CONFIG_CCSECURITY) += ccsecurity |
| 690 |
+obj-$(CONFIG_CCSECURITY) += ccsecurity/ |
+obj-$(CONFIG_CCSECURITY) += ccsecurity/ |
| 691 |
--- linux-next.orig/security/security.c |
--- linux-5.4-rc7.orig/security/security.c |
| 692 |
+++ linux-next/security/security.c |
+++ linux-5.4-rc7/security/security.c |
| 693 |
@@ -1507,7 +1507,9 @@ int security_task_alloc(struct task_stru |
@@ -1507,7 +1507,9 @@ int security_task_alloc(struct task_stru |
| 694 |
|
|
| 695 |
if (rc) |
if (rc) |