Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'hardening-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull hardening updates from Kees Cook:

- stackleak: Use str_enabled_disabled() helper (Thorsten Blum)

- Document GCC INIT_STACK_ALL_PATTERN behavior (Geert Uytterhoeven)

- Add task_prctl_unknown tracepoint (Marco Elver)

* tag 'hardening-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
hardening: Document INIT_STACK_ALL_PATTERN behavior with GCC
stackleak: Use str_enabled_disabled() helper in stack_erasing_sysctl()
tracing: Remove pid in task_rename tracing output
tracing: Add task_prctl_unknown tracepoint

+45 -6
+39 -5
include/trace/events/task.h
··· 38 38 TP_ARGS(task, comm), 39 39 40 40 TP_STRUCT__entry( 41 - __field( pid_t, pid) 42 41 __array( char, oldcomm, TASK_COMM_LEN) 43 42 __array( char, newcomm, TASK_COMM_LEN) 44 43 __field( short, oom_score_adj) 45 44 ), 46 45 47 46 TP_fast_assign( 48 - __entry->pid = task->pid; 49 47 memcpy(entry->oldcomm, task->comm, TASK_COMM_LEN); 50 48 strscpy(entry->newcomm, comm, TASK_COMM_LEN); 51 49 __entry->oom_score_adj = task->signal->oom_score_adj; 52 50 ), 53 51 54 - TP_printk("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%hd", 55 - __entry->pid, __entry->oldcomm, 56 - __entry->newcomm, __entry->oom_score_adj) 52 + TP_printk("oldcomm=%s newcomm=%s oom_score_adj=%hd", 53 + __entry->oldcomm, __entry->newcomm, __entry->oom_score_adj) 54 + ); 55 + 56 + /** 57 + * task_prctl_unknown - called on unknown prctl() option 58 + * @option: option passed 59 + * @arg2: arg2 passed 60 + * @arg3: arg3 passed 61 + * @arg4: arg4 passed 62 + * @arg5: arg5 passed 63 + * 64 + * Called on an unknown prctl() option. 65 + */ 66 + TRACE_EVENT(task_prctl_unknown, 67 + 68 + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, 69 + unsigned long arg4, unsigned long arg5), 70 + 71 + TP_ARGS(option, arg2, arg3, arg4, arg5), 72 + 73 + TP_STRUCT__entry( 74 + __field( int, option) 75 + __field( unsigned long, arg2) 76 + __field( unsigned long, arg3) 77 + __field( unsigned long, arg4) 78 + __field( unsigned long, arg5) 79 + ), 80 + 81 + TP_fast_assign( 82 + __entry->option = option; 83 + __entry->arg2 = arg2; 84 + __entry->arg3 = arg3; 85 + __entry->arg4 = arg4; 86 + __entry->arg5 = arg5; 87 + ), 88 + 89 + TP_printk("option=%d arg2=%ld arg3=%ld arg4=%ld arg5=%ld", 90 + __entry->option, __entry->arg2, __entry->arg3, __entry->arg4, __entry->arg5) 57 91 ); 58 92 59 93 #endif
+2 -1
kernel/stackleak.c
··· 15 15 16 16 #ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE 17 17 #include <linux/jump_label.h> 18 + #include <linux/string_choices.h> 18 19 #include <linux/sysctl.h> 19 20 #include <linux/init.h> 20 21 ··· 42 41 static_branch_enable(&stack_erasing_bypass); 43 42 44 43 pr_warn("stackleak: kernel stack erasing is %s\n", 45 - state ? "enabled" : "disabled"); 44 + str_enabled_disabled(state)); 46 45 return ret; 47 46 } 48 47 static struct ctl_table stackleak_sysctls[] = {
+3
kernel/sys.c
··· 75 75 #include <asm/io.h> 76 76 #include <asm/unistd.h> 77 77 78 + #include <trace/events/task.h> 79 + 78 80 #include "uid16.h" 79 81 80 82 #ifndef SET_UNALIGN_CTL ··· 2812 2810 error = arch_lock_shadow_stack_status(me, arg2); 2813 2811 break; 2814 2812 default: 2813 + trace_task_prctl_unknown(option, arg2, arg3, arg4, arg5); 2815 2814 error = -EINVAL; 2816 2815 break; 2817 2816 }
+1
security/Kconfig.hardening
··· 127 127 repeating for all types and padding except float and double 128 128 which use 0xFF repeating (-NaN). Clang on 32-bit uses 0xFF 129 129 repeating for all types and padding. 130 + GCC uses 0xFE repeating for all types, and zero for padding. 130 131 131 132 config INIT_STACK_ALL_ZERO 132 133 bool "zero-init everything (strongest and safest)"