# git rev-parse -q --verify fa4b851b4ad632dc673627f38a8a552547568a2c^{commit} fa4b851b4ad632dc673627f38a8a552547568a2c already have revision, skipping fetch # git checkout -q -f -B kisskb fa4b851b4ad632dc673627f38a8a552547568a2c # git clean -qxdf # < git log -1 # commit fa4b851b4ad632dc673627f38a8a552547568a2c # Merge: 210ee636c4ad e5d7c1916562 # Author: Linus Torvalds # Date: Sun Mar 10 11:53:21 2024 -0700 # # Merge tag 'trace-ring-buffer-v6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace # # Pull tracing fixes from Steven Rostedt: # # - Do not allow large strings (> 4096) as single write to trace_marker # # The size of a string written into trace_marker was determined by the # size of the sub-buffer in the ring buffer. That size is dependent on # the PAGE_SIZE of the architecture as it can be mapped into user # space. But on PowerPC, where PAGE_SIZE is 64K, that made the limit of # the string of writing into trace_marker 64K. # # One of the selftests looks at the size of the ring buffer sub-buffers # and writes that plus more into the trace_marker. The write will take # what it can and report back what it consumed so that the user space # application (like echo) will write the rest of the string. The string # is stored in the ring buffer and can be read via the "trace" or # "trace_pipe" files. # # The reading of the ring buffer uses vsnprintf(), which uses a # precision "%.*s" to make sure it only reads what is stored in the # buffer, as a bug could cause the string to be non terminated. # # With the combination of the precision change and the PAGE_SIZE of 64K # allowing huge strings to be added into the ring buffer, plus the test # that would actually stress that limit, a bug was reported that the # precision used was too big for "%.*s" as the string was close to 64K # in size and the max precision of vsnprintf is 32K. # # Linus suggested not to have that precision as it could hide a bug if # the string was again stored without a nul byte. # # Another issue that was brought up is that the trace_seq buffer is # also based on PAGE_SIZE even though it is not tied to the # architecture limit like the ring buffer sub-buffer is. Having it be # 64K * 2 is simply just too big and wasting memory on systems with 64K # page sizes. It is now hardcoded to 8K which is what all other # architectures with 4K PAGE_SIZE has. # # Finally, the write to trace_marker is now limited to 4K as there is # no reason to write larger strings into trace_marker. # # - ring_buffer_wait() should not loop. # # The ring_buffer_wait() does not have the full context (yet) on if it # should loop or not. Just exit the loop as soon as its woken up and # let the callers decide to loop or not (they already do, so it's a bit # redundant). # # - Fix shortest_full field to be the smallest amount in the ring buffer # that a waiter is waiting for. The "shortest_full" field is updated # when a new waiter comes in and wants to wait for a smaller amount of # data in the ring buffer than other waiters. But after all waiters are # woken up, it's not reset, so if another waiter comes in wanting to # wait for more data, it will be woken up when the ring buffer has a # smaller amount from what the previous waiters were waiting for. # # - The wake up all waiters on close is incorrectly called frome # .release() and not from .flush() so it will never wake up any waiters # as the .release() will not get called until all .read() calls are # finished. And the wakeup is for the waiters in those .read() calls. # # * tag 'trace-ring-buffer-v6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: # tracing: Use .flush() call to wake up readers # ring-buffer: Fix resetting of shortest_full # ring-buffer: Fix waking up ring buffer readers # tracing: Limit trace_marker writes to just 4K # tracing: Limit trace_seq size to just 8K and not depend on architecture PAGE_SIZE # tracing: Remove precision vsnprintf() check from print event # < /opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 fa4b851b4ad632dc673627f38a8a552547568a2c # make -s -j 32 ARCH=um O=/kisskb/build/linus_defconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 defconfig # < make -s -j 32 ARCH=um O=/kisskb/build/linus_defconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 help # make -s -j 32 ARCH=um O=/kisskb/build/linus_defconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 olddefconfig # make -s -j 32 ARCH=um O=/kisskb/build/linus_defconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 /kisskb/src/arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes] 17 | void foo(void) | ^~~ In file included from /kisskb/src/arch/um/kernel/asm-offsets.c:1: /kisskb/src/arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes] 9 | void foo(void) | ^~~ /kisskb/src/arch/x86/um/bugs_64.c:9:6: warning: no previous prototype for ‘arch_check_bugs’ [-Wmissing-prototypes] 9 | void arch_check_bugs(void) | ^~~~~~~~~~~~~~~ /kisskb/src/arch/x86/um/bugs_64.c:13:6: warning: no previous prototype for ‘arch_examine_signal’ [-Wmissing-prototypes] 13 | void arch_examine_signal(int sig, struct uml_pt_regs *regs) | ^~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/x86/um/os-Linux/registers.c:146:15: warning: no previous prototype for ‘get_thread_reg’ [-Wmissing-prototypes] 146 | unsigned long get_thread_reg(int reg, jmp_buf *buf) | ^~~~~~~~~~~~~~ /kisskb/src/arch/x86/um/vdso/um_vdso.c:16:5: warning: no previous prototype for ‘__vdso_clock_gettime’ [-Wmissing-prototypes] 16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts) | ^~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/x86/um/vdso/um_vdso.c:30:5: warning: no previous prototype for ‘__vdso_gettimeofday’ [-Wmissing-prototypes] 30 | int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) | ^~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/x86/um/vdso/um_vdso.c:44:21: warning: no previous prototype for ‘__vdso_time’ [-Wmissing-prototypes] 44 | __kernel_old_time_t __vdso_time(__kernel_old_time_t *t) | ^~~~~~~~~~~ /kisskb/src/arch/x86/um/vdso/um_vdso.c:57:1: warning: no previous prototype for ‘__vdso_getcpu’ [-Wmissing-prototypes] 57 | __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused) | ^~~~~~~~~~~~~ /kisskb/src/arch/x86/um/os-Linux/mcontext.c:7:6: warning: no previous prototype for ‘get_regs_from_mc’ [-Wmissing-prototypes] 7 | void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc) | ^~~~~~~~~~~~~~~~ /kisskb/src/arch/x86/um/fault.c:18:5: warning: no previous prototype for ‘arch_fixup’ [-Wmissing-prototypes] 18 | int arch_fixup(unsigned long address, struct uml_pt_regs *regs) | ^~~~~~~~~~ /kisskb/src/arch/um/kernel/skas/mmu.c:17:5: warning: no previous prototype for ‘init_new_context’ [-Wmissing-prototypes] 17 | int init_new_context(struct task_struct *task, struct mm_struct *mm) | ^~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/skas/mmu.c:60:6: warning: no previous prototype for ‘destroy_context’ [-Wmissing-prototypes] 60 | void destroy_context(struct mm_struct *mm) | ^~~~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/drivers/ethertap_kern.c:66:5: warning: no previous prototype for ‘ethertap_setup’ [-Wmissing-prototypes] 66 | int ethertap_setup(char *str, char **mac_out, void *data) | ^~~~~~~~~~~~~~ /kisskb/src/arch/x86/um/ptrace_64.c:111:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes] 111 | int poke_user(struct task_struct *child, long addr, long data) | ^~~~~~~~~ /kisskb/src/arch/x86/um/ptrace_64.c:171:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes] 171 | int peek_user(struct task_struct *child, long addr, long data) | ^~~~~~~~~ /kisskb/src/arch/um/kernel/skas/process.c:36:12: warning: no previous prototype for ‘start_uml’ [-Wmissing-prototypes] 36 | int __init start_uml(void) | ^~~~~~~~~ /kisskb/src/arch/um/os-Linux/drivers/tuntap_kern.c:56:5: warning: no previous prototype for ‘tuntap_setup’ [-Wmissing-prototypes] 56 | int tuntap_setup(char *str, char **mac_out, void *data) | ^~~~~~~~~~~~ /kisskb/src/arch/x86/um/signal.c:560:6: warning: no previous prototype for ‘sys_rt_sigreturn’ [-Wmissing-prototypes] 560 | long sys_rt_sigreturn(void) | ^~~~~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/skas/process.c:107:6: warning: no previous prototype for ‘wait_stub_done’ [-Wmissing-prototypes] 107 | void wait_stub_done(int pid) | ^~~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/skas/process.c:683:6: warning: no previous prototype for ‘__switch_mm’ [-Wmissing-prototypes] 683 | void __switch_mm(struct mm_id *mm_idp) | ^~~~~~~~~~~ /kisskb/src/arch/x86/um/syscalls_64.c:48:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes] 48 | void arch_switch_to(struct task_struct *to) | ^~~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/main.c:187:7: warning: no previous prototype for ‘__wrap_malloc’ [-Wmissing-prototypes] 187 | void *__wrap_malloc(int size) | ^~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/main.c:208:7: warning: no previous prototype for ‘__wrap_calloc’ [-Wmissing-prototypes] 208 | void *__wrap_calloc(int n, int size) | ^~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/main.c:222:6: warning: no previous prototype for ‘__wrap_free’ [-Wmissing-prototypes] 222 | void __wrap_free(void *ptr) | ^~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/mem.c:28:6: warning: no previous prototype for ‘kasan_map_memory’ [-Wmissing-prototypes] 28 | void kasan_map_memory(void *start, size_t len) | ^~~~~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/mem.c:212:13: warning: no previous prototype for ‘check_tmpexec’ [-Wmissing-prototypes] 212 | void __init check_tmpexec(void) | ^~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/signal.c:75:6: warning: no previous prototype for ‘sig_handler’ [-Wmissing-prototypes] 75 | void sig_handler(int sig, struct siginfo *si, mcontext_t *mc) | ^~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/signal.c:111:6: warning: no previous prototype for ‘timer_alarm_handler’ [-Wmissing-prototypes] 111 | void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc) | ^~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/um/os-Linux/start_up.c:301:12: warning: no previous prototype for ‘parse_iomem’ [-Wmissing-prototypes] 301 | int __init parse_iomem(char *str, int *add) | ^~~~~~~~~~~ /kisskb/src/arch/um/kernel/mem.c:202:8: warning: no previous prototype for ‘pgd_alloc’ [-Wmissing-prototypes] 202 | pgd_t *pgd_alloc(struct mm_struct *mm) | ^~~~~~~~~ /kisskb/src/arch/um/kernel/mem.c:215:7: warning: no previous prototype for ‘uml_kmalloc’ [-Wmissing-prototypes] 215 | void *uml_kmalloc(int size, int flags) | ^~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:51:5: warning: no previous prototype for ‘pid_to_processor_id’ [-Wmissing-prototypes] 51 | int pid_to_processor_id(int pid) | ^~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:87:7: warning: no previous prototype for ‘__switch_to’ [-Wmissing-prototypes] 87 | void *__switch_to(struct task_struct *from, struct task_struct *to) | ^~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:140:6: warning: no previous prototype for ‘fork_handler’ [-Wmissing-prototypes] 140 | void fork_handler(void) | ^~~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:217:6: warning: no previous prototype for ‘arch_cpu_idle’ [-Wmissing-prototypes] 217 | void arch_cpu_idle(void) | ^~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:253:5: warning: no previous prototype for ‘copy_to_user_proc’ [-Wmissing-prototypes] 253 | int copy_to_user_proc(void __user *to, void *from, int size) | ^~~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:263:5: warning: no previous prototype for ‘clear_user_proc’ [-Wmissing-prototypes] 263 | int clear_user_proc(void __user *buf, int size) | ^~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:271:6: warning: no previous prototype for ‘set_using_sysemu’ [-Wmissing-prototypes] 271 | void set_using_sysemu(int value) | ^~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:278:5: warning: no previous prototype for ‘get_using_sysemu’ [-Wmissing-prototypes] 278 | int get_using_sysemu(void) | ^~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:316:12: warning: no previous prototype for ‘make_proc_sysemu’ [-Wmissing-prototypes] 316 | int __init make_proc_sysemu(void) | ^~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/process.c:348:15: warning: no previous prototype for ‘arch_align_stack’ [-Wmissing-prototypes] 348 | unsigned long arch_align_stack(unsigned long sp) | ^~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/reboot.c:45:6: warning: no previous prototype for ‘machine_restart’ [-Wmissing-prototypes] 45 | void machine_restart(char * __unused) | ^~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/reboot.c:51:6: warning: no previous prototype for ‘machine_power_off’ [-Wmissing-prototypes] 51 | void machine_power_off(void) | ^~~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/reboot.c:57:6: warning: no previous prototype for ‘machine_halt’ [-Wmissing-prototypes] 57 | void machine_halt(void) | ^~~~~~~~~~~~ /kisskb/src/arch/um/kernel/tlb.c:579:6: warning: no previous prototype for ‘flush_tlb_mm_range’ [-Wmissing-prototypes] 579 | void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, | ^~~~~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/tlb.c:594:6: warning: no previous prototype for ‘force_flush_all’ [-Wmissing-prototypes] 594 | void force_flush_all(void) | ^~~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/um_arch.c:408:19: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes] 408 | int __init __weak read_initrd(void) | ^~~~~~~~~~~ /kisskb/src/arch/um/kernel/um_arch.c:461:7: warning: no previous prototype for ‘text_poke’ [-Wmissing-prototypes] 461 | void *text_poke(void *addr, const void *opcode, size_t len) | ^~~~~~~~~ /kisskb/src/arch/um/kernel/um_arch.c:473:6: warning: no previous prototype for ‘text_poke_sync’ [-Wmissing-prototypes] 473 | void text_poke_sync(void) | ^~~~~~~~~~~~~~ /kisskb/src/arch/um/kernel/kmsg_dump.c:60:12: warning: no previous prototype for ‘kmsg_dumper_stdout_init’ [-Wmissing-prototypes] 60 | int __init kmsg_dumper_stdout_init(void) | ^~~~~~~~~~~~~~~~~~~~~~~ LINK linux Completed OK # rm -rf /kisskb/build/linus_defconfig_um-x86_64-gcc12 # Build took: 0:00:46.624806