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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

No conflicts.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+618 -285
+2
MAINTAINERS
··· 13389 13389 NETWORKING DRIVERS 13390 13390 M: "David S. Miller" <davem@davemloft.net> 13391 13391 M: Jakub Kicinski <kuba@kernel.org> 13392 + M: Paolo Abeni <pabeni@redhat.com> 13392 13393 L: netdev@vger.kernel.org 13393 13394 S: Maintained 13394 13395 Q: https://patchwork.kernel.org/project/netdevbpf/list/ ··· 13436 13435 NETWORKING [GENERAL] 13437 13436 M: "David S. Miller" <davem@davemloft.net> 13438 13437 M: Jakub Kicinski <kuba@kernel.org> 13438 + M: Paolo Abeni <pabeni@redhat.com> 13439 13439 L: netdev@vger.kernel.org 13440 13440 S: Maintained 13441 13441 Q: https://patchwork.kernel.org/project/netdevbpf/list/
+1 -1
Makefile
··· 2 2 VERSION = 5 3 3 PATCHLEVEL = 17 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc7 5 + EXTRAVERSION = -rc8 6 6 NAME = Superb Owl 7 7 8 8 # *DOCUMENTATION*
+6
arch/arm/include/asm/spectre.h
··· 25 25 SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8), 26 26 }; 27 27 28 + #ifdef CONFIG_GENERIC_CPU_VULNERABILITIES 28 29 void spectre_v2_update_state(unsigned int state, unsigned int methods); 30 + #else 31 + static inline void spectre_v2_update_state(unsigned int state, 32 + unsigned int methods) 33 + {} 34 + #endif 29 35 30 36 int spectre_bhb_update_vectors(unsigned int method); 31 37
+2 -2
arch/arm/kernel/entry-armv.S
··· 1040 1040 1041 1041 @ bhb workaround 1042 1042 mov r0, #8 1043 - 1: b . + 4 1043 + 3: b . + 4 1044 1044 subs r0, r0, #1 1045 - bne 1b 1045 + bne 3b 1046 1046 dsb 1047 1047 isb 1048 1048 b 2b
+1 -1
arch/powerpc/include/asm/nmi.h
··· 9 9 static inline void arch_touch_nmi_watchdog(void) {} 10 10 #endif 11 11 12 - #if defined(CONFIG_NMI_IPI) && defined(CONFIG_STACKTRACE) 12 + #ifdef CONFIG_NMI_IPI 13 13 extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask, 14 14 bool exclude_self); 15 15 #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
+1
arch/riscv/Kconfig.erratas
··· 2 2 3 3 config RISCV_ERRATA_ALTERNATIVE 4 4 bool "RISC-V alternative scheme" 5 + depends on !XIP_KERNEL 5 6 default y 6 7 help 7 8 This Kconfig allows the kernel to automatically patch the
+2 -2
arch/riscv/Kconfig.socs
··· 14 14 select CLK_SIFIVE 15 15 select CLK_SIFIVE_PRCI 16 16 select SIFIVE_PLIC 17 - select RISCV_ERRATA_ALTERNATIVE 18 - select ERRATA_SIFIVE 17 + select RISCV_ERRATA_ALTERNATIVE if !XIP_KERNEL 18 + select ERRATA_SIFIVE if !XIP_KERNEL 19 19 help 20 20 This enables support for SiFive SoC platform hardware. 21 21
+16 -5
arch/riscv/kernel/module.c
··· 13 13 #include <linux/pgtable.h> 14 14 #include <asm/sections.h> 15 15 16 + /* 17 + * The auipc+jalr instruction pair can reach any PC-relative offset 18 + * in the range [-2^31 - 2^11, 2^31 - 2^11) 19 + */ 20 + static bool riscv_insn_valid_32bit_offset(ptrdiff_t val) 21 + { 22 + #ifdef CONFIG_32BIT 23 + return true; 24 + #else 25 + return (-(1L << 31) - (1L << 11)) <= val && val < ((1L << 31) - (1L << 11)); 26 + #endif 27 + } 28 + 16 29 static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v) 17 30 { 18 31 if (v != (u32)v) { ··· 108 95 ptrdiff_t offset = (void *)v - (void *)location; 109 96 s32 hi20; 110 97 111 - if (offset != (s32)offset) { 98 + if (!riscv_insn_valid_32bit_offset(offset)) { 112 99 pr_err( 113 100 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n", 114 101 me->name, (long long)v, location); ··· 210 197 Elf_Addr v) 211 198 { 212 199 ptrdiff_t offset = (void *)v - (void *)location; 213 - s32 fill_v = offset; 214 200 u32 hi20, lo12; 215 201 216 - if (offset != fill_v) { 202 + if (!riscv_insn_valid_32bit_offset(offset)) { 217 203 /* Only emit the plt entry if offset over 32-bit range */ 218 204 if (IS_ENABLED(CONFIG_MODULE_SECTIONS)) { 219 205 offset = module_emit_plt_entry(me, v); ··· 236 224 Elf_Addr v) 237 225 { 238 226 ptrdiff_t offset = (void *)v - (void *)location; 239 - s32 fill_v = offset; 240 227 u32 hi20, lo12; 241 228 242 - if (offset != fill_v) { 229 + if (!riscv_insn_valid_32bit_offset(offset)) { 243 230 pr_err( 244 231 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n", 245 232 me->name, (long long)v, location);
+48 -9
arch/x86/kernel/cpu/sgx/encl.c
··· 13 13 #include "sgx.h" 14 14 15 15 /* 16 + * Calculate byte offset of a PCMD struct associated with an enclave page. PCMD's 17 + * follow right after the EPC data in the backing storage. In addition to the 18 + * visible enclave pages, there's one extra page slot for SECS, before PCMD 19 + * structs. 20 + */ 21 + static inline pgoff_t sgx_encl_get_backing_page_pcmd_offset(struct sgx_encl *encl, 22 + unsigned long page_index) 23 + { 24 + pgoff_t epc_end_off = encl->size + sizeof(struct sgx_secs); 25 + 26 + return epc_end_off + page_index * sizeof(struct sgx_pcmd); 27 + } 28 + 29 + /* 30 + * Free a page from the backing storage in the given page index. 31 + */ 32 + static inline void sgx_encl_truncate_backing_page(struct sgx_encl *encl, unsigned long page_index) 33 + { 34 + struct inode *inode = file_inode(encl->backing); 35 + 36 + shmem_truncate_range(inode, PFN_PHYS(page_index), PFN_PHYS(page_index) + PAGE_SIZE - 1); 37 + } 38 + 39 + /* 16 40 * ELDU: Load an EPC page as unblocked. For more info, see "OS Management of EPC 17 41 * Pages" in the SDM. 18 42 */ ··· 46 22 { 47 23 unsigned long va_offset = encl_page->desc & SGX_ENCL_PAGE_VA_OFFSET_MASK; 48 24 struct sgx_encl *encl = encl_page->encl; 25 + pgoff_t page_index, page_pcmd_off; 49 26 struct sgx_pageinfo pginfo; 50 27 struct sgx_backing b; 51 - pgoff_t page_index; 28 + bool pcmd_page_empty; 29 + u8 *pcmd_page; 52 30 int ret; 53 31 54 32 if (secs_page) ··· 58 32 else 59 33 page_index = PFN_DOWN(encl->size); 60 34 35 + page_pcmd_off = sgx_encl_get_backing_page_pcmd_offset(encl, page_index); 36 + 61 37 ret = sgx_encl_get_backing(encl, page_index, &b); 62 38 if (ret) 63 39 return ret; 64 40 65 41 pginfo.addr = encl_page->desc & PAGE_MASK; 66 42 pginfo.contents = (unsigned long)kmap_atomic(b.contents); 67 - pginfo.metadata = (unsigned long)kmap_atomic(b.pcmd) + 68 - b.pcmd_offset; 43 + pcmd_page = kmap_atomic(b.pcmd); 44 + pginfo.metadata = (unsigned long)pcmd_page + b.pcmd_offset; 69 45 70 46 if (secs_page) 71 47 pginfo.secs = (u64)sgx_get_epc_virt_addr(secs_page); ··· 83 55 ret = -EFAULT; 84 56 } 85 57 86 - kunmap_atomic((void *)(unsigned long)(pginfo.metadata - b.pcmd_offset)); 58 + memset(pcmd_page + b.pcmd_offset, 0, sizeof(struct sgx_pcmd)); 59 + 60 + /* 61 + * The area for the PCMD in the page was zeroed above. Check if the 62 + * whole page is now empty meaning that all PCMD's have been zeroed: 63 + */ 64 + pcmd_page_empty = !memchr_inv(pcmd_page, 0, PAGE_SIZE); 65 + 66 + kunmap_atomic(pcmd_page); 87 67 kunmap_atomic((void *)(unsigned long)pginfo.contents); 88 68 89 69 sgx_encl_put_backing(&b, false); 70 + 71 + sgx_encl_truncate_backing_page(encl, page_index); 72 + 73 + if (pcmd_page_empty) 74 + sgx_encl_truncate_backing_page(encl, PFN_DOWN(page_pcmd_off)); 90 75 91 76 return ret; 92 77 } ··· 620 579 int sgx_encl_get_backing(struct sgx_encl *encl, unsigned long page_index, 621 580 struct sgx_backing *backing) 622 581 { 623 - pgoff_t pcmd_index = PFN_DOWN(encl->size) + 1 + (page_index >> 5); 582 + pgoff_t page_pcmd_off = sgx_encl_get_backing_page_pcmd_offset(encl, page_index); 624 583 struct page *contents; 625 584 struct page *pcmd; 626 585 ··· 628 587 if (IS_ERR(contents)) 629 588 return PTR_ERR(contents); 630 589 631 - pcmd = sgx_encl_get_backing_page(encl, pcmd_index); 590 + pcmd = sgx_encl_get_backing_page(encl, PFN_DOWN(page_pcmd_off)); 632 591 if (IS_ERR(pcmd)) { 633 592 put_page(contents); 634 593 return PTR_ERR(pcmd); ··· 637 596 backing->page_index = page_index; 638 597 backing->contents = contents; 639 598 backing->pcmd = pcmd; 640 - backing->pcmd_offset = 641 - (page_index & (PAGE_SIZE / sizeof(struct sgx_pcmd) - 1)) * 642 - sizeof(struct sgx_pcmd); 599 + backing->pcmd_offset = page_pcmd_off & (PAGE_SIZE - 1); 643 600 644 601 return 0; 645 602 }
+30 -11
arch/x86/kernel/e820.c
··· 995 995 */ 996 996 void __init e820__reserve_setup_data(void) 997 997 { 998 + struct setup_indirect *indirect; 998 999 struct setup_data *data; 999 - u64 pa_data; 1000 + u64 pa_data, pa_next; 1001 + u32 len; 1000 1002 1001 1003 pa_data = boot_params.hdr.setup_data; 1002 1004 if (!pa_data) ··· 1006 1004 1007 1005 while (pa_data) { 1008 1006 data = early_memremap(pa_data, sizeof(*data)); 1007 + if (!data) { 1008 + pr_warn("e820: failed to memremap setup_data entry\n"); 1009 + return; 1010 + } 1011 + 1012 + len = sizeof(*data); 1013 + pa_next = data->next; 1014 + 1009 1015 e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN); 1010 1016 1011 1017 /* ··· 1025 1015 sizeof(*data) + data->len, 1026 1016 E820_TYPE_RAM, E820_TYPE_RESERVED_KERN); 1027 1017 1028 - if (data->type == SETUP_INDIRECT && 1029 - ((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) { 1030 - e820__range_update(((struct setup_indirect *)data->data)->addr, 1031 - ((struct setup_indirect *)data->data)->len, 1032 - E820_TYPE_RAM, E820_TYPE_RESERVED_KERN); 1033 - e820__range_update_kexec(((struct setup_indirect *)data->data)->addr, 1034 - ((struct setup_indirect *)data->data)->len, 1035 - E820_TYPE_RAM, E820_TYPE_RESERVED_KERN); 1018 + if (data->type == SETUP_INDIRECT) { 1019 + len += data->len; 1020 + early_memunmap(data, sizeof(*data)); 1021 + data = early_memremap(pa_data, len); 1022 + if (!data) { 1023 + pr_warn("e820: failed to memremap indirect setup_data\n"); 1024 + return; 1025 + } 1026 + 1027 + indirect = (struct setup_indirect *)data->data; 1028 + 1029 + if (indirect->type != SETUP_INDIRECT) { 1030 + e820__range_update(indirect->addr, indirect->len, 1031 + E820_TYPE_RAM, E820_TYPE_RESERVED_KERN); 1032 + e820__range_update_kexec(indirect->addr, indirect->len, 1033 + E820_TYPE_RAM, E820_TYPE_RESERVED_KERN); 1034 + } 1036 1035 } 1037 1036 1038 - pa_data = data->next; 1039 - early_memunmap(data, sizeof(*data)); 1037 + pa_data = pa_next; 1038 + early_memunmap(data, len); 1040 1039 } 1041 1040 1042 1041 e820__update_table(e820_table);
+27 -8
arch/x86/kernel/kdebugfs.c
··· 88 88 89 89 static int __init create_setup_data_nodes(struct dentry *parent) 90 90 { 91 + struct setup_indirect *indirect; 91 92 struct setup_data_node *node; 92 93 struct setup_data *data; 93 - int error; 94 + u64 pa_data, pa_next; 94 95 struct dentry *d; 95 - u64 pa_data; 96 + int error; 97 + u32 len; 96 98 int no = 0; 97 99 98 100 d = debugfs_create_dir("setup_data", parent); ··· 114 112 error = -ENOMEM; 115 113 goto err_dir; 116 114 } 115 + pa_next = data->next; 117 116 118 - if (data->type == SETUP_INDIRECT && 119 - ((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) { 120 - node->paddr = ((struct setup_indirect *)data->data)->addr; 121 - node->type = ((struct setup_indirect *)data->data)->type; 122 - node->len = ((struct setup_indirect *)data->data)->len; 117 + if (data->type == SETUP_INDIRECT) { 118 + len = sizeof(*data) + data->len; 119 + memunmap(data); 120 + data = memremap(pa_data, len, MEMREMAP_WB); 121 + if (!data) { 122 + kfree(node); 123 + error = -ENOMEM; 124 + goto err_dir; 125 + } 126 + 127 + indirect = (struct setup_indirect *)data->data; 128 + 129 + if (indirect->type != SETUP_INDIRECT) { 130 + node->paddr = indirect->addr; 131 + node->type = indirect->type; 132 + node->len = indirect->len; 133 + } else { 134 + node->paddr = pa_data; 135 + node->type = data->type; 136 + node->len = data->len; 137 + } 123 138 } else { 124 139 node->paddr = pa_data; 125 140 node->type = data->type; ··· 144 125 } 145 126 146 127 create_setup_data_node(d, no, node); 147 - pa_data = data->next; 128 + pa_data = pa_next; 148 129 149 130 memunmap(data); 150 131 no++;
+61 -16
arch/x86/kernel/ksysfs.c
··· 91 91 92 92 static int __init get_setup_data_size(int nr, size_t *size) 93 93 { 94 - int i = 0; 94 + u64 pa_data = boot_params.hdr.setup_data, pa_next; 95 + struct setup_indirect *indirect; 95 96 struct setup_data *data; 96 - u64 pa_data = boot_params.hdr.setup_data; 97 + int i = 0; 98 + u32 len; 97 99 98 100 while (pa_data) { 99 101 data = memremap(pa_data, sizeof(*data), MEMREMAP_WB); 100 102 if (!data) 101 103 return -ENOMEM; 104 + pa_next = data->next; 105 + 102 106 if (nr == i) { 103 - if (data->type == SETUP_INDIRECT && 104 - ((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) 105 - *size = ((struct setup_indirect *)data->data)->len; 106 - else 107 + if (data->type == SETUP_INDIRECT) { 108 + len = sizeof(*data) + data->len; 109 + memunmap(data); 110 + data = memremap(pa_data, len, MEMREMAP_WB); 111 + if (!data) 112 + return -ENOMEM; 113 + 114 + indirect = (struct setup_indirect *)data->data; 115 + 116 + if (indirect->type != SETUP_INDIRECT) 117 + *size = indirect->len; 118 + else 119 + *size = data->len; 120 + } else { 107 121 *size = data->len; 122 + } 108 123 109 124 memunmap(data); 110 125 return 0; 111 126 } 112 127 113 - pa_data = data->next; 128 + pa_data = pa_next; 114 129 memunmap(data); 115 130 i++; 116 131 } ··· 135 120 static ssize_t type_show(struct kobject *kobj, 136 121 struct kobj_attribute *attr, char *buf) 137 122 { 123 + struct setup_indirect *indirect; 124 + struct setup_data *data; 138 125 int nr, ret; 139 126 u64 paddr; 140 - struct setup_data *data; 127 + u32 len; 141 128 142 129 ret = kobj_to_setup_data_nr(kobj, &nr); 143 130 if (ret) ··· 152 135 if (!data) 153 136 return -ENOMEM; 154 137 155 - if (data->type == SETUP_INDIRECT) 156 - ret = sprintf(buf, "0x%x\n", ((struct setup_indirect *)data->data)->type); 157 - else 138 + if (data->type == SETUP_INDIRECT) { 139 + len = sizeof(*data) + data->len; 140 + memunmap(data); 141 + data = memremap(paddr, len, MEMREMAP_WB); 142 + if (!data) 143 + return -ENOMEM; 144 + 145 + indirect = (struct setup_indirect *)data->data; 146 + 147 + ret = sprintf(buf, "0x%x\n", indirect->type); 148 + } else { 158 149 ret = sprintf(buf, "0x%x\n", data->type); 150 + } 151 + 159 152 memunmap(data); 160 153 return ret; 161 154 } ··· 176 149 char *buf, 177 150 loff_t off, size_t count) 178 151 { 152 + struct setup_indirect *indirect; 153 + struct setup_data *data; 179 154 int nr, ret = 0; 180 155 u64 paddr, len; 181 - struct setup_data *data; 182 156 void *p; 183 157 184 158 ret = kobj_to_setup_data_nr(kobj, &nr); ··· 193 165 if (!data) 194 166 return -ENOMEM; 195 167 196 - if (data->type == SETUP_INDIRECT && 197 - ((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) { 198 - paddr = ((struct setup_indirect *)data->data)->addr; 199 - len = ((struct setup_indirect *)data->data)->len; 168 + if (data->type == SETUP_INDIRECT) { 169 + len = sizeof(*data) + data->len; 170 + memunmap(data); 171 + data = memremap(paddr, len, MEMREMAP_WB); 172 + if (!data) 173 + return -ENOMEM; 174 + 175 + indirect = (struct setup_indirect *)data->data; 176 + 177 + if (indirect->type != SETUP_INDIRECT) { 178 + paddr = indirect->addr; 179 + len = indirect->len; 180 + } else { 181 + /* 182 + * Even though this is technically undefined, return 183 + * the data as though it is a normal setup_data struct. 184 + * This will at least allow it to be inspected. 185 + */ 186 + paddr += sizeof(*data); 187 + len = data->len; 188 + } 200 189 } else { 201 190 paddr += sizeof(*data); 202 191 len = data->len;
+8 -5
arch/x86/kernel/module.c
··· 273 273 retpolines = s; 274 274 } 275 275 276 + /* 277 + * See alternative_instructions() for the ordering rules between the 278 + * various patching types. 279 + */ 280 + if (para) { 281 + void *pseg = (void *)para->sh_addr; 282 + apply_paravirt(pseg, pseg + para->sh_size); 283 + } 276 284 if (retpolines) { 277 285 void *rseg = (void *)retpolines->sh_addr; 278 286 apply_retpolines(rseg, rseg + retpolines->sh_size); ··· 296 288 alternatives_smp_module_add(me, me->name, 297 289 lseg, lseg + locks->sh_size, 298 290 tseg, tseg + text->sh_size); 299 - } 300 - 301 - if (para) { 302 - void *pseg = (void *)para->sh_addr; 303 - apply_paravirt(pseg, pseg + para->sh_size); 304 291 } 305 292 306 293 /* make jump label nops */
+27 -7
arch/x86/kernel/setup.c
··· 369 369 370 370 static void __init memblock_x86_reserve_range_setup_data(void) 371 371 { 372 + struct setup_indirect *indirect; 372 373 struct setup_data *data; 373 - u64 pa_data; 374 + u64 pa_data, pa_next; 375 + u32 len; 374 376 375 377 pa_data = boot_params.hdr.setup_data; 376 378 while (pa_data) { 377 379 data = early_memremap(pa_data, sizeof(*data)); 380 + if (!data) { 381 + pr_warn("setup: failed to memremap setup_data entry\n"); 382 + return; 383 + } 384 + 385 + len = sizeof(*data); 386 + pa_next = data->next; 387 + 378 388 memblock_reserve(pa_data, sizeof(*data) + data->len); 379 389 380 - if (data->type == SETUP_INDIRECT && 381 - ((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) 382 - memblock_reserve(((struct setup_indirect *)data->data)->addr, 383 - ((struct setup_indirect *)data->data)->len); 390 + if (data->type == SETUP_INDIRECT) { 391 + len += data->len; 392 + early_memunmap(data, sizeof(*data)); 393 + data = early_memremap(pa_data, len); 394 + if (!data) { 395 + pr_warn("setup: failed to memremap indirect setup_data\n"); 396 + return; 397 + } 384 398 385 - pa_data = data->next; 386 - early_memunmap(data, sizeof(*data)); 399 + indirect = (struct setup_indirect *)data->data; 400 + 401 + if (indirect->type != SETUP_INDIRECT) 402 + memblock_reserve(indirect->addr, indirect->len); 403 + } 404 + 405 + pa_data = pa_next; 406 + early_memunmap(data, len); 387 407 } 388 408 } 389 409
+1
arch/x86/kernel/traps.c
··· 659 659 660 660 return res == NOTIFY_STOP; 661 661 } 662 + NOKPROBE_SYMBOL(do_int3); 662 663 663 664 static void do_int3_user(struct pt_regs *regs) 664 665 {
+51 -6
arch/x86/mm/ioremap.c
··· 615 615 static bool memremap_is_setup_data(resource_size_t phys_addr, 616 616 unsigned long size) 617 617 { 618 + struct setup_indirect *indirect; 618 619 struct setup_data *data; 619 620 u64 paddr, paddr_next; 620 621 ··· 628 627 629 628 data = memremap(paddr, sizeof(*data), 630 629 MEMREMAP_WB | MEMREMAP_DEC); 630 + if (!data) { 631 + pr_warn("failed to memremap setup_data entry\n"); 632 + return false; 633 + } 631 634 632 635 paddr_next = data->next; 633 636 len = data->len; ··· 641 636 return true; 642 637 } 643 638 644 - if (data->type == SETUP_INDIRECT && 645 - ((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) { 646 - paddr = ((struct setup_indirect *)data->data)->addr; 647 - len = ((struct setup_indirect *)data->data)->len; 639 + if (data->type == SETUP_INDIRECT) { 640 + memunmap(data); 641 + data = memremap(paddr, sizeof(*data) + len, 642 + MEMREMAP_WB | MEMREMAP_DEC); 643 + if (!data) { 644 + pr_warn("failed to memremap indirect setup_data\n"); 645 + return false; 646 + } 647 + 648 + indirect = (struct setup_indirect *)data->data; 649 + 650 + if (indirect->type != SETUP_INDIRECT) { 651 + paddr = indirect->addr; 652 + len = indirect->len; 653 + } 648 654 } 649 655 650 656 memunmap(data); ··· 676 660 static bool __init early_memremap_is_setup_data(resource_size_t phys_addr, 677 661 unsigned long size) 678 662 { 663 + struct setup_indirect *indirect; 679 664 struct setup_data *data; 680 665 u64 paddr, paddr_next; 681 666 682 667 paddr = boot_params.hdr.setup_data; 683 668 while (paddr) { 684 - unsigned int len; 669 + unsigned int len, size; 685 670 686 671 if (phys_addr == paddr) 687 672 return true; 688 673 689 674 data = early_memremap_decrypted(paddr, sizeof(*data)); 675 + if (!data) { 676 + pr_warn("failed to early memremap setup_data entry\n"); 677 + return false; 678 + } 679 + 680 + size = sizeof(*data); 690 681 691 682 paddr_next = data->next; 692 683 len = data->len; 693 684 694 - early_memunmap(data, sizeof(*data)); 685 + if ((phys_addr > paddr) && (phys_addr < (paddr + len))) { 686 + early_memunmap(data, sizeof(*data)); 687 + return true; 688 + } 689 + 690 + if (data->type == SETUP_INDIRECT) { 691 + size += len; 692 + early_memunmap(data, sizeof(*data)); 693 + data = early_memremap_decrypted(paddr, size); 694 + if (!data) { 695 + pr_warn("failed to early memremap indirect setup_data\n"); 696 + return false; 697 + } 698 + 699 + indirect = (struct setup_indirect *)data->data; 700 + 701 + if (indirect->type != SETUP_INDIRECT) { 702 + paddr = indirect->addr; 703 + len = indirect->len; 704 + } 705 + } 706 + 707 + early_memunmap(data, size); 695 708 696 709 if ((phys_addr > paddr) && (phys_addr < (paddr + len))) 697 710 return true;
+5 -5
drivers/acpi/scan.c
··· 1377 1377 if (info->valid & ACPI_VALID_HID) { 1378 1378 acpi_add_id(pnp, info->hardware_id.string); 1379 1379 pnp->type.platform_id = 1; 1380 - if (info->valid & ACPI_VALID_CID) { 1381 - cid_list = &info->compatible_id_list; 1382 - for (i = 0; i < cid_list->count; i++) 1383 - acpi_add_id(pnp, cid_list->ids[i].string); 1384 - } 1380 + } 1381 + if (info->valid & ACPI_VALID_CID) { 1382 + cid_list = &info->compatible_id_list; 1383 + for (i = 0; i < cid_list->count; i++) 1384 + acpi_add_id(pnp, cid_list->ids[i].string); 1385 1385 } 1386 1386 if (info->valid & ACPI_VALID_ADR) { 1387 1387 pnp->bus_address = info->address;
+2
drivers/atm/eni.c
··· 1112 1112 skb_data3 = skb->data[3]; 1113 1113 paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len, 1114 1114 DMA_TO_DEVICE); 1115 + if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr)) 1116 + return enq_next; 1115 1117 ENI_PRV_PADDR(skb) = paddr; 1116 1118 /* prepare DMA queue entries */ 1117 1119 j = 0;
+10 -7
drivers/crypto/qcom-rng.c
··· 8 8 #include <linux/clk.h> 9 9 #include <linux/crypto.h> 10 10 #include <linux/io.h> 11 + #include <linux/iopoll.h> 11 12 #include <linux/module.h> 12 13 #include <linux/of.h> 13 14 #include <linux/platform_device.h> ··· 44 43 { 45 44 unsigned int currsize = 0; 46 45 u32 val; 46 + int ret; 47 47 48 48 /* read random data from hardware */ 49 49 do { 50 - val = readl_relaxed(rng->base + PRNG_STATUS); 51 - if (!(val & PRNG_STATUS_DATA_AVAIL)) 52 - break; 50 + ret = readl_poll_timeout(rng->base + PRNG_STATUS, val, 51 + val & PRNG_STATUS_DATA_AVAIL, 52 + 200, 10000); 53 + if (ret) 54 + return ret; 53 55 54 56 val = readl_relaxed(rng->base + PRNG_DATA_OUT); 55 57 if (!val) 56 - break; 58 + return -EINVAL; 57 59 58 60 if ((max - currsize) >= WORD_SZ) { 59 61 memcpy(data, &val, WORD_SZ); ··· 65 61 } else { 66 62 /* copy only remaining bytes */ 67 63 memcpy(data, &val, max - currsize); 68 - break; 69 64 } 70 65 } while (currsize < max); 71 66 72 - return currsize; 67 + return 0; 73 68 } 74 69 75 70 static int qcom_rng_generate(struct crypto_rng *tfm, ··· 90 87 mutex_unlock(&rng->lock); 91 88 clk_disable_unprepare(rng->clk); 92 89 93 - return 0; 90 + return ret; 94 91 } 95 92 96 93 static int qcom_rng_seed(struct crypto_rng *tfm, const u8 *seed,
+1 -1
drivers/firmware/efi/apple-properties.c
··· 24 24 static int __init dump_properties_enable(char *arg) 25 25 { 26 26 dump_properties = true; 27 - return 0; 27 + return 1; 28 28 } 29 29 30 30 __setup("dump_apple_properties", dump_properties_enable);
+1 -1
drivers/firmware/efi/efi.c
··· 212 212 memcpy(efivar_ssdt, str, strlen(str)); 213 213 else 214 214 pr_warn("efivar_ssdt: name too long: %s\n", str); 215 - return 0; 215 + return 1; 216 216 } 217 217 __setup("efivar_ssdt=", efivar_ssdt_setup); 218 218
+10
drivers/gpio/gpiolib.c
··· 1701 1701 */ 1702 1702 int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset) 1703 1703 { 1704 + #ifdef CONFIG_PINCTRL 1705 + if (list_empty(&gc->gpiodev->pin_ranges)) 1706 + return 0; 1707 + #endif 1708 + 1704 1709 return pinctrl_gpio_request(gc->gpiodev->base + offset); 1705 1710 } 1706 1711 EXPORT_SYMBOL_GPL(gpiochip_generic_request); ··· 1717 1712 */ 1718 1713 void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset) 1719 1714 { 1715 + #ifdef CONFIG_PINCTRL 1716 + if (list_empty(&gc->gpiodev->pin_ranges)) 1717 + return; 1718 + #endif 1719 + 1720 1720 pinctrl_gpio_free(gc->gpiodev->base + offset); 1721 1721 } 1722 1722 EXPORT_SYMBOL_GPL(gpiochip_generic_free);
+14 -2
drivers/gpu/drm/i915/display/intel_psr.c
··· 1406 1406 PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME; 1407 1407 } 1408 1408 1409 + static inline u32 man_trk_ctl_partial_frame_bit_get(struct drm_i915_private *dev_priv) 1410 + { 1411 + return IS_ALDERLAKE_P(dev_priv) ? 1412 + ADLP_PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE : 1413 + PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE; 1414 + } 1415 + 1409 1416 static void psr_force_hw_tracking_exit(struct intel_dp *intel_dp) 1410 1417 { 1411 1418 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); ··· 1517 1510 { 1518 1511 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 1519 1512 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 1520 - u32 val = PSR2_MAN_TRK_CTL_ENABLE; 1513 + u32 val = 0; 1514 + 1515 + if (!IS_ALDERLAKE_P(dev_priv)) 1516 + val = PSR2_MAN_TRK_CTL_ENABLE; 1517 + 1518 + /* SF partial frame enable has to be set even on full update */ 1519 + val |= man_trk_ctl_partial_frame_bit_get(dev_priv); 1521 1520 1522 1521 if (full_update) { 1523 1522 /* ··· 1543 1530 } else { 1544 1531 drm_WARN_ON(crtc_state->uapi.crtc->dev, clip->y1 % 4 || clip->y2 % 4); 1545 1532 1546 - val |= PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE; 1547 1533 val |= PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(clip->y1 / 4 + 1); 1548 1534 val |= PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(clip->y2 / 4 + 1); 1549 1535 }
+1
drivers/gpu/drm/i915/i915_reg.h
··· 4829 4829 #define ADLP_PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(val) REG_FIELD_PREP(ADLP_PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR_MASK, val) 4830 4830 #define ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR_MASK REG_GENMASK(12, 0) 4831 4831 #define ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(val) REG_FIELD_PREP(ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR_MASK, val) 4832 + #define ADLP_PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE REG_BIT(31) 4832 4833 #define ADLP_PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME REG_BIT(14) 4833 4834 #define ADLP_PSR2_MAN_TRK_CTL_SF_CONTINUOS_FULL_FRAME REG_BIT(13) 4834 4835
+1
drivers/gpu/drm/panel/Kconfig
··· 106 106 depends on PM 107 107 select VIDEOMODE_HELPERS 108 108 select DRM_DP_AUX_BUS 109 + select DRM_DP_HELPER 109 110 help 110 111 DRM panel driver for dumb eDP panels that need at most a regulator and 111 112 a GPIO to be powered up. Optionally a backlight can be attached so
+4 -4
drivers/gpu/drm/sun4i/sun8i_mixer.h
··· 111 111 /* format 13 is semi-planar YUV411 VUVU */ 112 112 #define SUN8I_MIXER_FBFMT_YUV411 14 113 113 /* format 15 doesn't exist */ 114 - /* format 16 is P010 YVU */ 115 - #define SUN8I_MIXER_FBFMT_P010_YUV 17 116 - /* format 18 is P210 YVU */ 117 - #define SUN8I_MIXER_FBFMT_P210_YUV 19 114 + #define SUN8I_MIXER_FBFMT_P010_YUV 16 115 + /* format 17 is P010 YVU */ 116 + #define SUN8I_MIXER_FBFMT_P210_YUV 18 117 + /* format 19 is P210 YVU */ 118 118 /* format 20 is packed YVU444 10-bit */ 119 119 /* format 21 is packed YUV444 10-bit */ 120 120
+1 -1
drivers/mmc/core/block.c
··· 1908 1908 1909 1909 cb_data.card = card; 1910 1910 cb_data.status = 0; 1911 - err = __mmc_poll_for_busy(card->host, MMC_BLK_TIMEOUT_MS, 1911 + err = __mmc_poll_for_busy(card->host, 0, MMC_BLK_TIMEOUT_MS, 1912 1912 &mmc_blk_busy_cb, &cb_data); 1913 1913 1914 1914 /*
+1 -1
drivers/mmc/core/mmc.c
··· 1962 1962 goto out_release; 1963 1963 } 1964 1964 1965 - err = __mmc_poll_for_busy(host, timeout_ms, &mmc_sleep_busy_cb, host); 1965 + err = __mmc_poll_for_busy(host, 0, timeout_ms, &mmc_sleep_busy_cb, host); 1966 1966 1967 1967 out_release: 1968 1968 mmc_retune_release(host);
+9 -4
drivers/mmc/core/mmc_ops.c
··· 21 21 22 22 #define MMC_BKOPS_TIMEOUT_MS (120 * 1000) /* 120s */ 23 23 #define MMC_SANITIZE_TIMEOUT_MS (240 * 1000) /* 240s */ 24 + #define MMC_OP_COND_PERIOD_US (1 * 1000) /* 1ms */ 25 + #define MMC_OP_COND_TIMEOUT_MS 1000 /* 1s */ 24 26 25 27 static const u8 tuning_blk_pattern_4bit[] = { 26 28 0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc, ··· 234 232 cmd.arg = mmc_host_is_spi(host) ? 0 : ocr; 235 233 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR; 236 234 237 - err = __mmc_poll_for_busy(host, 1000, &__mmc_send_op_cond_cb, &cb_data); 235 + err = __mmc_poll_for_busy(host, MMC_OP_COND_PERIOD_US, 236 + MMC_OP_COND_TIMEOUT_MS, 237 + &__mmc_send_op_cond_cb, &cb_data); 238 238 if (err) 239 239 return err; 240 240 ··· 499 495 return 0; 500 496 } 501 497 502 - int __mmc_poll_for_busy(struct mmc_host *host, unsigned int timeout_ms, 498 + int __mmc_poll_for_busy(struct mmc_host *host, unsigned int period_us, 499 + unsigned int timeout_ms, 503 500 int (*busy_cb)(void *cb_data, bool *busy), 504 501 void *cb_data) 505 502 { 506 503 int err; 507 504 unsigned long timeout; 508 - unsigned int udelay = 32, udelay_max = 32768; 505 + unsigned int udelay = period_us ? period_us : 32, udelay_max = 32768; 509 506 bool expired = false; 510 507 bool busy = false; 511 508 ··· 551 546 cb_data.retry_crc_err = retry_crc_err; 552 547 cb_data.busy_cmd = busy_cmd; 553 548 554 - return __mmc_poll_for_busy(host, timeout_ms, &mmc_busy_cb, &cb_data); 549 + return __mmc_poll_for_busy(host, 0, timeout_ms, &mmc_busy_cb, &cb_data); 555 550 } 556 551 EXPORT_SYMBOL_GPL(mmc_poll_for_busy); 557 552
+2 -1
drivers/mmc/core/mmc_ops.h
··· 41 41 int mmc_switch_status(struct mmc_card *card, bool crc_err_fatal); 42 42 bool mmc_prepare_busy_cmd(struct mmc_host *host, struct mmc_command *cmd, 43 43 unsigned int timeout_ms); 44 - int __mmc_poll_for_busy(struct mmc_host *host, unsigned int timeout_ms, 44 + int __mmc_poll_for_busy(struct mmc_host *host, unsigned int period_us, 45 + unsigned int timeout_ms, 45 46 int (*busy_cb)(void *cb_data, bool *busy), 46 47 void *cb_data); 47 48 int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
+1 -1
drivers/mmc/core/sd.c
··· 1672 1672 1673 1673 cb_data.card = card; 1674 1674 cb_data.reg_buf = reg_buf; 1675 - err = __mmc_poll_for_busy(card->host, SD_POWEROFF_NOTIFY_TIMEOUT_MS, 1675 + err = __mmc_poll_for_busy(card->host, 0, SD_POWEROFF_NOTIFY_TIMEOUT_MS, 1676 1676 &sd_busy_poweroff_notify_cb, &cb_data); 1677 1677 1678 1678 out:
+8 -7
drivers/mmc/host/meson-gx-mmc.c
··· 173 173 int irq; 174 174 175 175 bool vqmmc_enabled; 176 + bool needs_pre_post_req; 177 + 176 178 }; 177 179 178 180 #define CMD_CFG_LENGTH_MASK GENMASK(8, 0) ··· 665 663 struct meson_host *host = mmc_priv(mmc); 666 664 667 665 host->cmd = NULL; 666 + if (host->needs_pre_post_req) 667 + meson_mmc_post_req(mmc, mrq, 0); 668 668 mmc_request_done(host->mmc, mrq); 669 669 } 670 670 ··· 884 880 static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) 885 881 { 886 882 struct meson_host *host = mmc_priv(mmc); 887 - bool needs_pre_post_req = mrq->data && 883 + host->needs_pre_post_req = mrq->data && 888 884 !(mrq->data->host_cookie & SD_EMMC_PRE_REQ_DONE); 889 885 890 886 /* ··· 900 896 } 901 897 } 902 898 903 - if (needs_pre_post_req) { 899 + if (host->needs_pre_post_req) { 904 900 meson_mmc_get_transfer_mode(mmc, mrq); 905 901 if (!meson_mmc_desc_chain_mode(mrq->data)) 906 - needs_pre_post_req = false; 902 + host->needs_pre_post_req = false; 907 903 } 908 904 909 - if (needs_pre_post_req) 905 + if (host->needs_pre_post_req) 910 906 meson_mmc_pre_req(mmc, mrq); 911 907 912 908 /* Stop execution */ 913 909 writel(0, host->regs + SD_EMMC_START); 914 910 915 911 meson_mmc_start_cmd(mmc, mrq->sbc ?: mrq->cmd); 916 - 917 - if (needs_pre_post_req) 918 - meson_mmc_post_req(mmc, mrq, 0); 919 912 } 920 913 921 914 static void meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd)
+11
drivers/net/dsa/microchip/ksz8795_spi.c
··· 122 122 }; 123 123 MODULE_DEVICE_TABLE(of, ksz8795_dt_ids); 124 124 125 + static const struct spi_device_id ksz8795_spi_ids[] = { 126 + { "ksz8765" }, 127 + { "ksz8794" }, 128 + { "ksz8795" }, 129 + { "ksz8863" }, 130 + { "ksz8873" }, 131 + { }, 132 + }; 133 + MODULE_DEVICE_TABLE(spi, ksz8795_spi_ids); 134 + 125 135 static struct spi_driver ksz8795_spi_driver = { 126 136 .driver = { 127 137 .name = "ksz8795-switch", 128 138 .owner = THIS_MODULE, 129 139 .of_match_table = of_match_ptr(ksz8795_dt_ids), 130 140 }, 141 + .id_table = ksz8795_spi_ids, 131 142 .probe = ksz8795_spi_probe, 132 143 .remove = ksz8795_spi_remove, 133 144 .shutdown = ksz8795_spi_shutdown,
+12
drivers/net/dsa/microchip/ksz9477_spi.c
··· 96 96 }; 97 97 MODULE_DEVICE_TABLE(of, ksz9477_dt_ids); 98 98 99 + static const struct spi_device_id ksz9477_spi_ids[] = { 100 + { "ksz9477" }, 101 + { "ksz9897" }, 102 + { "ksz9893" }, 103 + { "ksz9563" }, 104 + { "ksz8563" }, 105 + { "ksz9567" }, 106 + { }, 107 + }; 108 + MODULE_DEVICE_TABLE(spi, ksz9477_spi_ids); 109 + 99 110 static struct spi_driver ksz9477_spi_driver = { 100 111 .driver = { 101 112 .name = "ksz9477-switch", 102 113 .owner = THIS_MODULE, 103 114 .of_match_table = of_match_ptr(ksz9477_dt_ids), 104 115 }, 116 + .id_table = ksz9477_spi_ids, 105 117 .probe = ksz9477_spi_probe, 106 118 .remove = ksz9477_spi_remove, 107 119 .shutdown = ksz9477_spi_shutdown,
+4 -1
drivers/net/ethernet/atheros/alx/main.c
··· 1181 1181 alx->hw.mtu = mtu; 1182 1182 alx->rxbuf_size = max(max_frame, ALX_DEF_RXBUF_SIZE); 1183 1183 netdev_update_features(netdev); 1184 - if (netif_running(netdev)) 1184 + if (netif_running(netdev)) { 1185 + mutex_lock(&alx->mtx); 1185 1186 alx_reinit(alx); 1187 + mutex_unlock(&alx->mtx); 1188 + } 1186 1189 return 0; 1187 1190 } 1188 1191
-2
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
··· 2533 2533 * Meant for implicit re-load flows. 2534 2534 */ 2535 2535 int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp); 2536 - int bnx2x_init_firmware(struct bnx2x *bp); 2537 - void bnx2x_release_firmware(struct bnx2x *bp); 2538 2536 #endif /* bnx2x.h */
+17 -11
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 2364 2364 /* is another pf loaded on this engine? */ 2365 2365 if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP && 2366 2366 load_code != FW_MSG_CODE_DRV_LOAD_COMMON) { 2367 - /* build my FW version dword */ 2368 - u32 my_fw = (bp->fw_major) + (bp->fw_minor << 8) + 2369 - (bp->fw_rev << 16) + (bp->fw_eng << 24); 2367 + u8 loaded_fw_major, loaded_fw_minor, loaded_fw_rev, loaded_fw_eng; 2368 + u32 loaded_fw; 2370 2369 2371 2370 /* read loaded FW from chip */ 2372 - u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM); 2371 + loaded_fw = REG_RD(bp, XSEM_REG_PRAM); 2373 2372 2374 - DP(BNX2X_MSG_SP, "loaded fw %x, my fw %x\n", 2375 - loaded_fw, my_fw); 2373 + loaded_fw_major = loaded_fw & 0xff; 2374 + loaded_fw_minor = (loaded_fw >> 8) & 0xff; 2375 + loaded_fw_rev = (loaded_fw >> 16) & 0xff; 2376 + loaded_fw_eng = (loaded_fw >> 24) & 0xff; 2377 + 2378 + DP(BNX2X_MSG_SP, "loaded fw 0x%x major 0x%x minor 0x%x rev 0x%x eng 0x%x\n", 2379 + loaded_fw, loaded_fw_major, loaded_fw_minor, loaded_fw_rev, loaded_fw_eng); 2376 2380 2377 2381 /* abort nic load if version mismatch */ 2378 - if (my_fw != loaded_fw) { 2382 + if (loaded_fw_major != BCM_5710_FW_MAJOR_VERSION || 2383 + loaded_fw_minor != BCM_5710_FW_MINOR_VERSION || 2384 + loaded_fw_eng != BCM_5710_FW_ENGINEERING_VERSION || 2385 + loaded_fw_rev < BCM_5710_FW_REVISION_VERSION_V15) { 2379 2386 if (print_err) 2380 - BNX2X_ERR("bnx2x with FW %x was already loaded which mismatches my %x FW. Aborting\n", 2381 - loaded_fw, my_fw); 2387 + BNX2X_ERR("loaded FW incompatible. Aborting\n"); 2382 2388 else 2383 - BNX2X_DEV_INFO("bnx2x with FW %x was already loaded which mismatches my %x FW, possibly due to MF UNDI\n", 2384 - loaded_fw, my_fw); 2389 + BNX2X_DEV_INFO("loaded FW incompatible, possibly due to MF UNDI\n"); 2390 + 2385 2391 return -EBUSY; 2386 2392 } 2387 2393 }
+2 -13
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 12319 12319 12320 12320 bnx2x_read_fwinfo(bp); 12321 12321 12322 - if (IS_PF(bp)) { 12323 - rc = bnx2x_init_firmware(bp); 12324 - 12325 - if (rc) { 12326 - bnx2x_free_mem_bp(bp); 12327 - return rc; 12328 - } 12329 - } 12330 - 12331 12322 func = BP_FUNC(bp); 12332 12323 12333 12324 /* need to reset chip if undi was active */ ··· 12331 12340 12332 12341 rc = bnx2x_prev_unload(bp); 12333 12342 if (rc) { 12334 - bnx2x_release_firmware(bp); 12335 12343 bnx2x_free_mem_bp(bp); 12336 12344 return rc; 12337 12345 } ··· 13399 13409 (u8 *)bp->arr, len); \ 13400 13410 } while (0) 13401 13411 13402 - int bnx2x_init_firmware(struct bnx2x *bp) 13412 + static int bnx2x_init_firmware(struct bnx2x *bp) 13403 13413 { 13404 13414 const char *fw_file_name, *fw_file_name_v15; 13405 13415 struct bnx2x_fw_file_hdr *fw_hdr; ··· 13499 13509 return rc; 13500 13510 } 13501 13511 13502 - void bnx2x_release_firmware(struct bnx2x *bp) 13512 + static void bnx2x_release_firmware(struct bnx2x *bp) 13503 13513 { 13504 13514 kfree(bp->init_ops_offsets); 13505 13515 kfree(bp->init_ops); ··· 14016 14026 return 0; 14017 14027 14018 14028 init_one_freemem: 14019 - bnx2x_release_firmware(bp); 14020 14029 bnx2x_free_mem_bp(bp); 14021 14030 14022 14031 init_one_exit:
+4 -2
drivers/net/ethernet/broadcom/genet/bcmgenet.c
··· 2287 2287 dma_length_status = status->length_status; 2288 2288 if (dev->features & NETIF_F_RXCSUM) { 2289 2289 rx_csum = (__force __be16)(status->rx_csum & 0xffff); 2290 - skb->csum = (__force __wsum)ntohs(rx_csum); 2291 - skb->ip_summed = CHECKSUM_COMPLETE; 2290 + if (rx_csum) { 2291 + skb->csum = (__force __wsum)ntohs(rx_csum); 2292 + skb->ip_summed = CHECKSUM_COMPLETE; 2293 + } 2292 2294 } 2293 2295 2294 2296 /* DMA flags and length are still valid no matter how
+14 -1
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 2705 2705 queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2); 2706 2706 } 2707 2707 2708 + /** 2709 + * iavf_disable_vf - disable VF 2710 + * @adapter: board private structure 2711 + * 2712 + * Set communication failed flag and free all resources. 2713 + * NOTE: This function is expected to be called with crit_lock being held. 2714 + **/ 2708 2715 static void iavf_disable_vf(struct iavf_adapter *adapter) 2709 2716 { 2710 2717 struct iavf_mac_filter *f, *ftmp; ··· 2766 2759 memset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE); 2767 2760 iavf_shutdown_adminq(&adapter->hw); 2768 2761 adapter->netdev->flags &= ~IFF_UP; 2769 - mutex_unlock(&adapter->crit_lock); 2770 2762 adapter->flags &= ~IAVF_FLAG_RESET_PENDING; 2771 2763 iavf_change_state(adapter, __IAVF_DOWN); 2772 2764 wake_up(&adapter->down_waitqueue); ··· 4783 4777 struct iavf_cloud_filter *cf, *cftmp; 4784 4778 struct iavf_hw *hw = &adapter->hw; 4785 4779 int err; 4780 + 4781 + /* When reboot/shutdown is in progress no need to do anything 4782 + * as the adapter is already REMOVE state that was set during 4783 + * iavf_shutdown() callback. 4784 + */ 4785 + if (adapter->state == __IAVF_REMOVE) 4786 + return; 4786 4787 4787 4788 set_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section); 4788 4789 /* Wait until port initialization is complete.
+4 -3
drivers/net/ethernet/intel/ice/ice_main.c
··· 4921 4921 ice_devlink_unregister_params(pf); 4922 4922 set_bit(ICE_DOWN, pf->state); 4923 4923 4924 - mutex_destroy(&(&pf->hw)->fdir_fltr_lock); 4925 4924 ice_deinit_lag(pf); 4926 4925 if (test_bit(ICE_FLAG_PTP_SUPPORTED, pf->flags)) 4927 4926 ice_ptp_release(pf); ··· 4930 4931 ice_remove_arfs(pf); 4931 4932 ice_setup_mc_magic_wake(pf); 4932 4933 ice_vsi_release_all(pf); 4934 + mutex_destroy(&(&pf->hw)->fdir_fltr_lock); 4933 4935 ice_set_wake(pf); 4934 4936 ice_free_irq_msix_misc(pf); 4935 4937 ice_for_each_vsi(pf, i) { ··· 6179 6179 u64 pkts = 0, bytes = 0; 6180 6180 6181 6181 ring = READ_ONCE(rings[i]); 6182 - if (ring) 6183 - ice_fetch_u64_stats_per_ring(&ring->syncp, ring->stats, &pkts, &bytes); 6182 + if (!ring) 6183 + continue; 6184 + ice_fetch_u64_stats_per_ring(&ring->syncp, ring->stats, &pkts, &bytes); 6184 6185 vsi_stats->tx_packets += pkts; 6185 6186 vsi_stats->tx_bytes += bytes; 6186 6187 vsi->tx_restart += ring->tx_stats.restart_q;
+15 -1
drivers/net/ethernet/mscc/ocelot_flower.c
··· 61 61 */ 62 62 static int ocelot_chain_to_lookup(int chain) 63 63 { 64 + /* Backwards compatibility with older, single-chain tc-flower 65 + * offload support in Ocelot 66 + */ 67 + if (chain == 0) 68 + return 0; 69 + 64 70 return (chain / VCAP_LOOKUP) % 10; 65 71 } 66 72 ··· 75 69 */ 76 70 static int ocelot_chain_to_pag(int chain) 77 71 { 78 - int lookup = ocelot_chain_to_lookup(chain); 72 + int lookup; 73 + 74 + /* Backwards compatibility with older, single-chain tc-flower 75 + * offload support in Ocelot 76 + */ 77 + if (chain == 0) 78 + return 0; 79 + 80 + lookup = ocelot_chain_to_lookup(chain); 79 81 80 82 /* calculate PAG value as chain index relative to the first PAG */ 81 83 return chain - VCAP_IS2_CHAIN(lookup, 0);
+3
drivers/net/hyperv/netvsc_drv.c
··· 1587 1587 pcpu_sum = kvmalloc_array(num_possible_cpus(), 1588 1588 sizeof(struct netvsc_ethtool_pcpu_stats), 1589 1589 GFP_KERNEL); 1590 + if (!pcpu_sum) 1591 + return; 1592 + 1590 1593 netvsc_get_pcpu_stats(dev, pcpu_sum); 1591 1594 for_each_present_cpu(cpu) { 1592 1595 struct netvsc_ethtool_pcpu_stats *this_sum = &pcpu_sum[cpu];
+8 -1
drivers/net/mdio/mdio-mscc-miim.c
··· 187 187 .reg_stride = 4, 188 188 }; 189 189 190 + static const struct regmap_config mscc_miim_phy_regmap_config = { 191 + .reg_bits = 32, 192 + .val_bits = 32, 193 + .reg_stride = 4, 194 + .name = "phy", 195 + }; 196 + 190 197 int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name, 191 198 struct regmap *mii_regmap, int status_offset) 192 199 { ··· 257 250 } 258 251 259 252 phy_regmap = devm_regmap_init_mmio(&pdev->dev, phy_regs, 260 - &mscc_miim_regmap_config); 253 + &mscc_miim_phy_regmap_config); 261 254 if (IS_ERR(phy_regmap)) { 262 255 dev_err(&pdev->dev, "Unable to create phy register regmap\n"); 263 256 return PTR_ERR(phy_regmap);
+4 -4
drivers/net/phy/marvell.c
··· 1687 1687 int err; 1688 1688 1689 1689 /* Suspend the fiber mode first */ 1690 - if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, 1691 - phydev->supported)) { 1690 + if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, 1691 + phydev->supported)) { 1692 1692 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); 1693 1693 if (err < 0) 1694 1694 goto error; ··· 1722 1722 int err; 1723 1723 1724 1724 /* Resume the fiber mode first */ 1725 - if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, 1726 - phydev->supported)) { 1725 + if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, 1726 + phydev->supported)) { 1727 1727 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); 1728 1728 if (err < 0) 1729 1729 goto error;
+3
drivers/net/phy/mscc/mscc_main.c
··· 2685 2685 MODULE_DESCRIPTION("Microsemi VSC85xx PHY driver"); 2686 2686 MODULE_AUTHOR("Nagaraju Lakkaraju"); 2687 2687 MODULE_LICENSE("Dual MIT/GPL"); 2688 + 2689 + MODULE_FIRMWARE(MSCC_VSC8584_REVB_INT8051_FW); 2690 + MODULE_FIRMWARE(MSCC_VSC8574_REVB_INT8051_FW);
+1 -32
drivers/net/wireless/ath/ath10k/wmi.c
··· 2611 2611 ath10k_mac_handle_beacon(ar, skb); 2612 2612 2613 2613 if (ieee80211_is_beacon(hdr->frame_control) || 2614 - ieee80211_is_probe_resp(hdr->frame_control)) { 2615 - struct ieee80211_mgmt *mgmt = (void *)skb->data; 2616 - enum cfg80211_bss_frame_type ftype; 2617 - u8 *ies; 2618 - int ies_ch; 2619 - 2614 + ieee80211_is_probe_resp(hdr->frame_control)) 2620 2615 status->boottime_ns = ktime_get_boottime_ns(); 2621 - 2622 - if (!ar->scan_channel) 2623 - goto drop; 2624 - 2625 - ies = mgmt->u.beacon.variable; 2626 - 2627 - if (ieee80211_is_beacon(mgmt->frame_control)) 2628 - ftype = CFG80211_BSS_FTYPE_BEACON; 2629 - else 2630 - ftype = CFG80211_BSS_FTYPE_PRESP; 2631 - 2632 - ies_ch = cfg80211_get_ies_channel_number(mgmt->u.beacon.variable, 2633 - skb_tail_pointer(skb) - ies, 2634 - sband->band, ftype); 2635 - 2636 - if (ies_ch > 0 && ies_ch != channel) { 2637 - ath10k_dbg(ar, ATH10K_DBG_MGMT, 2638 - "channel mismatched ds channel %d scan channel %d\n", 2639 - ies_ch, channel); 2640 - goto drop; 2641 - } 2642 - } 2643 2616 2644 2617 ath10k_dbg(ar, ATH10K_DBG_MGMT, 2645 2618 "event mgmt rx skb %pK len %d ftype %02x stype %02x\n", ··· 2626 2653 2627 2654 ieee80211_rx_ni(ar->hw, skb); 2628 2655 2629 - return 0; 2630 - 2631 - drop: 2632 - dev_kfree_skb(skb); 2633 2656 return 0; 2634 2657 } 2635 2658
+3 -1
drivers/vhost/vhost.c
··· 1170 1170 goto done; 1171 1171 } 1172 1172 1173 - if (msg.size == 0) { 1173 + if ((msg.type == VHOST_IOTLB_UPDATE || 1174 + msg.type == VHOST_IOTLB_INVALIDATE) && 1175 + msg.size == 0) { 1174 1176 ret = -EINVAL; 1175 1177 goto done; 1176 1178 }
+2 -1
drivers/vhost/vsock.c
··· 753 753 754 754 /* Iterating over all connections for all CIDs to find orphans is 755 755 * inefficient. Room for improvement here. */ 756 - vsock_for_each_connected_socket(vhost_vsock_reset_orphans); 756 + vsock_for_each_connected_socket(&vhost_transport.transport, 757 + vhost_vsock_reset_orphans); 757 758 758 759 /* Don't check the owner, because we are in the release path, so we 759 760 * need to stop the vsock device in any case.
+8 -1
fs/afs/write.c
··· 703 703 struct folio *folio; 704 704 struct page *head_page; 705 705 ssize_t ret; 706 - int n; 706 + int n, skips = 0; 707 707 708 708 _enter("%llx,%llx,", start, end); 709 709 ··· 754 754 #ifdef CONFIG_AFS_FSCACHE 755 755 folio_wait_fscache(folio); 756 756 #endif 757 + } else { 758 + start += folio_size(folio); 757 759 } 758 760 folio_put(folio); 761 + if (wbc->sync_mode == WB_SYNC_NONE) { 762 + if (skips >= 5 || need_resched()) 763 + break; 764 + skips++; 765 + } 759 766 continue; 760 767 } 761 768
+20 -3
fs/cachefiles/xattr.c
··· 28 28 static const char cachefiles_xattr_cache[] = 29 29 XATTR_USER_PREFIX "CacheFiles.cache"; 30 30 31 + struct cachefiles_vol_xattr { 32 + __be32 reserved; /* Reserved, should be 0 */ 33 + __u8 data[]; /* netfs volume coherency data */ 34 + } __packed; 35 + 31 36 /* 32 37 * set the state xattr on a cache file 33 38 */ ··· 190 185 */ 191 186 bool cachefiles_set_volume_xattr(struct cachefiles_volume *volume) 192 187 { 188 + struct cachefiles_vol_xattr *buf; 193 189 unsigned int len = volume->vcookie->coherency_len; 194 190 const void *p = volume->vcookie->coherency; 195 191 struct dentry *dentry = volume->dentry; ··· 198 192 199 193 _enter("%x,#%d", volume->vcookie->debug_id, len); 200 194 195 + len += sizeof(*buf); 196 + buf = kmalloc(len, GFP_KERNEL); 197 + if (!buf) 198 + return false; 199 + buf->reserved = cpu_to_be32(0); 200 + memcpy(buf->data, p, len); 201 + 201 202 ret = cachefiles_inject_write_error(); 202 203 if (ret == 0) 203 204 ret = vfs_setxattr(&init_user_ns, dentry, cachefiles_xattr_cache, 204 - p, len, 0); 205 + buf, len, 0); 205 206 if (ret < 0) { 206 207 trace_cachefiles_vfs_error(NULL, d_inode(dentry), ret, 207 208 cachefiles_trace_setxattr_error); ··· 222 209 cachefiles_coherency_vol_set_ok); 223 210 } 224 211 212 + kfree(buf); 225 213 _leave(" = %d", ret); 226 214 return ret == 0; 227 215 } ··· 232 218 */ 233 219 int cachefiles_check_volume_xattr(struct cachefiles_volume *volume) 234 220 { 235 - struct cachefiles_xattr *buf; 221 + struct cachefiles_vol_xattr *buf; 236 222 struct dentry *dentry = volume->dentry; 237 223 unsigned int len = volume->vcookie->coherency_len; 238 224 const void *p = volume->vcookie->coherency; ··· 242 228 243 229 _enter(""); 244 230 231 + len += sizeof(*buf); 245 232 buf = kmalloc(len, GFP_KERNEL); 246 233 if (!buf) 247 234 return -ENOMEM; ··· 260 245 "Failed to read xattr with error %zd", xlen); 261 246 } 262 247 why = cachefiles_coherency_vol_check_xattr; 263 - } else if (memcmp(buf->data, p, len) != 0) { 248 + } else if (buf->reserved != cpu_to_be32(0)) { 249 + why = cachefiles_coherency_vol_check_resv; 250 + } else if (memcmp(buf->data, p, len - sizeof(*buf)) != 0) { 264 251 why = cachefiles_coherency_vol_check_cmp; 265 252 } else { 266 253 why = cachefiles_coherency_vol_check_ok;
+11 -11
fs/ocfs2/super.c
··· 1105 1105 goto read_super_error; 1106 1106 } 1107 1107 1108 - root = d_make_root(inode); 1109 - if (!root) { 1110 - status = -ENOMEM; 1111 - mlog_errno(status); 1112 - goto read_super_error; 1113 - } 1114 - 1115 - sb->s_root = root; 1116 - 1117 - ocfs2_complete_mount_recovery(osb); 1118 - 1119 1108 osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL, 1120 1109 &ocfs2_kset->kobj); 1121 1110 if (!osb->osb_dev_kset) { ··· 1121 1132 "/sys/fs/ocfs2/%s/filecheck.\n", sb->s_id); 1122 1133 goto read_super_error; 1123 1134 } 1135 + 1136 + root = d_make_root(inode); 1137 + if (!root) { 1138 + status = -ENOMEM; 1139 + mlog_errno(status); 1140 + goto read_super_error; 1141 + } 1142 + 1143 + sb->s_root = root; 1144 + 1145 + ocfs2_complete_mount_recovery(osb); 1124 1146 1125 1147 if (ocfs2_mount_local(osb)) 1126 1148 snprintf(nodestr, sizeof(nodestr), "local");
+7 -4
fs/pipe.c
··· 253 253 */ 254 254 was_full = pipe_full(pipe->head, pipe->tail, pipe->max_usage); 255 255 for (;;) { 256 - unsigned int head = pipe->head; 256 + /* Read ->head with a barrier vs post_one_notification() */ 257 + unsigned int head = smp_load_acquire(&pipe->head); 257 258 unsigned int tail = pipe->tail; 258 259 unsigned int mask = pipe->ring_size - 1; 259 260 ··· 832 831 int i; 833 832 834 833 #ifdef CONFIG_WATCH_QUEUE 835 - if (pipe->watch_queue) { 834 + if (pipe->watch_queue) 836 835 watch_queue_clear(pipe->watch_queue); 837 - put_watch_queue(pipe->watch_queue); 838 - } 839 836 #endif 840 837 841 838 (void) account_pipe_buffers(pipe->user, pipe->nr_accounted, 0); ··· 843 844 if (buf->ops) 844 845 pipe_buf_release(pipe, buf); 845 846 } 847 + #ifdef CONFIG_WATCH_QUEUE 848 + if (pipe->watch_queue) 849 + put_watch_queue(pipe->watch_queue); 850 + #endif 846 851 if (pipe->tmp_page) 847 852 __free_page(pipe->tmp_page); 848 853 kfree(pipe->bufs);
+1
include/linux/if_arp.h
··· 52 52 case ARPHRD_VOID: 53 53 case ARPHRD_NONE: 54 54 case ARPHRD_RAWIP: 55 + case ARPHRD_PIMREG: 55 56 return false; 56 57 default: 57 58 return true;
+2 -1
include/linux/watch_queue.h
··· 28 28 struct watch_filter { 29 29 union { 30 30 struct rcu_head rcu; 31 - unsigned long type_filter[2]; /* Bitmask of accepted types */ 31 + /* Bitmask of accepted types */ 32 + DECLARE_BITMAP(type_filter, WATCH_TYPE__NR); 32 33 }; 33 34 u32 nr_filters; /* Number of filters */ 34 35 struct watch_type_filter filters[];
+2 -1
include/net/af_vsock.h
··· 205 205 struct sock *vsock_find_connected_socket(struct sockaddr_vm *src, 206 206 struct sockaddr_vm *dst); 207 207 void vsock_remove_sock(struct vsock_sock *vsk); 208 - void vsock_for_each_connected_socket(void (*fn)(struct sock *sk)); 208 + void vsock_for_each_connected_socket(struct vsock_transport *transport, 209 + void (*fn)(struct sock *sk)); 209 210 int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk); 210 211 bool vsock_find_cid(unsigned int cid); 211 212
-1
include/net/netfilter/nf_conntrack.h
··· 97 97 unsigned long status; 98 98 99 99 u16 cpu; 100 - u16 local_origin:1; 101 100 possible_net_t ct_net; 102 101 103 102 #if IS_ENABLED(CONFIG_NF_NAT)
+2
include/trace/events/cachefiles.h
··· 56 56 cachefiles_coherency_set_ok, 57 57 cachefiles_coherency_vol_check_cmp, 58 58 cachefiles_coherency_vol_check_ok, 59 + cachefiles_coherency_vol_check_resv, 59 60 cachefiles_coherency_vol_check_xattr, 60 61 cachefiles_coherency_vol_set_fail, 61 62 cachefiles_coherency_vol_set_ok, ··· 140 139 EM(cachefiles_coherency_set_ok, "SET ok ") \ 141 140 EM(cachefiles_coherency_vol_check_cmp, "VOL BAD cmp ") \ 142 141 EM(cachefiles_coherency_vol_check_ok, "VOL OK ") \ 142 + EM(cachefiles_coherency_vol_check_resv, "VOL BAD resv") \ 143 143 EM(cachefiles_coherency_vol_check_xattr,"VOL BAD xatt") \ 144 144 EM(cachefiles_coherency_vol_set_fail, "VOL SET fail") \ 145 145 E_(cachefiles_coherency_vol_set_ok, "VOL SET ok ")
+1
kernel/configs/debug.config
··· 16 16 # 17 17 # Compile-time checks and compiler options 18 18 # 19 + CONFIG_DEBUG_INFO=y 19 20 CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y 20 21 CONFIG_DEBUG_SECTION_MISMATCH=y 21 22 CONFIG_FRAME_WARN=2048
+2 -2
kernel/trace/ftrace.c
··· 7790 7790 7791 7791 /** 7792 7792 * register_ftrace_function - register a function for profiling 7793 - * @ops - ops structure that holds the function for profiling. 7793 + * @ops: ops structure that holds the function for profiling. 7794 7794 * 7795 7795 * Register a function to be called by all functions in the 7796 7796 * kernel. ··· 7817 7817 7818 7818 /** 7819 7819 * unregister_ftrace_function - unregister a function for profiling. 7820 - * @ops - ops structure that holds the function to unregister 7820 + * @ops: ops structure that holds the function to unregister 7821 7821 * 7822 7822 * Unregister a function that was added to be called by ftrace profiling. 7823 7823 */
+31
kernel/trace/trace_osnoise.c
··· 1387 1387 } 1388 1388 1389 1389 /* 1390 + * In some cases, notably when running on a nohz_full CPU with 1391 + * a stopped tick PREEMPT_RCU has no way to account for QSs. 1392 + * This will eventually cause unwarranted noise as PREEMPT_RCU 1393 + * will force preemption as the means of ending the current 1394 + * grace period. We avoid this problem by calling 1395 + * rcu_momentary_dyntick_idle(), which performs a zero duration 1396 + * EQS allowing PREEMPT_RCU to end the current grace period. 1397 + * This call shouldn't be wrapped inside an RCU critical 1398 + * section. 1399 + * 1400 + * Note that in non PREEMPT_RCU kernels QSs are handled through 1401 + * cond_resched() 1402 + */ 1403 + if (IS_ENABLED(CONFIG_PREEMPT_RCU)) { 1404 + local_irq_disable(); 1405 + rcu_momentary_dyntick_idle(); 1406 + local_irq_enable(); 1407 + } 1408 + 1409 + /* 1390 1410 * For the non-preemptive kernel config: let threads runs, if 1391 1411 * they so wish. 1392 1412 */ ··· 2218 2198 * the last instance, and the workload can stop. 2219 2199 */ 2220 2200 if (osnoise_has_registered_instances()) 2201 + return; 2202 + 2203 + /* 2204 + * If callbacks were already disabled in a previous stop 2205 + * call, there is no need to disable then again. 2206 + * 2207 + * For instance, this happens when tracing is stopped via: 2208 + * echo 0 > tracing_on 2209 + * echo nop > current_tracer. 2210 + */ 2211 + if (!trace_osnoise_callback_enabled) 2221 2212 return; 2222 2213 2223 2214 trace_osnoise_callback_enabled = false;
+11 -11
kernel/watch_queue.c
··· 54 54 bit += page->index; 55 55 56 56 set_bit(bit, wqueue->notes_bitmap); 57 + generic_pipe_buf_release(pipe, buf); 57 58 } 58 59 59 60 // No try_steal function => no stealing ··· 113 112 buf->offset = offset; 114 113 buf->len = len; 115 114 buf->flags = PIPE_BUF_FLAG_WHOLE; 116 - pipe->head = head + 1; 115 + smp_store_release(&pipe->head, head + 1); /* vs pipe_read() */ 117 116 118 117 if (!test_and_clear_bit(note, wqueue->notes_bitmap)) { 119 118 spin_unlock_irq(&pipe->rd_wait.lock); ··· 220 219 struct page **pages; 221 220 unsigned long *bitmap; 222 221 unsigned long user_bufs; 223 - unsigned int bmsize; 224 222 int ret, i, nr_pages; 225 223 226 224 if (!wqueue) ··· 243 243 goto error; 244 244 } 245 245 246 - ret = pipe_resize_ring(pipe, nr_notes); 246 + nr_notes = nr_pages * WATCH_QUEUE_NOTES_PER_PAGE; 247 + ret = pipe_resize_ring(pipe, roundup_pow_of_two(nr_notes)); 247 248 if (ret < 0) 248 249 goto error; 249 250 ··· 259 258 pages[i]->index = i * WATCH_QUEUE_NOTES_PER_PAGE; 260 259 } 261 260 262 - bmsize = (nr_notes + BITS_PER_LONG - 1) / BITS_PER_LONG; 263 - bmsize *= sizeof(unsigned long); 264 - bitmap = kmalloc(bmsize, GFP_KERNEL); 261 + bitmap = bitmap_alloc(nr_notes, GFP_KERNEL); 265 262 if (!bitmap) 266 263 goto error_p; 267 264 268 - memset(bitmap, 0xff, bmsize); 265 + bitmap_fill(bitmap, nr_notes); 269 266 wqueue->notes = pages; 270 267 wqueue->notes_bitmap = bitmap; 271 268 wqueue->nr_pages = nr_pages; 272 - wqueue->nr_notes = nr_pages * WATCH_QUEUE_NOTES_PER_PAGE; 269 + wqueue->nr_notes = nr_notes; 273 270 return 0; 274 271 275 272 error_p: ··· 319 320 tf[i].info_mask & WATCH_INFO_LENGTH) 320 321 goto err_filter; 321 322 /* Ignore any unknown types */ 322 - if (tf[i].type >= sizeof(wfilter->type_filter) * 8) 323 + if (tf[i].type >= WATCH_TYPE__NR) 323 324 continue; 324 325 nr_filter++; 325 326 } ··· 335 336 336 337 q = wfilter->filters; 337 338 for (i = 0; i < filter.nr_filters; i++) { 338 - if (tf[i].type >= sizeof(wfilter->type_filter) * BITS_PER_LONG) 339 + if (tf[i].type >= WATCH_TYPE__NR) 339 340 continue; 340 341 341 342 q->type = tf[i].type; ··· 370 371 371 372 for (i = 0; i < wqueue->nr_pages; i++) 372 373 __free_page(wqueue->notes[i]); 374 + bitmap_free(wqueue->notes_bitmap); 373 375 374 376 wfilter = rcu_access_pointer(wqueue->filter); 375 377 if (wfilter) ··· 566 566 rcu_read_lock(); 567 567 spin_lock_bh(&wqueue->lock); 568 568 569 - /* Prevent new additions and prevent notifications from happening */ 569 + /* Prevent new notifications from being stored. */ 570 570 wqueue->defunct = true; 571 571 572 572 while (!hlist_empty(&wqueue->watches)) {
+1 -1
mm/swap_state.c
··· 478 478 * __read_swap_cache_async(), which has set SWAP_HAS_CACHE 479 479 * in swap_map, but not yet added its page to swap cache. 480 480 */ 481 - cond_resched(); 481 + schedule_timeout_uninterruptible(1); 482 482 } 483 483 484 484 /*
+1
net/dsa/dsa2.c
··· 1497 1497 const char *user_protocol; 1498 1498 1499 1499 master = of_find_net_device_by_node(ethernet); 1500 + of_node_put(ethernet); 1500 1501 if (!master) 1501 1502 return -EPROBE_DEFER; 1502 1503
+1 -2
net/ipv6/esp6.c
··· 812 812 struct tcphdr *th; 813 813 814 814 offset = ipv6_skip_exthdr(skb, offset, &nexthdr, &frag_off); 815 - 816 - if (offset < 0) { 815 + if (offset == -1) { 817 816 err = -EINVAL; 818 817 goto out; 819 818 }
+2 -2
net/ipv6/ip6_output.c
··· 1475 1475 sizeof(struct frag_hdr) : 0) + 1476 1476 rt->rt6i_nfheader_len; 1477 1477 1478 - if (mtu < fragheaderlen || 1479 - ((mtu - fragheaderlen) & ~7) + fragheaderlen < sizeof(struct frag_hdr)) 1478 + if (mtu <= fragheaderlen || 1479 + ((mtu - fragheaderlen) & ~7) + fragheaderlen <= sizeof(struct frag_hdr)) 1480 1480 goto emsgsize; 1481 1481 1482 1482 maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen -
+1 -1
net/key/af_key.c
··· 1699 1699 1700 1700 xfrm_probe_algs(); 1701 1701 1702 - supp_skb = compose_sadb_supported(hdr, GFP_KERNEL); 1702 + supp_skb = compose_sadb_supported(hdr, GFP_KERNEL | __GFP_ZERO); 1703 1703 if (!supp_skb) { 1704 1704 if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC) 1705 1705 pfk->registered &= ~(1<<hdr->sadb_msg_satype);
-3
net/netfilter/nf_conntrack_core.c
··· 1757 1757 return 0; 1758 1758 if (IS_ERR(h)) 1759 1759 return PTR_ERR(h); 1760 - 1761 - ct = nf_ct_tuplehash_to_ctrack(h); 1762 - ct->local_origin = state->hook == NF_INET_LOCAL_OUT; 1763 1760 } 1764 1761 ct = nf_ct_tuplehash_to_ctrack(h); 1765 1762
+3 -40
net/netfilter/nf_nat_core.c
··· 494 494 goto another_round; 495 495 } 496 496 497 - static bool tuple_force_port_remap(const struct nf_conntrack_tuple *tuple) 498 - { 499 - u16 sp, dp; 500 - 501 - switch (tuple->dst.protonum) { 502 - case IPPROTO_TCP: 503 - sp = ntohs(tuple->src.u.tcp.port); 504 - dp = ntohs(tuple->dst.u.tcp.port); 505 - break; 506 - case IPPROTO_UDP: 507 - case IPPROTO_UDPLITE: 508 - sp = ntohs(tuple->src.u.udp.port); 509 - dp = ntohs(tuple->dst.u.udp.port); 510 - break; 511 - default: 512 - return false; 513 - } 514 - 515 - /* IANA: System port range: 1-1023, 516 - * user port range: 1024-49151, 517 - * private port range: 49152-65535. 518 - * 519 - * Linux default ephemeral port range is 32768-60999. 520 - * 521 - * Enforce port remapping if sport is significantly lower 522 - * than dport to prevent NAT port shadowing, i.e. 523 - * accidental match of 'new' inbound connection vs. 524 - * existing outbound one. 525 - */ 526 - return sp < 16384 && dp >= 32768; 527 - } 528 - 529 497 /* Manipulate the tuple into the range given. For NF_INET_POST_ROUTING, 530 498 * we change the source to map into the range. For NF_INET_PRE_ROUTING 531 499 * and NF_INET_LOCAL_OUT, we change the destination to map into the ··· 507 539 struct nf_conn *ct, 508 540 enum nf_nat_manip_type maniptype) 509 541 { 510 - bool random_port = range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL; 511 542 const struct nf_conntrack_zone *zone; 512 543 struct net *net = nf_ct_net(ct); 513 544 514 545 zone = nf_ct_zone(ct); 515 - 516 - if (maniptype == NF_NAT_MANIP_SRC && 517 - !random_port && 518 - !ct->local_origin) 519 - random_port = tuple_force_port_remap(orig_tuple); 520 546 521 547 /* 1) If this srcip/proto/src-proto-part is currently mapped, 522 548 * and that same mapping gives a unique tuple within the given ··· 520 558 * So far, we don't do local source mappings, so multiple 521 559 * manips not an issue. 522 560 */ 523 - if (maniptype == NF_NAT_MANIP_SRC && !random_port) { 561 + if (maniptype == NF_NAT_MANIP_SRC && 562 + !(range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL)) { 524 563 /* try the original tuple first */ 525 564 if (in_range(orig_tuple, range)) { 526 565 if (!nf_nat_used_tuple(orig_tuple, ct)) { ··· 545 582 */ 546 583 547 584 /* Only bother mapping if it's not already in range and unique */ 548 - if (!random_port) { 585 + if (!(range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL)) { 549 586 if (range->flags & NF_NAT_RANGE_PROTO_SPECIFIED) { 550 587 if (!(range->flags & NF_NAT_RANGE_PROTO_OFFSET) && 551 588 l4proto_in_range(tuple, maniptype,
+7 -2
net/netfilter/nf_tables_api.c
··· 8287 8287 } 8288 8288 EXPORT_SYMBOL_GPL(nf_tables_trans_destroy_flush_work); 8289 8289 8290 + static bool nft_expr_reduce(struct nft_regs_track *track, 8291 + const struct nft_expr *expr) 8292 + { 8293 + return false; 8294 + } 8295 + 8290 8296 static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *chain) 8291 8297 { 8292 8298 const struct nft_expr *expr, *last; ··· 8340 8334 nft_rule_for_each_expr(expr, last, rule) { 8341 8335 track.cur = expr; 8342 8336 8343 - if (expr->ops->reduce && 8344 - expr->ops->reduce(&track, expr)) { 8337 + if (nft_expr_reduce(&track, expr)) { 8345 8338 expr = track.cur; 8346 8339 continue; 8347 8340 }
+10 -1
net/packet/af_packet.c
··· 2318 2318 copy_skb = skb_get(skb); 2319 2319 skb_head = skb->data; 2320 2320 } 2321 - if (copy_skb) 2321 + if (copy_skb) { 2322 + memset(&PACKET_SKB_CB(copy_skb)->sa.ll, 0, 2323 + sizeof(PACKET_SKB_CB(copy_skb)->sa.ll)); 2322 2324 skb_set_owner_r(copy_skb, sk); 2325 + } 2323 2326 } 2324 2327 snaplen = po->rx_ring.frame_size - macoff; 2325 2328 if ((int)snaplen < 0) { ··· 3467 3464 sock_recv_ts_and_drops(msg, sk, skb); 3468 3465 3469 3466 if (msg->msg_name) { 3467 + const size_t max_len = min(sizeof(skb->cb), 3468 + sizeof(struct sockaddr_storage)); 3470 3469 int copy_len; 3471 3470 3472 3471 /* If the address length field is there to be filled ··· 3490 3485 0, sizeof(sll->sll_addr)); 3491 3486 msg->msg_namelen = sizeof(struct sockaddr_ll); 3492 3487 } 3488 + } 3489 + if (WARN_ON_ONCE(copy_len > max_len)) { 3490 + copy_len = max_len; 3491 + msg->msg_namelen = copy_len; 3493 3492 } 3494 3493 memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len); 3495 3494 }
+7 -2
net/vmw_vsock/af_vsock.c
··· 334 334 } 335 335 EXPORT_SYMBOL_GPL(vsock_remove_sock); 336 336 337 - void vsock_for_each_connected_socket(void (*fn)(struct sock *sk)) 337 + void vsock_for_each_connected_socket(struct vsock_transport *transport, 338 + void (*fn)(struct sock *sk)) 338 339 { 339 340 int i; 340 341 ··· 344 343 for (i = 0; i < ARRAY_SIZE(vsock_connected_table); i++) { 345 344 struct vsock_sock *vsk; 346 345 list_for_each_entry(vsk, &vsock_connected_table[i], 347 - connected_table) 346 + connected_table) { 347 + if (vsk->transport != transport) 348 + continue; 349 + 348 350 fn(sk_vsock(vsk)); 351 + } 349 352 } 350 353 351 354 spin_unlock_bh(&vsock_table_lock);
+5 -2
net/vmw_vsock/virtio_transport.c
··· 24 24 static struct workqueue_struct *virtio_vsock_workqueue; 25 25 static struct virtio_vsock __rcu *the_virtio_vsock; 26 26 static DEFINE_MUTEX(the_virtio_vsock_mutex); /* protects the_virtio_vsock */ 27 + static struct virtio_transport virtio_transport; /* forward declaration */ 27 28 28 29 struct virtio_vsock { 29 30 struct virtio_device *vdev; ··· 385 384 switch (le32_to_cpu(event->id)) { 386 385 case VIRTIO_VSOCK_EVENT_TRANSPORT_RESET: 387 386 virtio_vsock_update_guest_cid(vsock); 388 - vsock_for_each_connected_socket(virtio_vsock_reset_sock); 387 + vsock_for_each_connected_socket(&virtio_transport.transport, 388 + virtio_vsock_reset_sock); 389 389 break; 390 390 } 391 391 } ··· 664 662 synchronize_rcu(); 665 663 666 664 /* Reset all connected sockets when the device disappear */ 667 - vsock_for_each_connected_socket(virtio_vsock_reset_sock); 665 + vsock_for_each_connected_socket(&virtio_transport.transport, 666 + virtio_vsock_reset_sock); 668 667 669 668 /* Stop all work handlers to make sure no one is accessing the device, 670 669 * so we can safely call virtio_reset_device().
+4 -1
net/vmw_vsock/vmci_transport.c
··· 75 75 76 76 static int PROTOCOL_OVERRIDE = -1; 77 77 78 + static struct vsock_transport vmci_transport; /* forward declaration */ 79 + 78 80 /* Helper function to convert from a VMCI error code to a VSock error code. */ 79 81 80 82 static s32 vmci_transport_error_to_vsock_error(s32 vmci_error) ··· 884 882 const struct vmci_event_data *e_data, 885 883 void *client_data) 886 884 { 887 - vsock_for_each_connected_socket(vmci_transport_handle_detach); 885 + vsock_for_each_connected_socket(&vmci_transport, 886 + vmci_transport_handle_detach); 888 887 } 889 888 890 889 static void vmci_transport_recv_pkt_work(struct work_struct *work)
+5
tools/arch/arm64/include/uapi/asm/kvm.h
··· 281 281 #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED 3 282 282 #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED (1U << 4) 283 283 284 + #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3 KVM_REG_ARM_FW_REG(3) 285 + #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_NOT_AVAIL 0 286 + #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_AVAIL 1 287 + #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_NOT_REQUIRED 2 288 + 284 289 /* SVE registers */ 285 290 #define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT) 286 291
+1 -1
tools/arch/x86/include/asm/cpufeatures.h
··· 204 204 /* FREE! ( 7*32+10) */ 205 205 #define X86_FEATURE_PTI ( 7*32+11) /* Kernel Page Table Isolation enabled */ 206 206 #define X86_FEATURE_RETPOLINE ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */ 207 - #define X86_FEATURE_RETPOLINE_LFENCE ( 7*32+13) /* "" Use LFENCEs for Spectre variant 2 */ 207 + #define X86_FEATURE_RETPOLINE_LFENCE ( 7*32+13) /* "" Use LFENCE for Spectre variant 2 */ 208 208 #define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */ 209 209 #define X86_FEATURE_CDP_L2 ( 7*32+15) /* Code and Data Prioritization L2 */ 210 210 #define X86_FEATURE_MSR_SPEC_CTRL ( 7*32+16) /* "" MSR SPEC_CTRL is implemented */
+1 -1
tools/perf/bench/epoll-ctl.c
··· 106 106 printinfo("Nesting level(s): %d\n", nested); 107 107 108 108 epollfdp = calloc(nested, sizeof(int)); 109 - if (!epollfd) 109 + if (!epollfdp) 110 110 err(EXIT_FAILURE, "calloc"); 111 111 112 112 for (i = 0; i < nested; i++) {
+5 -3
tools/perf/util/parse-events.c
··· 1648 1648 { 1649 1649 struct parse_events_term *term; 1650 1650 struct list_head *list = NULL; 1651 + struct list_head *orig_head = NULL; 1651 1652 struct perf_pmu *pmu = NULL; 1652 1653 int ok = 0; 1653 1654 char *config; ··· 1675 1674 } 1676 1675 list_add_tail(&term->list, head); 1677 1676 1678 - 1679 1677 /* Add it for all PMUs that support the alias */ 1680 1678 list = malloc(sizeof(struct list_head)); 1681 1679 if (!list) ··· 1687 1687 1688 1688 list_for_each_entry(alias, &pmu->aliases, list) { 1689 1689 if (!strcasecmp(alias->name, str)) { 1690 + parse_events_copy_term_list(head, &orig_head); 1690 1691 if (!parse_events_add_pmu(parse_state, list, 1691 - pmu->name, head, 1692 + pmu->name, orig_head, 1692 1693 true, true)) { 1693 1694 pr_debug("%s -> %s/%s/\n", str, 1694 1695 pmu->name, alias->str); 1695 1696 ok++; 1696 1697 } 1698 + parse_events_terms__delete(orig_head); 1697 1699 } 1698 1700 } 1699 1701 } ··· 2195 2193 for (i = 0; i < ARRAY_SIZE(symbols); i++, tmp++) { 2196 2194 tmp->type = symbols[i].type; 2197 2195 tmp->symbol = strdup(symbols[i].symbol); 2198 - if (!list->symbol) 2196 + if (!tmp->symbol) 2199 2197 goto err_free; 2200 2198 } 2201 2199
+2 -3
tools/testing/selftests/netfilter/nft_nat.sh
··· 880 880 return $ksft_skip 881 881 fi 882 882 883 - # test default behaviour. Packet from ns1 to ns0 is not redirected 884 - # due to automatic port translation. 885 - test_port_shadow "default" "ROUTER" 883 + # test default behaviour. Packet from ns1 to ns0 is redirected to ns2. 884 + test_port_shadow "default" "CLIENT" 886 885 887 886 # test packet filter based mitigation: prevent forwarding of 888 887 # packets claiming to come from the service port.
+2 -4
tools/testing/selftests/vm/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for vm selftests 3 3 4 + LOCAL_HDRS += $(selfdir)/vm/local_config.h $(top_srcdir)/mm/gup_test.h 5 + 4 6 include local_config.mk 5 7 6 8 uname_M := $(shell uname -m 2>/dev/null || echo not) ··· 141 139 endif 142 140 143 141 $(OUTPUT)/mlock-random-test $(OUTPUT)/memfd_secret: LDLIBS += -lcap 144 - 145 - $(OUTPUT)/gup_test: ../../../../mm/gup_test.h 146 - 147 - $(OUTPUT)/hmm-tests: local_config.h 148 142 149 143 # HMM_EXTRA_LIBS may get set in local_config.mk, or it may be left empty. 150 144 $(OUTPUT)/hmm-tests: LDLIBS += $(HMM_EXTRA_LIBS)