Pull misc updates from Andrew Morton: "Updates to various subsystems which I help look after. lib, ocfs2, fatfs, autofs, squashfs, procfs, etc. A relatively small amount of material this time" * tag 'mm-nonmm-stable-2022-08-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (72 commits) scripts/gdb: ensure the absolute path is generated on initial source MAINTAINERS: kunit: add David Gow as a maintainer of KUnit mailmap: add linux.dev alias for Brendan Higgins mailmap: update Kirill's email profile: setup_profiling_timer() is moslty not implemented ocfs2: fix a typo in a comment ocfs2: use the bitmap API to simplify code ocfs2: remove some useless functions lib/mpi: fix typo 'the the' in comment proc: add some (hopefully) insightful comments bdi: remove enum wb_congested_state kernel/hung_task: fix address space of proc_dohung_task_timeout_secs lib/lzo/lzo1x_compress.c: replace ternary operator with min() and min_t() squashfs: support reading fragments in readahead call squashfs: implement readahead squashfs: always build "file direct" version of page actor Revert "squashfs: provide backing_dev_info in order to disable read-ahead" fs/ocfs2: Fix spelling typo in comment ia64: old_rr4 added under CONFIG_HUGETLB_PAGE proc: fix test for "vsyscall=xonly" boot option ...
Showing the changes to kernel (6 of 102 files). Show all
Unified · Split
| @@ -9,12 +9,15 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <linux/init.h> |
| 10 | 10 | #include <linux/utsname.h> |
| 11 | 11 | #include <linux/vmalloc.h> |
| 12 | +#include <linux/sizes.h> | |
| 12 | 13 | |
| 13 | 14 | #include <asm/page.h> |
| 14 | 15 | #include <asm/sections.h> |
| 15 | 16 | |
| 16 | 17 | #include <crypto/sha1.h> |
| 17 | 18 | |
| 19 | +#include "kallsyms_internal.h" | |
| 20 | + | |
| 18 | 21 | /* vmcoreinfo stuff */ |
| 19 | 22 | unsigned char *vmcoreinfo_data; |
| 20 | 23 | size_t vmcoreinfo_size; |
| @@ -43,6 +46,15 @@ static int __init parse_crashkernel_mem(char *cmdline, · 22 unmodified lines | ||
| 43 | 46 | unsigned long long *crash_base) |
| 44 | 47 | { |
| 45 | 48 | char *cur = cmdline, *tmp; |
| 49 | + unsigned long long total_mem = system_ram; | |
| 50 | + | |
| 51 | + /* | |
| 52 | + * Firmware sometimes reserves some memory regions for its own use, | |
| 53 | + * so the system memory size is less than the actual physical memory | |
| 54 | + * size. Work around this by rounding up the total size to 128M, | |
| 55 | + * which is enough for most test cases. | |
| 56 | + */ | |
| 57 | + total_mem = roundup(total_mem, SZ_128M); | |
| 46 | 58 | |
| 47 | 59 | /* for each entry of the comma-separated list */ |
| 48 | 60 | do { |
| @@ -87,13 +99,13 @@ static int __init parse_crashkernel_mem(char *cmdline, · 38 unmodified lines | ||
| 87 | 99 | return -EINVAL; |
| 88 | 100 | } |
| 89 | 101 | cur = tmp; |
| 90 | − if (size >= system_ram) { | |
| 102 | + if (size >= total_mem) { | |
| 91 | 103 | pr_warn("crashkernel: invalid size\n"); |
| 92 | 104 | return -EINVAL; |
| 93 | 105 | } |
| 94 | 106 | |
| 95 | 107 | /* match ? */ |
| 96 | − if (system_ram >= start && system_ram < end) { | |
| 108 | + if (total_mem >= start && total_mem < end) { | |
| 97 | 109 | *crash_size = size; |
| 98 | 110 | break; |
| 99 | 111 | } |
| @@ -480,6 +492,18 @@ static int __init crash_save_vmcoreinfo_init(void) · 380 unmodified lines | ||
| 480 | 492 | VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE); |
| 481 | 493 | #endif |
| 482 | 494 | |
| 495 | +#ifdef CONFIG_KALLSYMS | |
| 496 | + VMCOREINFO_SYMBOL(kallsyms_names); | |
| 497 | + VMCOREINFO_SYMBOL(kallsyms_token_table); | |
| 498 | + VMCOREINFO_SYMBOL(kallsyms_token_index); | |
| 499 | +#ifdef CONFIG_KALLSYMS_BASE_RELATIVE | |
| 500 | + VMCOREINFO_SYMBOL(kallsyms_offsets); | |
| 501 | + VMCOREINFO_SYMBOL(kallsyms_relative_base); | |
| 502 | +#else | |
| 503 | + VMCOREINFO_SYMBOL(kallsyms_addresses); | |
| 504 | +#endif /* CONFIG_KALLSYMS_BASE_RELATIVE */ | |
| 505 | +#endif /* CONFIG_KALLSYMS */ | |
| 506 | + | |
| 483 | 507 | arch_crash_save_vmcoreinfo(); |
| 484 | 508 | update_vmcoreinfo_note(); |
| 485 | 509 | |
| @@ -229,7 +229,7 @@ static long hung_timeout_jiffies(unsigned long last_checked, · 228 unmodified lines | ||
| 229 | 229 | * Process updating of timeout sysctl |
| 230 | 230 | */ |
| 231 | 231 | static int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, |
| 232 | − void __user *buffer, | |
| 232 | + void *buffer, | |
| 233 | 233 | size_t *lenp, loff_t *ppos) |
| 234 | 234 | { |
| 235 | 235 | int ret; |
| @@ -32,28 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | #include <linux/bsearch.h> |
| 33 | 33 | #include <linux/btf_ids.h> |
| 34 | 34 | |
| 35 | −/* | |
| 36 | − * These will be re-linked against their real values | |
| 37 | − * during the second link stage. | |
| 38 | − */ | |
| 39 | −extern const unsigned long kallsyms_addresses[] __weak; | |
| 40 | −extern const int kallsyms_offsets[] __weak; | |
| 41 | −extern const u8 kallsyms_names[] __weak; | |
| 42 | − | |
| 43 | −/* | |
| 44 | − * Tell the compiler that the count isn't in the small data section if the arch | |
| 45 | − * has one (eg: FRV). | |
| 46 | − */ | |
| 47 | −extern const unsigned int kallsyms_num_syms | |
| 48 | −__section(".rodata") __attribute__((weak)); | |
| 49 | − | |
| 50 | −extern const unsigned long kallsyms_relative_base | |
| 51 | −__section(".rodata") __attribute__((weak)); | |
| 52 | − | |
| 53 | −extern const char kallsyms_token_table[] __weak; | |
| 54 | −extern const u16 kallsyms_token_index[] __weak; | |
| 55 | − | |
| 56 | −extern const unsigned int kallsyms_markers[] __weak; | |
| 35 | +#include "kallsyms_internal.h" | |
| 57 | 36 | |
| 58 | 37 | /* |
| 59 | 38 | * Expand a compressed symbol data into the resulting uncompressed string, |
| @@ -0,0 +1,30 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ | |
| 2 | +#ifndef LINUX_KALLSYMS_INTERNAL_H_ | |
| 3 | +#define LINUX_KALLSYMS_INTERNAL_H_ | |
| 4 | + | |
| 5 | +#include <linux/types.h> | |
| 6 | + | |
| 7 | +/* | |
| 8 | + * These will be re-linked against their real values | |
| 9 | + * during the second link stage. | |
| 10 | + */ | |
| 11 | +extern const unsigned long kallsyms_addresses[] __weak; | |
| 12 | +extern const int kallsyms_offsets[] __weak; | |
| 13 | +extern const u8 kallsyms_names[] __weak; | |
| 14 | + | |
| 15 | +/* | |
| 16 | + * Tell the compiler that the count isn't in the small data section if the arch | |
| 17 | + * has one (eg: FRV). | |
| 18 | + */ | |
| 19 | +extern const unsigned int kallsyms_num_syms | |
| 20 | +__section(".rodata") __attribute__((weak)); | |
| 21 | + | |
| 22 | +extern const unsigned long kallsyms_relative_base | |
| 23 | +__section(".rodata") __attribute__((weak)); | |
| 24 | + | |
| 25 | +extern const char kallsyms_token_table[] __weak; | |
| 26 | +extern const u16 kallsyms_token_index[] __weak; | |
| 27 | + | |
| 28 | +extern const unsigned int kallsyms_markers[] __weak; | |
| 29 | + | |
| 30 | +#endif // LINUX_KALLSYMS_INTERNAL_H_ | |
| @@ -40,6 +40,9 @@ void set_kexec_sig_enforced(void) · 39 unmodified lines | ||
| 40 | 40 | |
| 41 | 41 | static int kexec_calculate_store_digests(struct kimage *image); |
| 42 | 42 | |
| 43 | +/* Maximum size in bytes for kernel/initrd files. */ | |
| 44 | +#define KEXEC_FILE_SIZE_MAX min_t(s64, 4LL << 30, SSIZE_MAX) | |
| 45 | + | |
| 43 | 46 | /* |
| 44 | 47 | * Currently this is the only default function that is exported as some |
| 45 | 48 | * architectures need it to do additional handlings. |
| @@ -190,11 +193,12 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, · 144 unmodified lines | ||
| 190 | 193 | const char __user *cmdline_ptr, |
| 191 | 194 | unsigned long cmdline_len, unsigned flags) |
| 192 | 195 | { |
| 193 | − int ret; | |
| 196 | + ssize_t ret; | |
| 194 | 197 | void *ldata; |
| 195 | 198 | |
| 196 | 199 | ret = kernel_read_file_from_fd(kernel_fd, 0, &image->kernel_buf, |
| 197 | − INT_MAX, NULL, READING_KEXEC_IMAGE); | |
| 200 | + KEXEC_FILE_SIZE_MAX, NULL, | |
| 201 | + READING_KEXEC_IMAGE); | |
| 198 | 202 | if (ret < 0) |
| 199 | 203 | return ret; |
| 200 | 204 | image->kernel_buf_len = ret; |
| @@ -214,7 +218,7 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, · 13 unmodified lines | ||
| 214 | 218 | /* It is possible that there no initramfs is being loaded */ |
| 215 | 219 | if (!(flags & KEXEC_FILE_NO_INITRAMFS)) { |
| 216 | 220 | ret = kernel_read_file_from_fd(initrd_fd, 0, &image->initrd_buf, |
| 217 | − INT_MAX, NULL, | |
| 221 | + KEXEC_FILE_SIZE_MAX, NULL, | |
| 218 | 222 | READING_KEXEC_INITRAMFS); |
| 219 | 223 | if (ret < 0) |
| 220 | 224 | goto out; |
| @@ -109,6 +109,13 @@ int __ref profile_init(void) · 108 unmodified lines | ||
| 109 | 109 | |
| 110 | 110 | /* only text is profiled */ |
| 111 | 111 | prof_len = (_etext - _stext) >> prof_shift; |
| 112 | + | |
| 113 | + if (!prof_len) { | |
| 114 | + pr_warn("profiling shift: %u too large\n", prof_shift); | |
| 115 | + prof_on = 0; | |
| 116 | + return -EINVAL; | |
| 117 | + } | |
| 118 | + | |
| 112 | 119 | buffer_bytes = prof_len*sizeof(atomic_t); |
| 113 | 120 | |
| 114 | 121 | if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL)) |
| @@ -418,6 +425,12 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos) · 303 unmodified lines | ||
| 418 | 425 | return read; |
| 419 | 426 | } |
| 420 | 427 | |
| 428 | +/* default is to not implement this call */ | |
| 429 | +int __weak setup_profiling_timer(unsigned mult) | |
| 430 | +{ | |
| 431 | + return -EINVAL; | |
| 432 | +} | |
| 433 | + | |
| 421 | 434 | /* |
| 422 | 435 | * Writing to /proc/profile resets the counters |
| 423 | 436 | * |
| @@ -428,8 +441,6 @@ static ssize_t write_profile(struct file *file, const char __user *buf, · 4 unmodified lines | ||
| 428 | 441 | size_t count, loff_t *ppos) |
| 429 | 442 | { |
| 430 | 443 | #ifdef CONFIG_SMP |
| 431 | − extern int setup_profiling_timer(unsigned int multiplier); | |
| 432 | − | |
| 433 | 444 | if (count == sizeof(int)) { |
| 434 | 445 | unsigned int multiplier; |
| 435 | 446 | |