···440440a virtual function (VF), jumbo frames must first be enabled in the physical441441function (PF). The VF MTU setting cannot be larger than the PF MTU.442442443443+NBASE-T Support444444+---------------445445+The ixgbe driver supports NBASE-T on some devices. However, the advertisement446446+of NBASE-T speeds is suppressed by default, to accommodate broken network447447+switches which cannot cope with advertised NBASE-T speeds. Use the ethtool448448+command to enable advertising NBASE-T speeds on devices which support it::449449+450450+ ethtool -s eth? advertise 0x1800000001028451451+452452+On Linux systems with INTERFACES(5), this can be specified as a pre-up command453453+in /etc/network/interfaces so that the interface is always brought up with454454+NBASE-T support, e.g.::455455+456456+ iface eth? inet dhcp457457+ pre-up ethtool -s eth? advertise 0x1800000001028 || true458458+443459Generic Receive Offload, aka GRO444460--------------------------------445461The driver supports the in-kernel software implementation of GRO. GRO has
+7-7
MAINTAINERS
···30663066F: drivers/phy/qualcomm/phy-ath79-usb.c3067306730683068ATHEROS ATH GENERIC UTILITIES30693069-M: Kalle Valo <kvalo@codeaurora.org>30693069+M: Kalle Valo <kvalo@kernel.org>30703070L: linux-wireless@vger.kernel.org30713071S: Supported30723072F: drivers/net/wireless/ath/*···30813081F: drivers/net/wireless/ath/ath5k/3082308230833083ATHEROS ATH6KL WIRELESS DRIVER30843084-M: Kalle Valo <kvalo@codeaurora.org>30843084+M: Kalle Valo <kvalo@kernel.org>30853085L: linux-wireless@vger.kernel.org30863086S: Supported30873087W: https://wireless.wiki.kernel.org/en/users/Drivers/ath6kl···1324813248F: include/uapi/linux/netdevice.h13249132491325013250NETWORKING DRIVERS (WIRELESS)1325113251-M: Kalle Valo <kvalo@codeaurora.org>1325113251+M: Kalle Valo <kvalo@kernel.org>1325213252L: linux-wireless@vger.kernel.org1325313253S: Maintained1325413254Q: http://patchwork.kernel.org/project/linux-wireless/list/···1570415704F: drivers/media/tuners/qt1010*15705157051570615706QUALCOMM ATHEROS ATH10K WIRELESS DRIVER1570715707-M: Kalle Valo <kvalo@codeaurora.org>1570715707+M: Kalle Valo <kvalo@kernel.org>1570815708L: ath10k@lists.infradead.org1570915709S: Supported1571015710W: https://wireless.wiki.kernel.org/en/users/Drivers/ath10k···1571215712F: drivers/net/wireless/ath/ath10k/15713157131571415714QUALCOMM ATHEROS ATH11K WIRELESS DRIVER1571515715-M: Kalle Valo <kvalo@codeaurora.org>1571515715+M: Kalle Valo <kvalo@kernel.org>1571615716L: ath11k@lists.infradead.org1571715717S: Supported1571815718T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git···1588515885F: drivers/media/platform/qcom/venus/15886158861588715887QUALCOMM WCN36XX WIRELESS DRIVER1588815888-M: Kalle Valo <kvalo@codeaurora.org>1588815888+M: Kalle Valo <kvalo@kernel.org>1588915889L: wcn36xx@lists.infradead.org1589015890S: Supported1589115891W: https://wireless.wiki.kernel.org/en/users/Drivers/wcn36xx···2106721067F: arch/x86/kernel/cpu/zhaoxin.c21068210682106921069ZONEFS FILESYSTEM2107021070-M: Damien Le Moal <damien.lemoal@wdc.com>2107021070+M: Damien Le Moal <damien.lemoal@opensource.wdc.com>2107121071M: Naohiro Aota <naohiro.aota@wdc.com>2107221072R: Johannes Thumshirn <jth@kernel.org>2107321073L: linux-fsdevel@vger.kernel.org
···189189 rockchip_boot_fn = __pa_symbol(secondary_startup);190190191191 /* copy the trampoline to sram, that runs during startup of the core */192192- memcpy(sram_base_addr, &rockchip_secondary_trampoline, trampoline_sz);192192+ memcpy_toio(sram_base_addr, &rockchip_secondary_trampoline, trampoline_sz);193193 flush_cache_all();194194 outer_clean_range(0, trampoline_sz);195195
-1
arch/arm64/Kconfig.platforms
···161161162162config ARCH_MESON163163 bool "Amlogic Platforms"164164- select COMMON_CLK165164 help166165 This enables support for the arm64 based Amlogic SoCs167166 such as the s905, S905X/D, S912, A113X/D or S905X/D2
···149149 initrd_len, cmdline, 0);150150 if (!dtb) {151151 pr_err("Preparing for new dtb failed\n");152152+ ret = -EINVAL;152153 goto out_err;153154 }154155
···422422 const char *name)423423{424424 long reladdr;425425+ func_desc_t desc;426426+ int i;425427426428 if (is_mprofile_ftrace_call(name))427429 return create_ftrace_stub(entry, addr, me);428430429429- memcpy(entry->jump, ppc64_stub_insns, sizeof(ppc64_stub_insns));431431+ for (i = 0; i < sizeof(ppc64_stub_insns) / sizeof(u32); i++) {432432+ if (patch_instruction(&entry->jump[i],433433+ ppc_inst(ppc64_stub_insns[i])))434434+ return 0;435435+ }430436431437 /* Stub uses address relative to r2. */432438 reladdr = (unsigned long)entry - my_r2(sechdrs, me);···443437 }444438 pr_debug("Stub %p get data from reladdr %li\n", entry, reladdr);445439446446- entry->jump[0] |= PPC_HA(reladdr);447447- entry->jump[1] |= PPC_LO(reladdr);448448- entry->funcdata = func_desc(addr);449449- entry->magic = STUB_MAGIC;440440+ if (patch_instruction(&entry->jump[0],441441+ ppc_inst(entry->jump[0] | PPC_HA(reladdr))))442442+ return 0;443443+444444+ if (patch_instruction(&entry->jump[1],445445+ ppc_inst(entry->jump[1] | PPC_LO(reladdr))))446446+ return 0;447447+448448+ // func_desc_t is 8 bytes if ABIv2, else 16 bytes449449+ desc = func_desc(addr);450450+ for (i = 0; i < sizeof(func_desc_t) / sizeof(u32); i++) {451451+ if (patch_instruction(((u32 *)&entry->funcdata) + i,452452+ ppc_inst(((u32 *)(&desc))[i])))453453+ return 0;454454+ }455455+456456+ if (patch_instruction(&entry->magic, ppc_inst(STUB_MAGIC)))457457+ return 0;450458451459 return 1;452460}···515495 me->name, *instruction, instruction);516496 return 0;517497 }498498+518499 /* ld r2,R2_STACK_OFFSET(r1) */519519- *instruction = PPC_INST_LD_TOC;500500+ if (patch_instruction(instruction, ppc_inst(PPC_INST_LD_TOC)))501501+ return 0;502502+520503 return 1;521504}522505···659636 }660637661638 /* Only replace bits 2 through 26 */662662- *(uint32_t *)location663663- = (*(uint32_t *)location & ~0x03fffffc)639639+ value = (*(uint32_t *)location & ~0x03fffffc)664640 | (value & 0x03fffffc);641641+642642+ if (patch_instruction((u32 *)location, ppc_inst(value)))643643+ return -EFAULT;644644+665645 break;666646667647 case R_PPC64_REL64:
+2-2
arch/powerpc/platforms/85xx/smp.c
···220220 local_irq_save(flags);221221 hard_irq_disable();222222223223- if (qoriq_pm_ops)223223+ if (qoriq_pm_ops && qoriq_pm_ops->cpu_up_prepare)224224 qoriq_pm_ops->cpu_up_prepare(cpu);225225226226 /* if cpu is not spinning, reset it */···292292 booting_thread_hwid = cpu_thread_in_core(nr);293293 primary = cpu_first_thread_sibling(nr);294294295295- if (qoriq_pm_ops)295295+ if (qoriq_pm_ops && qoriq_pm_ops->cpu_up_prepare)296296 qoriq_pm_ops->cpu_up_prepare(nr);297297298298 /*
···117117CONFIG_UNIX_DIAG=m118118CONFIG_XFRM_USER=m119119CONFIG_NET_KEY=m120120+CONFIG_NET_SWITCHDEV=y120121CONFIG_SMC=m121122CONFIG_SMC_DIAG=m122123CONFIG_INET=y···512511CONFIG_MLX4_EN=m513512CONFIG_MLX5_CORE=m514513CONFIG_MLX5_CORE_EN=y514514+CONFIG_MLX5_ESWITCH=y515515# CONFIG_NET_VENDOR_MICREL is not set516516# CONFIG_NET_VENDOR_MICROCHIP is not set517517# CONFIG_NET_VENDOR_MICROSEMI is not set
+2
arch/s390/configs/defconfig
···109109CONFIG_UNIX_DIAG=m110110CONFIG_XFRM_USER=m111111CONFIG_NET_KEY=m112112+CONFIG_NET_SWITCHDEV=y112113CONFIG_SMC=m113114CONFIG_SMC_DIAG=m114115CONFIG_INET=y···503502CONFIG_MLX4_EN=m504503CONFIG_MLX5_CORE=m505504CONFIG_MLX5_CORE_EN=y505505+CONFIG_MLX5_ESWITCH=y506506# CONFIG_NET_VENDOR_MICREL is not set507507# CONFIG_NET_VENDOR_MICROCHIP is not set508508# CONFIG_NET_VENDOR_MICROSEMI is not set
···138138 struct pt_regs *old_regs = set_irq_regs(regs);139139 int from_idle;140140141141- irq_enter();141141+ irq_enter_rcu();142142143143 if (user_mode(regs)) {144144 update_timer_sys();···158158 do_irq_async(regs, IO_INTERRUPT);159159 } while (MACHINE_IS_LPAR && irq_pending(regs));160160161161- irq_exit();161161+ irq_exit_rcu();162162+162163 set_irq_regs(old_regs);163164 irqentry_exit(regs, state);164165···173172 struct pt_regs *old_regs = set_irq_regs(regs);174173 int from_idle;175174176176- irq_enter();175175+ irq_enter_rcu();177176178177 if (user_mode(regs)) {179178 update_timer_sys();···191190192191 do_irq_async(regs, EXT_INTERRUPT);193192194194- irq_exit();193193+ irq_exit_rcu();195194 set_irq_regs(old_regs);196195 irqentry_exit(regs, state);197196
+35-5
arch/s390/kernel/machine_kexec_file.c
···77 * Author(s): Philipp Rudo <prudo@linux.vnet.ibm.com>88 */991010+#define pr_fmt(fmt) "kexec: " fmt1111+1012#include <linux/elf.h>1113#include <linux/errno.h>1214#include <linux/kexec.h>···292290 const Elf_Shdr *relsec,293291 const Elf_Shdr *symtab)294292{293293+ const char *strtab, *name, *shstrtab;294294+ const Elf_Shdr *sechdrs;295295 Elf_Rela *relas;296296 int i, r_type;297297+ int ret;298298+299299+ /* String & section header string table */300300+ sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff;301301+ strtab = (char *)pi->ehdr + sechdrs[symtab->sh_link].sh_offset;302302+ shstrtab = (char *)pi->ehdr + sechdrs[pi->ehdr->e_shstrndx].sh_offset;297303298304 relas = (void *)pi->ehdr + relsec->sh_offset;299305···314304 sym = (void *)pi->ehdr + symtab->sh_offset;315305 sym += ELF64_R_SYM(relas[i].r_info);316306317317- if (sym->st_shndx == SHN_UNDEF)318318- return -ENOEXEC;307307+ if (sym->st_name)308308+ name = strtab + sym->st_name;309309+ else310310+ name = shstrtab + sechdrs[sym->st_shndx].sh_name;319311320320- if (sym->st_shndx == SHN_COMMON)312312+ if (sym->st_shndx == SHN_UNDEF) {313313+ pr_err("Undefined symbol: %s\n", name);321314 return -ENOEXEC;315315+ }316316+317317+ if (sym->st_shndx == SHN_COMMON) {318318+ pr_err("symbol '%s' in common section\n", name);319319+ return -ENOEXEC;320320+ }322321323322 if (sym->st_shndx >= pi->ehdr->e_shnum &&324324- sym->st_shndx != SHN_ABS)323323+ sym->st_shndx != SHN_ABS) {324324+ pr_err("Invalid section %d for symbol %s\n",325325+ sym->st_shndx, name);325326 return -ENOEXEC;327327+ }326328327329 loc = pi->purgatory_buf;328330 loc += section->sh_offset;···348326 addr = section->sh_addr + relas[i].r_offset;349327350328 r_type = ELF64_R_TYPE(relas[i].r_info);351351- arch_kexec_do_relocs(r_type, loc, val, addr);329329+330330+ if (r_type == R_390_PLT32DBL)331331+ r_type = R_390_PC32DBL;332332+333333+ ret = arch_kexec_do_relocs(r_type, loc, val, addr);334334+ if (ret) {335335+ pr_err("Unknown rela relocation: %d\n", r_type);336336+ return -ENOEXEC;337337+ }352338 }353339 return 0;354340}
+15-1
arch/x86/kvm/mmu/mmu.c
···39873987static bool is_page_fault_stale(struct kvm_vcpu *vcpu,39883988 struct kvm_page_fault *fault, int mmu_seq)39893989{39903990- if (is_obsolete_sp(vcpu->kvm, to_shadow_page(vcpu->arch.mmu->root_hpa)))39903990+ struct kvm_mmu_page *sp = to_shadow_page(vcpu->arch.mmu->root_hpa);39913991+39923992+ /* Special roots, e.g. pae_root, are not backed by shadow pages. */39933993+ if (sp && is_obsolete_sp(vcpu->kvm, sp))39943994+ return true;39953995+39963996+ /*39973997+ * Roots without an associated shadow page are considered invalid if39983998+ * there is a pending request to free obsolete roots. The request is39993999+ * only a hint that the current root _may_ be obsolete and needs to be40004000+ * reloaded, e.g. if the guest frees a PGD that KVM is tracking as a40014001+ * previous root, then __kvm_mmu_prepare_zap_page() signals all vCPUs40024002+ * to reload even if no vCPU is actively using the root.40034003+ */40044004+ if (!sp && kvm_test_request(KVM_REQ_MMU_RELOAD, vcpu))39914005 return true;3992400639934007 return fault->slot &&
+1-1
arch/x86/kvm/x86.c
···3413341334143414 if (!msr_info->host_initiated)34153415 return 1;34163416- if (guest_cpuid_has(vcpu, X86_FEATURE_PDCM) && kvm_get_msr_feature(&msr_ent))34163416+ if (kvm_get_msr_feature(&msr_ent))34173417 return 1;34183418 if (data & ~msr_ent.data)34193419 return 1;
+43-8
arch/x86/net/bpf_jit_comp.c
···12521252 case BPF_LDX | BPF_MEM | BPF_DW:12531253 case BPF_LDX | BPF_PROBE_MEM | BPF_DW:12541254 if (BPF_MODE(insn->code) == BPF_PROBE_MEM) {12551255- /* test src_reg, src_reg */12561256- maybe_emit_mod(&prog, src_reg, src_reg, true); /* always 1 byte */12571257- EMIT2(0x85, add_2reg(0xC0, src_reg, src_reg));12581258- /* jne start_of_ldx */12591259- EMIT2(X86_JNE, 0);12551255+ /* Though the verifier prevents negative insn->off in BPF_PROBE_MEM12561256+ * add abs(insn->off) to the limit to make sure that negative12571257+ * offset won't be an issue.12581258+ * insn->off is s16, so it won't affect valid pointers.12591259+ */12601260+ u64 limit = TASK_SIZE_MAX + PAGE_SIZE + abs(insn->off);12611261+ u8 *end_of_jmp1, *end_of_jmp2;12621262+12631263+ /* Conservatively check that src_reg + insn->off is a kernel address:12641264+ * 1. src_reg + insn->off >= limit12651265+ * 2. src_reg + insn->off doesn't become small positive.12661266+ * Cannot do src_reg + insn->off >= limit in one branch,12671267+ * since it needs two spare registers, but JIT has only one.12681268+ */12691269+12701270+ /* movabsq r11, limit */12711271+ EMIT2(add_1mod(0x48, AUX_REG), add_1reg(0xB8, AUX_REG));12721272+ EMIT((u32)limit, 4);12731273+ EMIT(limit >> 32, 4);12741274+ /* cmp src_reg, r11 */12751275+ maybe_emit_mod(&prog, src_reg, AUX_REG, true);12761276+ EMIT2(0x39, add_2reg(0xC0, src_reg, AUX_REG));12771277+ /* if unsigned '<' goto end_of_jmp2 */12781278+ EMIT2(X86_JB, 0);12791279+ end_of_jmp1 = prog;12801280+12811281+ /* mov r11, src_reg */12821282+ emit_mov_reg(&prog, true, AUX_REG, src_reg);12831283+ /* add r11, insn->off */12841284+ maybe_emit_1mod(&prog, AUX_REG, true);12851285+ EMIT2_off32(0x81, add_1reg(0xC0, AUX_REG), insn->off);12861286+ /* jmp if not carry to start_of_ldx12871287+ * Otherwise ERR_PTR(-EINVAL) + 128 will be the user addr12881288+ * that has to be rejected.12891289+ */12901290+ EMIT2(0x73 /* JNC */, 0);12911291+ end_of_jmp2 = prog;12921292+12601293 /* xor dst_reg, dst_reg */12611294 emit_mov_imm32(&prog, false, dst_reg, 0);12621295 /* jmp byte_after_ldx */12631296 EMIT2(0xEB, 0);1264129712651265- /* populate jmp_offset for JNE above */12661266- temp[4] = prog - temp - 5 /* sizeof(test + jne) */;12981298+ /* populate jmp_offset for JB above to jump to xor dst_reg */12991299+ end_of_jmp1[-1] = end_of_jmp2 - end_of_jmp1;13001300+ /* populate jmp_offset for JNC above to jump to start_of_ldx */12671301 start_of_ldx = prog;13021302+ end_of_jmp2[-1] = start_of_ldx - end_of_jmp2;12681303 }12691304 emit_ldx(&prog, BPF_SIZE(insn->code), dst_reg, src_reg, insn->off);12701305 if (BPF_MODE(insn->code) == BPF_PROBE_MEM) {···13401305 * End result: x86 insn "mov rbx, qword ptr [rax+0x14]"13411306 * of 4 bytes will be ignored and rbx will be zero inited.13421307 */13431343- ex->fixup = (prog - temp) | (reg2pt_regs[dst_reg] << 8);13081308+ ex->fixup = (prog - start_of_ldx) | (reg2pt_regs[dst_reg] << 8);13441309 }13451310 break;13461311
+8-1
block/blk-iocost.c
···23112311 hwm = current_hweight_max(iocg);23122312 new_hwi = hweight_after_donation(iocg, old_hwi, hwm,23132313 usage, &now);23142314- if (new_hwi < hwm) {23142314+ /*23152315+ * Donation calculation assumes hweight_after_donation23162316+ * to be positive, a condition that a donor w/ hwa < 223172317+ * can't meet. Don't bother with donation if hwa is23182318+ * below 2. It's not gonna make a meaningful difference23192319+ * anyway.23202320+ */23212321+ if (new_hwi < hwm && hwa >= 2) {23152322 iocg->hweight_donating = hwa;23162323 iocg->hweight_after_donation = new_hwi;23172324 list_add(&iocg->surplus_list, &surpluses);
···28592859 goto invalid_fld;28602860 }2861286128622862- if (ata_is_ncq(tf->protocol) && (cdb[2 + cdb_offset] & 0x3) == 0)28632863- tf->protocol = ATA_PROT_NCQ_NODATA;28622862+ if ((cdb[2 + cdb_offset] & 0x3) == 0) {28632863+ /*28642864+ * When T_LENGTH is zero (No data is transferred), dir should28652865+ * be DMA_NONE.28662866+ */28672867+ if (scmd->sc_data_direction != DMA_NONE) {28682868+ fp = 2 + cdb_offset;28692869+ goto invalid_fld;28702870+ }28712871+28722872+ if (ata_is_ncq(tf->protocol))28732873+ tf->protocol = ATA_PROT_NCQ_NODATA;28742874+ }2864287528652876 /* enable LBA */28662877 tf->flags |= ATA_TFLAG_LBA;
+12-3
drivers/clk/clk.c
···3418341834193419 clk_prepare_lock();3420342034213421+ /*34223422+ * Set hw->core after grabbing the prepare_lock to synchronize with34233423+ * callers of clk_core_fill_parent_index() where we treat hw->core34243424+ * being NULL as the clk not being registered yet. This is crucial so34253425+ * that clks aren't parented until their parent is fully registered.34263426+ */34273427+ core->hw->core = core;34283428+34213429 ret = clk_pm_runtime_get(core);34223430 if (ret)34233431 goto unlock;···35903582out:35913583 clk_pm_runtime_put(core);35923584unlock:35933593- if (ret)35853585+ if (ret) {35943586 hlist_del_init(&core->child_node);35873587+ core->hw->core = NULL;35883588+ }3595358935963590 clk_prepare_unlock();35973591···38573847 core->num_parents = init->num_parents;38583848 core->min_rate = 0;38593849 core->max_rate = ULONG_MAX;38603860- hw->core = core;3861385038623851 ret = clk_core_populate_parent_map(core, init);38633852 if (ret)···38743865 goto fail_create_clk;38753866 }3876386738773877- clk_core_link_consumer(hw->core, hw->clk);38683868+ clk_core_link_consumer(core, hw->clk);3878386938793870 ret = __clk_core_init(core);38803871 if (!ret)
···106106{107107 struct idxd_desc *d, *t, *found = NULL;108108 struct llist_node *head;109109+ LIST_HEAD(flist);109110110111 desc->completion->status = IDXD_COMP_DESC_ABORT;111112 /*···121120 found = desc;122121 continue;123122 }124124- list_add_tail(&desc->list, &ie->work_list);123123+124124+ if (d->completion->status)125125+ list_add_tail(&d->list, &flist);126126+ else127127+ list_add_tail(&d->list, &ie->work_list);125128 }126129 }127130···135130136131 if (found)137132 complete_desc(found, IDXD_COMPLETE_ABORT);133133+134134+ /*135135+ * complete_desc() will return desc to allocator and the desc can be136136+ * acquired by a different process and the desc->list can be modified.137137+ * Delete desc from list so the list trasversing does not get corrupted138138+ * by the other process.139139+ */140140+ list_for_each_entry_safe(d, t, &flist, list) {141141+ list_del_init(&d->list);142142+ complete_desc(d, IDXD_COMPLETE_NORMAL);143143+ }138144}139145140146int idxd_submit_desc(struct idxd_wq *wq, struct idxd_desc *desc)
···18081808 return 0;18091809 }1810181018111811+ /*18121812+ * Pair the operations did in gmc_v9_0_hw_init and thus maintain18131813+ * a correct cached state for GMC. Otherwise, the "gate" again18141814+ * operation on S3 resuming will fail due to wrong cached state.18151815+ */18161816+ if (adev->mmhub.funcs->update_power_gating)18171817+ adev->mmhub.funcs->update_power_gating(adev, false);18181818+18111819 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);18121820 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);18131821
···13281328 pp_dpm_powergate_vce(handle, gate);13291329 break;13301330 case AMD_IP_BLOCK_TYPE_GMC:13311331- pp_dpm_powergate_mmhub(handle);13311331+ /*13321332+ * For now, this is only used on PICASSO.13331333+ * And only "gate" operation is supported.13341334+ */13351335+ if (gate)13361336+ pp_dpm_powergate_mmhub(handle);13321337 break;13331338 case AMD_IP_BLOCK_TYPE_GFX:13341339 ret = pp_dpm_powergate_gfx(handle, gate);
···11211121 if (crtc->state)11221122 crtc->funcs->atomic_destroy_state(crtc, crtc->state);1123112311241124- __drm_atomic_helper_crtc_reset(crtc, &ast_state->base);11241124+ if (ast_state)11251125+ __drm_atomic_helper_crtc_reset(crtc, &ast_state->base);11261126+ else11271127+ __drm_atomic_helper_crtc_reset(crtc, NULL);11251128}1126112911271130static struct drm_crtc_state *
+7-1
drivers/gpu/drm/drm_fb_helper.c
···17431743 sizes->fb_width, sizes->fb_height);1744174417451745 info->par = fb_helper;17461746- snprintf(info->fix.id, sizeof(info->fix.id), "%s",17461746+ /*17471747+ * The DRM drivers fbdev emulation device name can be confusing if the17481748+ * driver name also has a "drm" suffix on it. Leading to names such as17491749+ * "simpledrmdrmfb" in /proc/fb. Unfortunately, it's an uAPI and can't17501750+ * be changed due user-space tools (e.g: pm-utils) matching against it.17511751+ */17521752+ snprintf(info->fix.id, sizeof(info->fix.id), "%sdrmfb",17471753 fb_helper->dev->driver->name);1748175417491755}
+1-1
drivers/gpu/drm/i915/display/intel_dmc.c
···596596 continue;597597598598 offset = readcount + dmc->dmc_info[id].dmc_offset * 4;599599- if (fw->size - offset < 0) {599599+ if (offset > fw->size) {600600 drm_err(&dev_priv->drm, "Reading beyond the fw_size\n");601601 continue;602602 }
···768768 if ((!mv88e6xxx_port_ppu_updates(chip, port) ||769769 mode == MLO_AN_FIXED) && ops->port_sync_link)770770 err = ops->port_sync_link(chip, port, mode, false);771771+772772+ if (!err && ops->port_set_speed_duplex)773773+ err = ops->port_set_speed_duplex(chip, port, SPEED_UNFORCED,774774+ DUPLEX_UNFORCED);771775 mv88e6xxx_reg_unlock(chip);772776773777 if (err)
+2-2
drivers/net/dsa/mv88e6xxx/port.c
···283283 if (err)284284 return err;285285286286- if (speed)286286+ if (speed != SPEED_UNFORCED)287287 dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);288288 else289289 dev_dbg(chip->dev, "p%d: Speed unforced\n", port);···516516 if (err)517517 return err;518518519519- if (speed)519519+ if (speed != SPEED_UNFORCED)520520 dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);521521 else522522 dev_dbg(chip->dev, "p%d: Speed unforced\n", port);
+4-1
drivers/net/ethernet/broadcom/bcmsysport.c
···13091309 struct bcm_sysport_priv *priv = netdev_priv(dev);13101310 struct device *kdev = &priv->pdev->dev;13111311 struct bcm_sysport_tx_ring *ring;13121312+ unsigned long flags, desc_flags;13121313 struct bcm_sysport_cb *cb;13131314 struct netdev_queue *txq;13141315 u32 len_status, addr_lo;13151316 unsigned int skb_len;13161316- unsigned long flags;13171317 dma_addr_t mapping;13181318 u16 queue;13191319 int ret;···13731373 ring->desc_count--;1374137413751375 /* Ports are latched, so write upper address first */13761376+ spin_lock_irqsave(&priv->desc_lock, desc_flags);13761377 tdma_writel(priv, len_status, TDMA_WRITE_PORT_HI(ring->index));13771378 tdma_writel(priv, addr_lo, TDMA_WRITE_PORT_LO(ring->index));13791379+ spin_unlock_irqrestore(&priv->desc_lock, desc_flags);1378138013791381 /* Check ring space and update SW control flow */13801382 if (ring->desc_count == 0)···20152013 }2016201420172015 /* Initialize both hardware and software ring */20162016+ spin_lock_init(&priv->desc_lock);20182017 for (i = 0; i < dev->num_tx_queues; i++) {20192018 ret = bcm_sysport_init_tx_ring(priv, i);20202019 if (ret) {
···589589 * Internal or external PHY with MDIO access590590 */591591 phydev = phy_attach(priv->dev, phy_name, pd->phy_interface);592592- if (!phydev) {592592+ if (IS_ERR(phydev)) {593593 dev_err(kdev, "failed to register PHY device\n");594594- return -ENODEV;594594+ return PTR_ERR(phydev);595595 }596596 } else {597597 /*
+2
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
···388388 __u64 bytes_per_cdan;389389};390390391391+#define DPAA2_ETH_CH_STATS 7392392+391393/* Maximum number of queues associated with a DPNI */392394#define DPAA2_ETH_MAX_TCS 8393395#define DPAA2_ETH_MAX_RX_QUEUES_PER_TC 16
···12261226 if (ret)12271227 return ret;1228122812291229+ mutex_lock(&handle->dbgfs_lock);12291230 save_buf = &hns3_dbg_cmd[index].buf;1230123112311232 if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||···12391238 read_buf = *save_buf;12401239 } else {12411240 read_buf = kvzalloc(hns3_dbg_cmd[index].buf_len, GFP_KERNEL);12421242- if (!read_buf)12431243- return -ENOMEM;12411241+ if (!read_buf) {12421242+ ret = -ENOMEM;12431243+ goto out;12441244+ }1244124512451246 /* save the buffer addr until the last read operation */12461247 *save_buf = read_buf;12471247- }1248124812491249- /* get data ready for the first time to read */12501250- if (!*ppos) {12491249+ /* get data ready for the first time to read */12511250 ret = hns3_dbg_read_cmd(dbg_data, hns3_dbg_cmd[index].cmd,12521251 read_buf, hns3_dbg_cmd[index].buf_len);12531252 if (ret)···1256125512571256 size = simple_read_from_buffer(buffer, count, ppos, read_buf,12581257 strlen(read_buf));12591259- if (size > 0)12581258+ if (size > 0) {12591259+ mutex_unlock(&handle->dbgfs_lock);12601260 return size;12611261+ }1261126212621263out:12631264 /* free the buffer for the last read operation */···12681265 *save_buf = NULL;12691266 }1270126712681268+ mutex_unlock(&handle->dbgfs_lock);12711269 return ret;12721270}12731271···13411337 debugfs_create_dir(hns3_dbg_dentry[i].name,13421338 handle->hnae3_dbgfs);1343133913401340+ mutex_init(&handle->dbgfs_lock);13411341+13441342 for (i = 0; i < ARRAY_SIZE(hns3_dbg_cmd); i++) {13451343 if ((hns3_dbg_cmd[i].cmd == HNAE3_DBG_CMD_TM_NODES &&13461344 ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2) ||···13691363 return 0;1370136413711365out:13661366+ mutex_destroy(&handle->dbgfs_lock);13721367 debugfs_remove_recursive(handle->hnae3_dbgfs);13731368 handle->hnae3_dbgfs = NULL;13741369 return ret;···13851378 hns3_dbg_cmd[i].buf = NULL;13861379 }1387138013811381+ mutex_destroy(&handle->dbgfs_lock);13881382 debugfs_remove_recursive(handle->hnae3_dbgfs);13891383 handle->hnae3_dbgfs = NULL;13901384}
···705705 scaled_ppm = -scaled_ppm;706706 }707707708708- while ((u64)scaled_ppm > div_u64(U64_MAX, incval)) {708708+ while ((u64)scaled_ppm > div64_u64(U64_MAX, incval)) {709709 /* handle overflow by scaling down the scaled_ppm and710710 * the divisor, losing some precision711711 */···15401540 if (err)15411541 continue;1542154215431543- /* Check if the timestamp is valid */15441544- if (!(raw_tstamp & ICE_PTP_TS_VALID))15431543+ /* Check if the timestamp is invalid or stale */15441544+ if (!(raw_tstamp & ICE_PTP_TS_VALID) ||15451545+ raw_tstamp == tx->tstamps[idx].cached_tstamp)15451546 continue;15461546-15471547- /* clear the timestamp register, so that it won't show valid15481548- * again when re-used.15491549- */15501550- ice_clear_phy_tstamp(hw, tx->quad, phy_idx);1551154715521548 /* The timestamp is valid, so we'll go ahead and clear this15531549 * index and then send the timestamp up to the stack.15541550 */15551551 spin_lock(&tx->lock);15521552+ tx->tstamps[idx].cached_tstamp = raw_tstamp;15561553 clear_bit(idx, tx->in_use);15571554 skb = tx->tstamps[idx].skb;15581555 tx->tstamps[idx].skb = NULL;
+6
drivers/net/ethernet/intel/ice/ice_ptp.h
···5555 * struct ice_tx_tstamp - Tracking for a single Tx timestamp5656 * @skb: pointer to the SKB for this timestamp request5757 * @start: jiffies when the timestamp was first requested5858+ * @cached_tstamp: last read timestamp5859 *5960 * This structure tracks a single timestamp request. The SKB pointer is6061 * provided when initiating a request. The start time is used to ensure that6162 * we discard old requests that were not fulfilled within a 2 second time6263 * window.6464+ * Timestamp values in the PHY are read only and do not get cleared except at6565+ * hardware reset or when a new timestamp value is captured. The cached_tstamp6666+ * field is used to detect the case where a new timestamp has not yet been6767+ * captured, ensuring that we avoid sending stale timestamp data to the stack.6368 */6469struct ice_tx_tstamp {6570 struct sk_buff *skb;6671 unsigned long start;7272+ u64 cached_tstamp;6773};68746975/**
+14-14
drivers/net/ethernet/intel/igb/igb_main.c
···76487648 struct vf_mac_filter *entry = NULL;76497649 int ret = 0;7650765076517651+ if ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) &&76527652+ !vf_data->trusted) {76537653+ dev_warn(&pdev->dev,76547654+ "VF %d requested MAC filter but is administratively denied\n",76557655+ vf);76567656+ return -EINVAL;76577657+ }76587658+ if (!is_valid_ether_addr(addr)) {76597659+ dev_warn(&pdev->dev,76607660+ "VF %d attempted to set invalid MAC filter\n",76617661+ vf);76627662+ return -EINVAL;76637663+ }76647664+76517665 switch (info) {76527666 case E1000_VF_MAC_FILTER_CLR:76537667 /* remove all unicast MAC filters related to the current VF */···76757661 }76767662 break;76777663 case E1000_VF_MAC_FILTER_ADD:76787678- if ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) &&76797679- !vf_data->trusted) {76807680- dev_warn(&pdev->dev,76817681- "VF %d requested MAC filter but is administratively denied\n",76827682- vf);76837683- return -EINVAL;76847684- }76857685- if (!is_valid_ether_addr(addr)) {76867686- dev_warn(&pdev->dev,76877687- "VF %d attempted to set invalid MAC filter\n",76887688- vf);76897689- return -EINVAL;76907690- }76917691-76927664 /* try to find empty slot in the list */76937665 list_for_each(pos, &adapter->vf_macs.l) {76947666 entry = list_entry(pos, struct vf_mac_filter, l);
···55315531 if (!speed && hw->mac.ops.get_link_capabilities) {55325532 ret = hw->mac.ops.get_link_capabilities(hw, &speed,55335533 &autoneg);55345534+ /* remove NBASE-T speeds from default autonegotiation55355535+ * to accommodate broken network switches in the field55365536+ * which cannot cope with advertised NBASE-T speeds55375537+ */55345538 speed &= ~(IXGBE_LINK_SPEED_5GB_FULL |55355539 IXGBE_LINK_SPEED_2_5GB_FULL);55365540 }
+3
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
···34053405 /* flush pending Tx transactions */34063406 ixgbe_clear_tx_pending(hw);3407340734083408+ /* set MDIO speed before talking to the PHY in case it's the 1st time */34093409+ ixgbe_set_mdio_speed(hw);34103410+34083411 /* PHY ops must be identified and initialized prior to reset */34093412 status = hw->phy.ops.init(hw);34103413 if (status == IXGBE_ERR_SFP_NOT_SUPPORTED ||
···3333 void (*set_rgmii_speed)(struct rk_priv_data *bsp_priv, int speed);3434 void (*set_rmii_speed)(struct rk_priv_data *bsp_priv, int speed);3535 void (*integrated_phy_powerup)(struct rk_priv_data *bsp_priv);3636+ bool regs_valid;3637 u32 regs[];3738};3839···10931092 .set_to_rmii = rk3568_set_to_rmii,10941093 .set_rgmii_speed = rk3568_set_gmac_speed,10951094 .set_rmii_speed = rk3568_set_gmac_speed,10951095+ .regs_valid = true,10961096 .regs = {10971097 0xfe2a0000, /* gmac0 */10981098 0xfe010000, /* gmac1 */···13851383 * to be distinguished.13861384 */13871385 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);13881388- if (res) {13861386+ if (res && ops->regs_valid) {13891387 int i = 0;1390138813911389 while (ops->regs[i]) {
+17
drivers/net/ethernet/stmicro/stmmac/stmmac.h
···172172 int is_l4;173173};174174175175+/* Rx Frame Steering */176176+enum stmmac_rfs_type {177177+ STMMAC_RFS_T_VLAN,178178+ STMMAC_RFS_T_MAX,179179+};180180+181181+struct stmmac_rfs_entry {182182+ unsigned long cookie;183183+ int in_use;184184+ int type;185185+ int tc;186186+};187187+175188struct stmmac_priv {176189 /* Frequently used values are kept adjacent for cache effect */177190 u32 tx_coal_frames[MTL_MAX_TX_QUEUES];···302289 struct stmmac_tc_entry *tc_entries;303290 unsigned int flow_entries_max;304291 struct stmmac_flow_entry *flow_entries;292292+ unsigned int rfs_entries_max[STMMAC_RFS_T_MAX];293293+ unsigned int rfs_entries_cnt[STMMAC_RFS_T_MAX];294294+ unsigned int rfs_entries_total;295295+ struct stmmac_rfs_entry *rfs_entries;305296306297 /* Pulse Per Second output */307298 struct stmmac_pps_cfg pps[STMMAC_PPS_MAX];
+12-4
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
···14611461{14621462 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];14631463 struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];14641464+ gfp_t gfp = (GFP_ATOMIC | __GFP_NOWARN);14651465+14661466+ if (priv->dma_cap.addr64 <= 32)14671467+ gfp |= GFP_DMA32;1464146814651469 if (!buf->page) {14661466- buf->page = page_pool_dev_alloc_pages(rx_q->page_pool);14701470+ buf->page = page_pool_alloc_pages(rx_q->page_pool, gfp);14671471 if (!buf->page)14681472 return -ENOMEM;14691473 buf->page_offset = stmmac_rx_offset(priv);14701474 }1471147514721476 if (priv->sph && !buf->sec_page) {14731473- buf->sec_page = page_pool_dev_alloc_pages(rx_q->page_pool);14771477+ buf->sec_page = page_pool_alloc_pages(rx_q->page_pool, gfp);14741478 if (!buf->sec_page)14751479 return -ENOMEM;14761480···44864482 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];44874483 int dirty = stmmac_rx_dirty(priv, queue);44884484 unsigned int entry = rx_q->dirty_rx;44854485+ gfp_t gfp = (GFP_ATOMIC | __GFP_NOWARN);44864486+44874487+ if (priv->dma_cap.addr64 <= 32)44884488+ gfp |= GFP_DMA32;4489448944904490 while (dirty-- > 0) {44914491 struct stmmac_rx_buffer *buf = &rx_q->buf_pool[entry];···45024494 p = rx_q->dma_rx + entry;4503449545044496 if (!buf->page) {45054505- buf->page = page_pool_dev_alloc_pages(rx_q->page_pool);44974497+ buf->page = page_pool_alloc_pages(rx_q->page_pool, gfp);45064498 if (!buf->page)45074499 break;45084500 }4509450145104502 if (priv->sph && !buf->sec_page) {45114511- buf->sec_page = page_pool_dev_alloc_pages(rx_q->page_pool);45034503+ buf->sec_page = page_pool_alloc_pages(rx_q->page_pool, gfp);45124504 if (!buf->sec_page)45134505 break;45144506
+73-13
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
···232232 }233233}234234235235+static int tc_rfs_init(struct stmmac_priv *priv)236236+{237237+ int i;238238+239239+ priv->rfs_entries_max[STMMAC_RFS_T_VLAN] = 8;240240+241241+ for (i = 0; i < STMMAC_RFS_T_MAX; i++)242242+ priv->rfs_entries_total += priv->rfs_entries_max[i];243243+244244+ priv->rfs_entries = devm_kcalloc(priv->device,245245+ priv->rfs_entries_total,246246+ sizeof(*priv->rfs_entries),247247+ GFP_KERNEL);248248+ if (!priv->rfs_entries)249249+ return -ENOMEM;250250+251251+ dev_info(priv->device, "Enabled RFS Flow TC (entries=%d)\n",252252+ priv->rfs_entries_total);253253+254254+ return 0;255255+}256256+235257static int tc_init(struct stmmac_priv *priv)236258{237259 struct dma_features *dma_cap = &priv->dma_cap;238260 unsigned int count;239239- int i;261261+ int ret, i;240262241263 if (dma_cap->l3l4fnum) {242264 priv->flow_entries_max = dma_cap->l3l4fnum;···272250 for (i = 0; i < priv->flow_entries_max; i++)273251 priv->flow_entries[i].idx = i;274252275275- dev_info(priv->device, "Enabled Flow TC (entries=%d)\n",253253+ dev_info(priv->device, "Enabled L3L4 Flow TC (entries=%d)\n",276254 priv->flow_entries_max);277255 }256256+257257+ ret = tc_rfs_init(priv);258258+ if (ret)259259+ return -ENOMEM;278260279261 if (!priv->plat->fpe_cfg) {280262 priv->plat->fpe_cfg = devm_kzalloc(priv->device,···633607 return ret;634608}635609610610+static struct stmmac_rfs_entry *tc_find_rfs(struct stmmac_priv *priv,611611+ struct flow_cls_offload *cls,612612+ bool get_free)613613+{614614+ int i;615615+616616+ for (i = 0; i < priv->rfs_entries_total; i++) {617617+ struct stmmac_rfs_entry *entry = &priv->rfs_entries[i];618618+619619+ if (entry->cookie == cls->cookie)620620+ return entry;621621+ if (get_free && entry->in_use == false)622622+ return entry;623623+ }624624+625625+ return NULL;626626+}627627+636628#define VLAN_PRIO_FULL_MASK (0x07)637629638630static int tc_add_vlan_flow(struct stmmac_priv *priv,639631 struct flow_cls_offload *cls)640632{633633+ struct stmmac_rfs_entry *entry = tc_find_rfs(priv, cls, false);641634 struct flow_rule *rule = flow_cls_offload_flow_rule(cls);642635 struct flow_dissector *dissector = rule->match.dissector;643636 int tc = tc_classid_to_hwtc(priv->dev, cls->classid);644637 struct flow_match_vlan match;638638+639639+ if (!entry) {640640+ entry = tc_find_rfs(priv, cls, true);641641+ if (!entry)642642+ return -ENOENT;643643+ }644644+645645+ if (priv->rfs_entries_cnt[STMMAC_RFS_T_VLAN] >=646646+ priv->rfs_entries_max[STMMAC_RFS_T_VLAN])647647+ return -ENOENT;645648646649 /* Nothing to do here */647650 if (!dissector_uses_key(dissector, FLOW_DISSECTOR_KEY_VLAN))···693638694639 prio = BIT(match.key->vlan_priority);695640 stmmac_rx_queue_prio(priv, priv->hw, prio, tc);641641+642642+ entry->in_use = true;643643+ entry->cookie = cls->cookie;644644+ entry->tc = tc;645645+ entry->type = STMMAC_RFS_T_VLAN;646646+ priv->rfs_entries_cnt[STMMAC_RFS_T_VLAN]++;696647 }697648698649 return 0;···707646static int tc_del_vlan_flow(struct stmmac_priv *priv,708647 struct flow_cls_offload *cls)709648{710710- struct flow_rule *rule = flow_cls_offload_flow_rule(cls);711711- struct flow_dissector *dissector = rule->match.dissector;712712- int tc = tc_classid_to_hwtc(priv->dev, cls->classid);649649+ struct stmmac_rfs_entry *entry = tc_find_rfs(priv, cls, false);713650714714- /* Nothing to do here */715715- if (!dissector_uses_key(dissector, FLOW_DISSECTOR_KEY_VLAN))716716- return -EINVAL;651651+ if (!entry || !entry->in_use || entry->type != STMMAC_RFS_T_VLAN)652652+ return -ENOENT;717653718718- if (tc < 0) {719719- netdev_err(priv->dev, "Invalid traffic class\n");720720- return -EINVAL;721721- }654654+ stmmac_rx_queue_prio(priv, priv->hw, 0, entry->tc);722655723723- stmmac_rx_queue_prio(priv, priv->hw, 0, tc);656656+ entry->in_use = false;657657+ entry->cookie = 0;658658+ entry->tc = 0;659659+ entry->type = 0;660660+661661+ priv->rfs_entries_cnt[STMMAC_RFS_T_VLAN]--;724662725663 return 0;726664}
+20-9
drivers/net/ethernet/ti/am65-cpsw-nuss.c
···18441844 if (ret < 0) {18451845 dev_err(dev, "%pOF error reading port_id %d\n",18461846 port_np, ret);18471847- return ret;18471847+ goto of_node_put;18481848 }1849184918501850 if (!port_id || port_id > common->port_num) {18511851 dev_err(dev, "%pOF has invalid port_id %u %s\n",18521852 port_np, port_id, port_np->name);18531853- return -EINVAL;18531853+ ret = -EINVAL;18541854+ goto of_node_put;18541855 }1855185618561857 port = am65_common_get_port(common, port_id);···18671866 (AM65_CPSW_NU_FRAM_PORT_OFFSET * (port_id - 1));1868186718691868 port->slave.mac_sl = cpsw_sl_get("am65", dev, port->port_base);18701870- if (IS_ERR(port->slave.mac_sl))18711871- return PTR_ERR(port->slave.mac_sl);18691869+ if (IS_ERR(port->slave.mac_sl)) {18701870+ ret = PTR_ERR(port->slave.mac_sl);18711871+ goto of_node_put;18721872+ }1872187318731874 port->disabled = !of_device_is_available(port_np);18741875 if (port->disabled) {···18831880 ret = PTR_ERR(port->slave.ifphy);18841881 dev_err(dev, "%pOF error retrieving port phy: %d\n",18851882 port_np, ret);18861886- return ret;18831883+ goto of_node_put;18871884 }1888188518891886 port->slave.mac_only =···18921889 /* get phy/link info */18931890 if (of_phy_is_fixed_link(port_np)) {18941891 ret = of_phy_register_fixed_link(port_np);18951895- if (ret)18961896- return dev_err_probe(dev, ret,18921892+ if (ret) {18931893+ ret = dev_err_probe(dev, ret,18971894 "failed to register fixed-link phy %pOF\n",18981895 port_np);18961896+ goto of_node_put;18971897+ }18991898 port->slave.phy_node = of_node_get(port_np);19001899 } else {19011900 port->slave.phy_node =···19071902 if (!port->slave.phy_node) {19081903 dev_err(dev,19091904 "slave[%d] no phy found\n", port_id);19101910- return -ENODEV;19051905+ ret = -ENODEV;19061906+ goto of_node_put;19111907 }1912190819131909 ret = of_get_phy_mode(port_np, &port->slave.phy_if);19141910 if (ret) {19151911 dev_err(dev, "%pOF read phy-mode err %d\n",19161912 port_np, ret);19171917- return ret;19131913+ goto of_node_put;19181914 }1919191519201916 ret = of_get_mac_address(port_np, port->slave.mac_addr);···19381932 }1939193319401934 return 0;19351935+19361936+of_node_put:19371937+ of_node_put(port_np);19381938+ of_node_put(node);19391939+ return ret;19411940}1942194119431942static void am65_cpsw_pcpu_stats_free(void *data)
···460460461461 if (addr == mdiodev->addr) {462462 device_set_node(dev, of_fwnode_handle(child));463463+ /* The refcount on "child" is passed to the mdio464464+ * device. Do _not_ use of_node_put(child) here.465465+ */463466 return;464467 }465468 }
···733733 pr_debug("%s: rx error: len %u exceeds max size %d\n",734734 dev->name, len, GOOD_PACKET_LEN);735735 dev->stats.rx_length_errors++;736736- goto err_len;736736+ goto err;737737 }738738739739 if (likely(!vi->xdp_enabled)) {···825825826826skip_xdp:827827 skb = build_skb(buf, buflen);828828- if (!skb) {829829- put_page(page);828828+ if (!skb)830829 goto err;831831- }832830 skb_reserve(skb, headroom - delta);833831 skb_put(skb, len);834832 if (!xdp_prog) {···837839 if (metasize)838840 skb_metadata_set(skb, metasize);839841840840-err:841842 return skb;842843843844err_xdp:844845 rcu_read_unlock();845846 stats->xdp_drops++;846846-err_len:847847+err:847848 stats->drops++;848849 put_page(page);849850xdp_xmit:
+9-5
drivers/net/wireless/broadcom/brcm80211/Kconfig
···77 depends on MAC8021188 depends on BCMA_POSSIBLE99 select BCMA1010- select NEW_LEDS if BCMA_DRIVER_GPIO1111- select LEDS_CLASS if BCMA_DRIVER_GPIO1210 select BRCMUTIL1311 select FW_LOADER1412 select CORDIC1513 help1614 This module adds support for PCIe wireless adapters based on Broadcom1717- IEEE802.11n SoftMAC chipsets. It also has WLAN led support, which will1818- be available if you select BCMA_DRIVER_GPIO. If you choose to build a1919- module, the driver will be called brcmsmac.ko.1515+ IEEE802.11n SoftMAC chipsets. If you choose to build a module, the1616+ driver will be called brcmsmac.ko.1717+1818+config BRCMSMAC_LEDS1919+ def_bool BRCMSMAC && BCMA_DRIVER_GPIO && MAC80211_LEDS2020+ help2121+ The brcmsmac LED support depends on the presence of the2222+ BCMA_DRIVER_GPIO driver, and it only works if LED support2323+ is enabled and reachable from the driver module.20242125source "drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig"2226
···22config IWLEGACY33 tristate44 select FW_LOADER55- select NEW_LEDS66- select LEDS_CLASS75 select LEDS_TRIGGERS86 select MAC80211_LEDS97108config IWL4965119 tristate "Intel Wireless WiFi 4965AGN (iwl4965)"1210 depends on PCI && MAC802111111+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC802111312 select IWLEGACY1413 help1514 This option enables support for···3738config IWL39453839 tristate "Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)"3940 depends on PCI && MAC802114141+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC802114042 select IWLEGACY4143 help4244 Select to build the driver supporting the:
+1-1
drivers/net/wireless/intel/iwlwifi/Kconfig
···47474848config IWLWIFI_LEDS4949 bool5050- depends on LEDS_CLASS=y || LEDS_CLASS=IWLWIFI5050+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC802115151 depends on IWLMVM || IWLDVM5252 select LEDS_TRIGGERS5353 select MAC80211_LEDS
+3-2
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
···269269 u8 rate_plcp;270270 u32 rate_flags = 0;271271 bool is_cck;272272- struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);273272274273 /* info->control is only relevant for non HW rate control */275274 if (!ieee80211_hw_check(mvm->hw, HAS_RATE_CONTROL)) {275275+ struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);276276+276277 /* HT rate doesn't make sense for a non data frame */277278 WARN_ONCE(info->control.rates[0].flags & IEEE80211_TX_RC_MCS &&278279 !ieee80211_is_data(fc),279280 "Got a HT rate (flags:0x%x/mcs:%d/fc:0x%x/state:%d) for a non data frame\n",280281 info->control.rates[0].flags,281282 info->control.rates[0].idx,282282- le16_to_cpu(fc), mvmsta->sta_state);283283+ le16_to_cpu(fc), sta ? mvmsta->sta_state : -1);283284284285 rate_idx = info->control.rates[0].idx;285286 }
···332332 If unsure, say Y if you have an Apple Silicon system.333333334334config PCIE_MT7621335335- tristate "MediaTek MT7621 PCIe Controller"336336- depends on (RALINK && SOC_MT7621) || (MIPS && COMPILE_TEST)335335+ bool "MediaTek MT7621 PCIe Controller"336336+ depends on SOC_MT7621 || (MIPS && COMPILE_TEST)337337 select PHY_MT7621_PCI338338 default SOC_MT7621339339 help
+11-4
drivers/pci/msi.c
···722722 goto out_disable;723723 }724724725725- /* Ensure that all table entries are masked. */726726- msix_mask_all(base, tsize);727727-728725 ret = msix_setup_entries(dev, base, entries, nvec, affd);729726 if (ret)730727 goto out_disable;···748751 /* Set MSI-X enabled bits and unmask the function */749752 pci_intx_for_msi(dev, 0);750753 dev->msix_enabled = 1;754754+755755+ /*756756+ * Ensure that all table entries are masked to prevent757757+ * stale entries from firing in a crash kernel.758758+ *759759+ * Done late to deal with a broken Marvell NVME device760760+ * which takes the MSI-X mask bits into account even761761+ * when MSI-X is disabled, which prevents MSI delivery.762762+ */763763+ msix_mask_all(base, tsize);751764 pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL, 0);752765753766 pcibios_free_irq(dev);···784777 free_msi_irqs(dev);785778786779out_disable:787787- pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);780780+ pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE, 0);788781789782 return ret;790783}
···30533053 struct smp_completion_resp *psmpPayload;30543054 struct task_status_struct *ts;30553055 struct pm8001_device *pm8001_dev;30563056- char *pdma_respaddr = NULL;3057305630583057 psmpPayload = (struct smp_completion_resp *)(piomb + 4);30593058 status = le32_to_cpu(psmpPayload->status);···30793080 if (pm8001_dev)30803081 atomic_dec(&pm8001_dev->running_req);30813082 if (pm8001_ha->smp_exp_mode == SMP_DIRECT) {30833083+ struct scatterlist *sg_resp = &t->smp_task.smp_resp;30843084+ u8 *payload;30853085+ void *to;30863086+30823087 pm8001_dbg(pm8001_ha, IO,30833088 "DIRECT RESPONSE Length:%d\n",30843089 param);30853085- pdma_respaddr = (char *)(phys_to_virt(cpu_to_le6430863086- ((u64)sg_dma_address30873087- (&t->smp_task.smp_resp))));30903090+ to = kmap_atomic(sg_page(sg_resp));30913091+ payload = to + sg_resp->offset;30883092 for (i = 0; i < param; i++) {30893089- *(pdma_respaddr+i) = psmpPayload->_r_a[i];30933093+ *(payload + i) = psmpPayload->_r_a[i];30903094 pm8001_dbg(pm8001_ha, IO,30913095 "SMP Byte%d DMA data 0x%x psmp 0x%x\n",30923092- i, *(pdma_respaddr + i),30963096+ i, *(payload + i),30933097 psmpPayload->_r_a[i]);30943098 }30993099+ kunmap_atomic(to);30953100 }30963101 break;30973102 case IO_ABORTED:···42394236 struct sas_task *task = ccb->task;42404237 struct domain_device *dev = task->dev;42414238 struct pm8001_device *pm8001_dev = dev->lldd_dev;42424242- struct scatterlist *sg_req, *sg_resp;42394239+ struct scatterlist *sg_req, *sg_resp, *smp_req;42434240 u32 req_len, resp_len;42444241 struct smp_req smp_cmd;42454242 u32 opc;42464243 struct inbound_queue_table *circularQ;42474247- char *preq_dma_addr = NULL;42484248- __le64 tmp_addr;42494244 u32 i, length;42454245+ u8 *payload;42464246+ u8 *to;4250424742514248 memset(&smp_cmd, 0, sizeof(smp_cmd));42524249 /*···42834280 pm8001_ha->smp_exp_mode = SMP_INDIRECT;428442814285428242864286- tmp_addr = cpu_to_le64((u64)sg_dma_address(&task->smp_task.smp_req));42874287- preq_dma_addr = (char *)phys_to_virt(tmp_addr);42834283+ smp_req = &task->smp_task.smp_req;42844284+ to = kmap_atomic(sg_page(smp_req));42854285+ payload = to + smp_req->offset;4288428642894287 /* INDIRECT MODE command settings. Use DMA */42904288 if (pm8001_ha->smp_exp_mode == SMP_INDIRECT) {···42934289 /* for SPCv indirect mode. Place the top 4 bytes of42944290 * SMP Request header here. */42954291 for (i = 0; i < 4; i++)42964296- smp_cmd.smp_req16[i] = *(preq_dma_addr + i);42924292+ smp_cmd.smp_req16[i] = *(payload + i);42974293 /* exclude top 4 bytes for SMP req header */42984294 smp_cmd.long_smp_req.long_req_addr =42994295 cpu_to_le64((u64)sg_dma_address···43244320 pm8001_dbg(pm8001_ha, IO, "SMP REQUEST DIRECT MODE\n");43254321 for (i = 0; i < length; i++)43264322 if (i < 16) {43274327- smp_cmd.smp_req16[i] = *(preq_dma_addr+i);43234323+ smp_cmd.smp_req16[i] = *(payload + i);43284324 pm8001_dbg(pm8001_ha, IO,43294325 "Byte[%d]:%x (DMA data:%x)\n",43304326 i, smp_cmd.smp_req16[i],43314331- *(preq_dma_addr));43274327+ *(payload));43324328 } else {43334333- smp_cmd.smp_req[i] = *(preq_dma_addr+i);43294329+ smp_cmd.smp_req[i] = *(payload + i);43344330 pm8001_dbg(pm8001_ha, IO,43354331 "Byte[%d]:%x (DMA data:%x)\n",43364332 i, smp_cmd.smp_req[i],43374337- *(preq_dma_addr));43334333+ *(payload));43384334 }43394335 }43404340-43364336+ kunmap_atomic(to);43414337 build_smp_cmd(pm8001_dev->device_id, smp_cmd.tag,43424338 &smp_cmd, pm8001_ha->smp_exp_mode, length);43434339 rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &smp_cmd,
+19
drivers/soc/imx/imx8m-blk-ctrl.c
···17171818#define BLK_SFT_RSTN 0x01919#define BLK_CLK_EN 0x42020+#define BLK_MIPI_RESET_DIV 0x8 /* Mini/Nano DISPLAY_BLK_CTRL only */20212122struct imx8m_blk_ctrl_domain;2223···3736 const char *gpc_name;3837 u32 rst_mask;3938 u32 clk_mask;3939+4040+ /*4141+ * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register4242+ * which is used to control the reset for the MIPI Phy.4343+ * Since it's only present in certain circumstances,4444+ * an if-statement should be used before setting and clearing this4545+ * register.4646+ */4747+ u32 mipi_phy_rst_mask;4048};41494250#define DOMAIN_MAX_CLKS 3···88788979 /* put devices into reset */9080 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask);8181+ if (data->mipi_phy_rst_mask)8282+ regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask);91839284 /* enable upstream and blk-ctrl clocks to allow reset to propagate */9385 ret = clk_bulk_prepare_enable(data->num_clks, domain->clks);···11199112100 /* release reset */113101 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask);102102+ if (data->mipi_phy_rst_mask)103103+ regmap_set_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask);114104115105 /* disable upstream clocks */116106 clk_bulk_disable_unprepare(data->num_clks, domain->clks);···134120 struct imx8m_blk_ctrl *bc = domain->bc;135121136122 /* put devices into reset and disable clocks */123123+ if (data->mipi_phy_rst_mask)124124+ regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask);125125+137126 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask);138127 regmap_clear_bits(bc->regmap, BLK_CLK_EN, data->clk_mask);139128···497480 .gpc_name = "mipi-dsi",498481 .rst_mask = BIT(5),499482 .clk_mask = BIT(8) | BIT(9),483483+ .mipi_phy_rst_mask = BIT(17),500484 },501485 [IMX8MM_DISPBLK_PD_MIPI_CSI] = {502486 .name = "dispblk-mipi-csi",···506488 .gpc_name = "mipi-csi",507489 .rst_mask = BIT(3) | BIT(4),508490 .clk_mask = BIT(10) | BIT(11),491491+ .mipi_phy_rst_mask = BIT(16),509492 },510493};511494
+4
drivers/soc/imx/soc-imx.c
···3636 int ret;3737 int i;38383939+ /* Return early if this is running on devices with different SoCs */4040+ if (!__mxc_cpu_type)4141+ return 0;4242+3943 if (of_machine_is_compatible("fsl,ls1021a"))4044 return 0;4145
+1-1
drivers/soc/tegra/fuse/fuse-tegra.c
···320320};321321builtin_platform_driver(tegra_fuse_driver);322322323323-bool __init tegra_fuse_read_spare(unsigned int spare)323323+u32 __init tegra_fuse_read_spare(unsigned int spare)324324{325325 unsigned int offset = fuse->soc->info->spare + spare * 4;326326
+1-1
drivers/soc/tegra/fuse/fuse.h
···6565void tegra_init_revision(void);6666void tegra_init_apbmisc(void);67676868-bool __init tegra_fuse_read_spare(unsigned int spare);6868+u32 __init tegra_fuse_read_spare(unsigned int spare);6969u32 __init tegra_fuse_read_early(unsigned int offset);70707171u8 tegra_get_major_rev(void);
···10291029 return;10301030 }1031103110321032+ *status = 0;10331033+10321034 cdnsp_finish_td(pdev, td, event, pep, status);10331035}10341036···15251523 spin_lock_irqsave(&pdev->lock, flags);1526152415271525 if (pdev->cdnsp_state & (CDNSP_STATE_HALTED | CDNSP_STATE_DYING)) {15281528- cdnsp_died(pdev);15261526+ /*15271527+ * While removing or stopping driver there may still be deferred15281528+ * not handled interrupt which should not be treated as error.15291529+ * Driver should simply ignore it.15301530+ */15311531+ if (pdev->gadget_driver)15321532+ cdnsp_died(pdev);15331533+15291534 spin_unlock_irqrestore(&pdev->lock, flags);15301535 return IRQ_HANDLED;15311536 }
+2-2
drivers/usb/cdns3/cdnsp-trace.h
···5757 __entry->first_prime_det = pep->stream_info.first_prime_det;5858 __entry->drbls_count = pep->stream_info.drbls_count;5959 ),6060- TP_printk("%s: SID: %08x ep state: %x stream: enabled: %d num %d "6060+ TP_printk("%s: SID: %08x, ep state: %x, stream: enabled: %d num %d "6161 "tds %d, first prime: %d drbls %d",6262- __get_str(name), __entry->state, __entry->stream_id,6262+ __get_str(name), __entry->stream_id, __entry->state,6363 __entry->enabled, __entry->num_streams, __entry->td_count,6464 __entry->first_prime_det, __entry->drbls_count)6565);
···1635163516361636 /* 2 banks of GPIO - One for the pins taken from each serial port */16371637 if (intf_num == 0) {16381638+ priv->gc.ngpio = 2;16391639+16381640 if (mode.eci == CP210X_PIN_MODE_MODEM) {16391641 /* mark all GPIOs of this interface as reserved */16401642 priv->gpio_altfunc = 0xff;···16471645 priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) &16481646 CP210X_ECI_GPIO_MODE_MASK) >>16491647 CP210X_ECI_GPIO_MODE_OFFSET);16501650- priv->gc.ngpio = 2;16511648 } else if (intf_num == 1) {16491649+ priv->gc.ngpio = 3;16501650+16521651 if (mode.sci == CP210X_PIN_MODE_MODEM) {16531652 /* mark all GPIOs of this interface as reserved */16541653 priv->gpio_altfunc = 0xff;···16601657 priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) &16611658 CP210X_SCI_GPIO_MODE_MASK) >>16621659 CP210X_SCI_GPIO_MODE_OFFSET);16631663- priv->gc.ngpio = 3;16641660 } else {16651661 return -ENODEV;16661662 }
···17321732 }17331733 return root;17341734fail:17351735+ /*17361736+ * If our caller provided us an anonymous device, then it's his17371737+ * responsability to free it in case we fail. So we have to set our17381738+ * root's anon_dev to 0 to avoid a double free, once by btrfs_put_root()17391739+ * and once again by our caller.17401740+ */17411741+ if (anon_dev)17421742+ root->anon_dev = 0;17351743 btrfs_put_root(root);17361744 return ERR_PTR(ret);17371745}
···66116611 if (test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags))66126612 return 0;6613661366146614+ /*66156615+ * We could have had EXTENT_BUFFER_UPTODATE cleared by the write66166616+ * operation, which could potentially still be in flight. In this case66176617+ * we simply want to return an error.66186618+ */66196619+ if (unlikely(test_bit(EXTENT_BUFFER_WRITE_ERR, &eb->bflags)))66206620+ return -EIO;66216621+66146622 if (eb->fs_info->sectorsize < PAGE_SIZE)66156623 return read_extent_buffer_subpage(eb, wait, mirror_num);66166624
···617617 * Since we don't abort the transaction in this case, free the618618 * tree block so that we don't leak space and leave the619619 * filesystem in an inconsistent state (an extent item in the620620- * extent tree without backreferences). Also no need to have621621- * the tree block locked since it is not in any tree at this622622- * point, so no other task can find it and use it.620620+ * extent tree with a backreference for a root that does not621621+ * exists).623622 */624624- btrfs_free_tree_block(trans, root, leaf, 0, 1);623623+ btrfs_tree_lock(leaf);624624+ btrfs_clean_tree_block(leaf);625625+ btrfs_tree_unlock(leaf);626626+ btrfs_free_tree_block(trans, objectid, leaf, 0, 1);625627 free_extent_buffer(leaf);626628 goto fail;627629 }
···11811181 parent_objectid, victim_name,11821182 victim_name_len);11831183 if (ret < 0) {11841184+ kfree(victim_name);11841185 return ret;11851186 } else if (!ret) {11861187 ret = -ENOENT;···39783977 goto done;39793978 }39803979 if (btrfs_header_generation(path->nodes[0]) != trans->transid) {39803980+ ctx->last_dir_item_offset = min_key.offset;39813981 ret = overwrite_item(trans, log, dst_path,39823982 path->nodes[0], path->slots[0],39833983 &min_key);
+4-2
fs/btrfs/volumes.c
···1370137013711371 bytenr_orig = btrfs_sb_offset(0);13721372 ret = btrfs_sb_log_location_bdev(bdev, 0, READ, &bytenr);13731373- if (ret)13741374- return ERR_PTR(ret);13731373+ if (ret) {13741374+ device = ERR_PTR(ret);13751375+ goto error_bdev_put;13761376+ }1375137713761378 disk_super = btrfs_read_disk_super(bdev, bytenr, bytenr_orig);13771379 if (IS_ERR(disk_super)) {
+8-8
fs/ceph/caps.c
···43504350{43514351 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(ci->vfs_inode.i_sb);43524352 int bits = (fmode << 1) | 1;43534353- bool is_opened = false;43534353+ bool already_opened = false;43544354 int i;4355435543564356 if (count == 1)···4358435843594359 spin_lock(&ci->i_ceph_lock);43604360 for (i = 0; i < CEPH_FILE_MODE_BITS; i++) {43614361- if (bits & (1 << i))43624362- ci->i_nr_by_mode[i] += count;43634363-43644361 /*43654365- * If any of the mode ref is larger than 1,43624362+ * If any of the mode ref is larger than 0,43664363 * that means it has been already opened by43674364 * others. Just skip checking the PIN ref.43684365 */43694369- if (i && ci->i_nr_by_mode[i] > 1)43704370- is_opened = true;43664366+ if (i && ci->i_nr_by_mode[i])43674367+ already_opened = true;43684368+43694369+ if (bits & (1 << i))43704370+ ci->i_nr_by_mode[i] += count;43714371 }4372437243734373- if (!is_opened)43734373+ if (!already_opened)43744374 percpu_counter_inc(&mdsc->metric.opened_inodes);43754375 spin_unlock(&ci->i_ceph_lock);43764376}
···30643064 (cifs_sb->ctx->rsize > server->ops->negotiate_rsize(tcon, ctx)))30653065 cifs_sb->ctx->rsize = server->ops->negotiate_rsize(tcon, ctx);3066306630673067+ /*30683068+ * The cookie is initialized from volume info returned above.30693069+ * Inside cifs_fscache_get_super_cookie it checks30703070+ * that we do not get super cookie twice.30713071+ */30723072+ cifs_fscache_get_super_cookie(tcon);30733073+30673074out:30683075 mnt_ctx->server = server;30693076 mnt_ctx->ses = ses;
+37-1
fs/cifs/fs_context.c
···435435}436436437437/*438438+ * Remove duplicate path delimiters. Windows is supposed to do that439439+ * but there are some bugs that prevent rename from working if there are440440+ * multiple delimiters.441441+ *442442+ * Returns a sanitized duplicate of @path. The caller is responsible for443443+ * cleaning up the original.444444+ */445445+#define IS_DELIM(c) ((c) == '/' || (c) == '\\')446446+static char *sanitize_path(char *path)447447+{448448+ char *cursor1 = path, *cursor2 = path;449449+450450+ /* skip all prepended delimiters */451451+ while (IS_DELIM(*cursor1))452452+ cursor1++;453453+454454+ /* copy the first letter */455455+ *cursor2 = *cursor1;456456+457457+ /* copy the remainder... */458458+ while (*(cursor1++)) {459459+ /* ... skipping all duplicated delimiters */460460+ if (IS_DELIM(*cursor1) && IS_DELIM(*cursor2))461461+ continue;462462+ *(++cursor2) = *cursor1;463463+ }464464+465465+ /* if the last character is a delimiter, skip it */466466+ if (IS_DELIM(*(cursor2 - 1)))467467+ cursor2--;468468+469469+ *(cursor2) = '\0';470470+ return kstrdup(path, GFP_KERNEL);471471+}472472+473473+/*438474 * Parse a devname into substrings and populate the ctx->UNC and ctx->prepath439475 * fields with the result. Returns 0 on success and an error otherwise440476 * (e.g. ENOMEM or EINVAL)···529493 if (!*pos)530494 return 0;531495532532- ctx->prepath = kstrdup(pos, GFP_KERNEL);496496+ ctx->prepath = sanitize_path(pos);533497 if (!ctx->prepath)534498 return -ENOMEM;535499
-13
fs/cifs/inode.c
···13561356 goto out;13571357 }1358135813591359-#ifdef CONFIG_CIFS_FSCACHE13601360- /* populate tcon->resource_id */13611361- tcon->resource_id = CIFS_I(inode)->uniqueid;13621362-#endif13631363-13641359 if (rc && tcon->pipe) {13651360 cifs_dbg(FYI, "ipc connection - fake read inode\n");13661361 spin_lock(&inode->i_lock);···13701375 iget_failed(inode);13711376 inode = ERR_PTR(rc);13721377 }13731373-13741374- /*13751375- * The cookie is initialized from volume info returned above.13761376- * Inside cifs_fscache_get_super_cookie it checks13771377- * that we do not get super cookie twice.13781378- */13791379- cifs_fscache_get_super_cookie(tcon);13801380-13811378out:13821379 kfree(path);13831380 free_xid(xid);
+56-16
fs/file.c
···841841 spin_unlock(&files->file_lock);842842}843843844844+static inline struct file *__fget_files_rcu(struct files_struct *files,845845+ unsigned int fd, fmode_t mask, unsigned int refs)846846+{847847+ for (;;) {848848+ struct file *file;849849+ struct fdtable *fdt = rcu_dereference_raw(files->fdt);850850+ struct file __rcu **fdentry;851851+852852+ if (unlikely(fd >= fdt->max_fds))853853+ return NULL;854854+855855+ fdentry = fdt->fd + array_index_nospec(fd, fdt->max_fds);856856+ file = rcu_dereference_raw(*fdentry);857857+ if (unlikely(!file))858858+ return NULL;859859+860860+ if (unlikely(file->f_mode & mask))861861+ return NULL;862862+863863+ /*864864+ * Ok, we have a file pointer. However, because we do865865+ * this all locklessly under RCU, we may be racing with866866+ * that file being closed.867867+ *868868+ * Such a race can take two forms:869869+ *870870+ * (a) the file ref already went down to zero,871871+ * and get_file_rcu_many() fails. Just try872872+ * again:873873+ */874874+ if (unlikely(!get_file_rcu_many(file, refs)))875875+ continue;876876+877877+ /*878878+ * (b) the file table entry has changed under us.879879+ * Note that we don't need to re-check the 'fdt->fd'880880+ * pointer having changed, because it always goes881881+ * hand-in-hand with 'fdt'.882882+ *883883+ * If so, we need to put our refs and try again.884884+ */885885+ if (unlikely(rcu_dereference_raw(files->fdt) != fdt) ||886886+ unlikely(rcu_dereference_raw(*fdentry) != file)) {887887+ fput_many(file, refs);888888+ continue;889889+ }890890+891891+ /*892892+ * Ok, we have a ref to the file, and checked that it893893+ * still exists.894894+ */895895+ return file;896896+ }897897+}898898+844899static struct file *__fget_files(struct files_struct *files, unsigned int fd,845900 fmode_t mask, unsigned int refs)846901{847902 struct file *file;848903849904 rcu_read_lock();850850-loop:851851- file = files_lookup_fd_rcu(files, fd);852852- if (file) {853853- /* File object ref couldn't be taken.854854- * dup2() atomicity guarantee is the reason855855- * we loop to catch the new file (or NULL pointer)856856- */857857- if (file->f_mode & mask)858858- file = NULL;859859- else if (!get_file_rcu_many(file, refs))860860- goto loop;861861- else if (files_lookup_fd_raw(files, fd) != file) {862862- fput_many(file, refs);863863- goto loop;864864- }865865- }905905+ file = __fget_files_rcu(files, fd, mask, refs);866906 rcu_read_unlock();867907868908 return file;
···17871787MODULE_AUTHOR("Damien Le Moal");17881788MODULE_DESCRIPTION("Zone file system for zoned block devices");17891789MODULE_LICENSE("GPL");17901790+MODULE_ALIAS_FS("zonefs");17901791module_init(zonefs_init);17911792module_exit(zonefs_exit);
+10-8
include/uapi/linux/mptcp.h
···136136 * MPTCP_EVENT_REMOVED: token, rem_id137137 * An address has been lost by the peer.138138 *139139- * MPTCP_EVENT_SUB_ESTABLISHED: token, family, saddr4 | saddr6,140140- * daddr4 | daddr6, sport, dport, backup,141141- * if_idx [, error]139139+ * MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id,140140+ * saddr4 | saddr6, daddr4 | daddr6, sport,141141+ * dport, backup, if_idx [, error]142142 * A new subflow has been established. 'error' should not be set.143143 *144144- * MPTCP_EVENT_SUB_CLOSED: token, family, saddr4 | saddr6, daddr4 | daddr6,145145- * sport, dport, backup, if_idx [, error]144144+ * MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,145145+ * daddr4 | daddr6, sport, dport, backup, if_idx146146+ * [, error]146147 * A subflow has been closed. An error (copy of sk_err) could be set if an147148 * error has been detected for this subflow.148149 *149149- * MPTCP_EVENT_SUB_PRIORITY: token, family, saddr4 | saddr6, daddr4 | daddr6,150150- * sport, dport, backup, if_idx [, error]151151- * The priority of a subflow has changed. 'error' should not be set.150150+ * MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,151151+ * daddr4 | daddr6, sport, dport, backup, if_idx152152+ * [, error]153153+ * The priority of a subflow has changed. 'error' should not be set.152154 */153155enum mptcp_event_type {154156 MPTCP_EVENT_UNSPEC = 0,
+10-11
kernel/audit.c
···718718{719719 int rc = 0;720720 struct sk_buff *skb;721721- static unsigned int failed = 0;721721+ unsigned int failed = 0;722722723723 /* NOTE: kauditd_thread takes care of all our locking, we just use724724 * the netlink info passed to us (e.g. sk and portid) */···735735 continue;736736 }737737738738+retry:738739 /* grab an extra skb reference in case of error */739740 skb_get(skb);740741 rc = netlink_unicast(sk, skb, portid, 0);741742 if (rc < 0) {742742- /* fatal failure for our queue flush attempt? */743743+ /* send failed - try a few times unless fatal error */743744 if (++failed >= retry_limit ||744745 rc == -ECONNREFUSED || rc == -EPERM) {745745- /* yes - error processing for the queue */746746 sk = NULL;747747 if (err_hook)748748 (*err_hook)(skb);749749- if (!skb_hook)750750- goto out;751751- /* keep processing with the skb_hook */749749+ if (rc == -EAGAIN)750750+ rc = 0;751751+ /* continue to drain the queue */752752 continue;753753 } else754754- /* no - requeue to preserve ordering */755755- skb_queue_head(queue, skb);754754+ goto retry;756755 } else {757757- /* it worked - drop the extra reference and continue */756756+ /* skb sent - drop the extra reference and continue */758757 consume_skb(skb);759758 failed = 0;760759 }761760 }762761763763-out:764762 return (rc >= 0 ? 0 : rc);765763}766764···16071609 audit_panic("cannot initialize netlink socket in namespace");16081610 return -ENOMEM;16091611 }16101610- aunet->sk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT;16121612+ /* limit the timeout in case auditd is blocked/stopped */16131613+ aunet->sk->sk_sndtimeo = HZ / 10;1611161416121615 return 0;16131616}
+36-17
kernel/bpf/verifier.c
···13661366 reg->var_off = tnum_or(tnum_clear_subreg(var64_off), var32_off);13671367}1368136813691369+static bool __reg32_bound_s64(s32 a)13701370+{13711371+ return a >= 0 && a <= S32_MAX;13721372+}13731373+13691374static void __reg_assign_32_into_64(struct bpf_reg_state *reg)13701375{13711376 reg->umin_value = reg->u32_min_value;13721377 reg->umax_value = reg->u32_max_value;13731373- /* Attempt to pull 32-bit signed bounds into 64-bit bounds13741374- * but must be positive otherwise set to worse case bounds13751375- * and refine later from tnum.13781378+13791379+ /* Attempt to pull 32-bit signed bounds into 64-bit bounds but must13801380+ * be positive otherwise set to worse case bounds and refine later13811381+ * from tnum.13761382 */13771377- if (reg->s32_min_value >= 0 && reg->s32_max_value >= 0)13781378- reg->smax_value = reg->s32_max_value;13791379- else13801380- reg->smax_value = U32_MAX;13811381- if (reg->s32_min_value >= 0)13831383+ if (__reg32_bound_s64(reg->s32_min_value) &&13841384+ __reg32_bound_s64(reg->s32_max_value)) {13821385 reg->smin_value = reg->s32_min_value;13831383- else13861386+ reg->smax_value = reg->s32_max_value;13871387+ } else {13841388 reg->smin_value = 0;13891389+ reg->smax_value = U32_MAX;13901390+ }13851391}1386139213871393static void __reg_combine_32_into_64(struct bpf_reg_state *reg)···23852379 */23862380 if (insn->src_reg != BPF_REG_FP)23872381 return 0;23882388- if (BPF_SIZE(insn->code) != BPF_DW)23892389- return 0;2390238223912383 /* dreg = *(u64 *)[fp - off] was a fill from the stack.23922384 * that [fp - off] slot contains scalar that needs to be···24062402 return -ENOTSUPP;24072403 /* scalars can only be spilled into stack */24082404 if (insn->dst_reg != BPF_REG_FP)24092409- return 0;24102410- if (BPF_SIZE(insn->code) != BPF_DW)24112405 return 0;24122406 spi = (-insn->off - 1) / BPF_REG_SIZE;24132407 if (spi >= 64) {···4553455145544552 if (insn->imm == BPF_CMPXCHG) {45554553 /* Check comparison of R0 with memory location */45564556- err = check_reg_arg(env, BPF_REG_0, SRC_OP);45544554+ const u32 aux_reg = BPF_REG_0;45554555+45564556+ err = check_reg_arg(env, aux_reg, SRC_OP);45574557 if (err)45584558 return err;45594559+45604560+ if (is_pointer_value(env, aux_reg)) {45614561+ verbose(env, "R%d leaks addr into mem\n", aux_reg);45624562+ return -EACCES;45634563+ }45594564 }4560456545614566 if (is_pointer_value(env, insn->src_reg)) {···45974588 load_reg = -1;45984589 }4599459046004600- /* check whether we can read the memory */45914591+ /* Check whether we can read the memory, with second call for fetch45924592+ * case to simulate the register fill.45934593+ */46014594 err = check_mem_access(env, insn_idx, insn->dst_reg, insn->off,46024602- BPF_SIZE(insn->code), BPF_READ, load_reg, true);45954595+ BPF_SIZE(insn->code), BPF_READ, -1, true);45964596+ if (!err && load_reg >= 0)45974597+ err = check_mem_access(env, insn_idx, insn->dst_reg, insn->off,45984598+ BPF_SIZE(insn->code), BPF_READ, load_reg,45994599+ true);46034600 if (err)46044601 return err;4605460246064606- /* check whether we can write into the same memory */46034603+ /* Check whether we can write into the same memory. */46074604 err = check_mem_access(env, insn_idx, insn->dst_reg, insn->off,46084605 BPF_SIZE(insn->code), BPF_WRITE, -1, true);46094606 if (err)···83238308 insn->dst_reg);83248309 }83258310 zext_32_to_64(dst_reg);83118311+83128312+ __update_reg_bounds(dst_reg);83138313+ __reg_deduce_bounds(dst_reg);83148314+ __reg_bound_offset(dst_reg);83268315 }83278316 } else {83288317 /* case: R = imm
+1-1
kernel/locking/rtmutex.c
···13801380 * - the VCPU on which owner runs is preempted13811381 */13821382 if (!owner->on_cpu || need_resched() ||13831383- rt_mutex_waiter_is_top_waiter(lock, waiter) ||13831383+ !rt_mutex_waiter_is_top_waiter(lock, waiter) ||13841384 vcpu_is_preempted(task_cpu(owner))) {13851385 res = false;13861386 break;
+9
kernel/signal.c
···41854185 ss_mode != 0))41864186 return -EINVAL;4187418741884188+ /*41894189+ * Return before taking any locks if no actual41904190+ * sigaltstack changes were requested.41914191+ */41924192+ if (t->sas_ss_sp == (unsigned long)ss_sp &&41934193+ t->sas_ss_size == ss_size &&41944194+ t->sas_ss_flags == ss_flags)41954195+ return 0;41964196+41884197 sigaltstack_lock();41894198 if (ss_mode == SS_DISABLE) {41904199 ss_size = 0;
···12191219{12201220 struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif);1221122112221222- if (local->in_reconfig)12221222+ /* In reconfig don't transmit now, but mark for waking later */12231223+ if (local->in_reconfig) {12241224+ set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txq->flags);12231225 return;12261226+ }1224122712251228 if (!check_sdata_in_driver(sdata))12261229 return;
+10-3
net/mac80211/mlme.c
···24522452 u16 tx_time)24532453{24542454 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;24552455- u16 tid = ieee80211_get_tid(hdr);24562456- int ac = ieee80211_ac_from_tid(tid);24572457- struct ieee80211_sta_tx_tspec *tx_tspec = &ifmgd->tx_tspec[ac];24552455+ u16 tid;24562456+ int ac;24572457+ struct ieee80211_sta_tx_tspec *tx_tspec;24582458 unsigned long now = jiffies;24592459+24602460+ if (!ieee80211_is_data_qos(hdr->frame_control))24612461+ return;24622462+24632463+ tid = ieee80211_get_tid(hdr);24642464+ ac = ieee80211_ac_from_tid(tid);24652465+ tx_tspec = &ifmgd->tx_tspec[ac];2459246624602467 if (likely(!tx_tspec->admitted_time))24612468 return;
+1
net/mac80211/rx.c
···29442944 if (!fwd_skb)29452945 goto out;2946294629472947+ fwd_skb->dev = sdata->dev;29472948 fwd_hdr = (struct ieee80211_hdr *) fwd_skb->data;29482949 fwd_hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_RETRY);29492950 info = IEEE80211_SKB_CB(fwd_skb);
+12-9
net/mac80211/sta_info.c
···644644 /* check if STA exists already */645645 if (sta_info_get_bss(sdata, sta->sta.addr)) {646646 err = -EEXIST;647647- goto out_err;647647+ goto out_cleanup;648648 }649649650650 sinfo = kzalloc(sizeof(struct station_info), GFP_KERNEL);651651 if (!sinfo) {652652 err = -ENOMEM;653653- goto out_err;653653+ goto out_cleanup;654654 }655655656656 local->num_sta++;···667667668668 list_add_tail_rcu(&sta->list, &local->sta_list);669669670670+ /* update channel context before notifying the driver about state671671+ * change, this enables driver using the updated channel context right away.672672+ */673673+ if (sta->sta_state >= IEEE80211_STA_ASSOC) {674674+ ieee80211_recalc_min_chandef(sta->sdata);675675+ if (!sta->sta.support_p2p_ps)676676+ ieee80211_recalc_p2p_go_ps_allowed(sta->sdata);677677+ }678678+670679 /* notify driver */671680 err = sta_info_insert_drv_state(local, sdata, sta);672681 if (err)673682 goto out_remove;674683675684 set_sta_flag(sta, WLAN_STA_INSERTED);676676-677677- if (sta->sta_state >= IEEE80211_STA_ASSOC) {678678- ieee80211_recalc_min_chandef(sta->sdata);679679- if (!sta->sta.support_p2p_ps)680680- ieee80211_recalc_p2p_go_ps_allowed(sta->sdata);681681- }682685683686 /* accept BA sessions now */684687 clear_sta_flag(sta, WLAN_STA_BLOCK_BA);···709706 out_drop_sta:710707 local->num_sta--;711708 synchronize_net();709709+ out_cleanup:712710 cleanup_single_sta(sta);713713- out_err:714711 mutex_unlock(&local->sta_mtx);715712 kfree(sinfo);716713 rcu_read_lock();
+2
net/mac80211/sta_info.h
···176176 * @failed_bar_ssn: ssn of the last failed BAR tx attempt177177 * @bar_pending: BAR needs to be re-sent178178 * @amsdu: support A-MSDU withing A-MDPU179179+ * @ssn: starting sequence number of the session179180 *180181 * This structure's lifetime is managed by RCU, assignments to181182 * the array holding it must hold the aggregation mutex.···200199 u8 stop_initiator;201200 bool tx_stop;202201 u16 buf_size;202202+ u16 ssn;203203204204 u16 failed_bar_ssn;205205 bool bar_pending;
+5-5
net/mac80211/tx.c
···18221822 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);18231823 ieee80211_tx_result res = TX_CONTINUE;1824182418251825+ if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))18261826+ CALL_TXH(ieee80211_tx_h_rate_ctrl);18271827+18251828 if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION)) {18261829 __skb_queue_tail(&tx->skbs, tx->skb);18271830 tx->skb = NULL;18281831 goto txh_done;18291832 }18301830-18311831- if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))18321832- CALL_TXH(ieee80211_tx_h_rate_ctrl);1833183318341834 CALL_TXH(ieee80211_tx_h_michael_mic_add);18351835 CALL_TXH(ieee80211_tx_h_sequence);···4191419141924192 ieee80211_aggr_check(sdata, sta, skb);4193419341944194+ sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift);41954195+41944196 if (sta) {41954197 struct ieee80211_fast_tx *fast_tx;41964196-41974197- sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift);4198419841994199 fast_tx = rcu_dereference(sta->fast_tx);42004200
+14-9
net/mac80211/util.c
···943943 struct ieee802_11_elems *elems)944944{945945 const void *data = elem->data + 1;946946- u8 len = elem->datalen - 1;946946+ u8 len;947947+948948+ if (!elem->datalen)949949+ return;950950+951951+ len = elem->datalen - 1;947952948953 switch (elem->data[0]) {949954 case WLAN_EID_EXT_HE_MU_EDCA:···20682063 chandef.chan = chan;2069206420702065 skb = ieee80211_probereq_get(&local->hw, src, ssid, ssid_len,20712071- 100 + ie_len);20662066+ local->scan_ies_len + ie_len);20722067 if (!skb)20732068 return NULL;20742069···26512646 mutex_unlock(&local->sta_mtx);26522647 }2653264826492649+ /*26502650+ * If this is for hw restart things are still running.26512651+ * We may want to change that later, however.26522652+ */26532653+ if (local->open_count && (!suspended || reconfig_due_to_wowlan))26542654+ drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART);26552655+26542656 if (local->in_reconfig) {26552657 local->in_reconfig = false;26562658 barrier();···26752663 ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,26762664 IEEE80211_QUEUE_STOP_REASON_SUSPEND,26772665 false);26782678-26792679- /*26802680- * If this is for hw restart things are still running.26812681- * We may want to change that later, however.26822682- */26832683- if (local->open_count && (!suspended || reconfig_due_to_wowlan))26842684- drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART);2685266626862667 if (!suspended)26872668 return 0;
···525525 case TCP_NODELAY:526526 case TCP_THIN_LINEAR_TIMEOUTS:527527 case TCP_CONGESTION:528528- case TCP_ULP:529528 case TCP_CORK:530529 case TCP_KEEPIDLE:531530 case TCP_KEEPINTVL:
···253253 * should end up here, but if it254254 * does, reset/destroy the connection.255255 */256256+ kfree(conn->c_path);256257 kmem_cache_free(rds_conn_slab, conn);257258 conn = ERR_PTR(-EOPNOTSUPP);258259 goto out;
···27362736 q->tins = kvcalloc(CAKE_MAX_TINS, sizeof(struct cake_tin_data),27372737 GFP_KERNEL);27382738 if (!q->tins)27392739- goto nomem;27392739+ return -ENOMEM;2740274027412741 for (i = 0; i < CAKE_MAX_TINS; i++) {27422742 struct cake_tin_data *b = q->tins + i;···27662766 q->min_netlen = ~0;27672767 q->min_adjlen = ~0;27682768 return 0;27692769-27702770-nomem:27712771- cake_destroy(sch);27722772- return -ENOMEM;27732769}2774277027752771static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)
+2-2
net/sched/sch_ets.c
···666666 }667667 }668668 for (i = q->nbands; i < oldbands; i++) {669669- qdisc_tree_flush_backlog(q->classes[i].qdisc);670670- if (i >= q->nstrict)669669+ if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)671670 list_del(&q->classes[i].alist);671671+ qdisc_tree_flush_backlog(q->classes[i].qdisc);672672 }673673 q->nstrict = nstrict;674674 memcpy(q->prio2band, priomap, sizeof(priomap));
+3-1
net/smc/af_smc.c
···194194 /* cleanup for a dangling non-blocking connect */195195 if (smc->connect_nonblock && sk->sk_state == SMC_INIT)196196 tcp_abort(smc->clcsock->sk, ECONNABORTED);197197- flush_work(&smc->connect_work);197197+198198+ if (cancel_work_sync(&smc->connect_work))199199+ sock_put(&smc->sk); /* sock_hold in smc_connect for passive closing */198200199201 if (sk->sk_state == SMC_LISTEN)200202 /* smc_close_non_accepted() is called and acquires
+2-1
net/vmw_vsock/virtio_transport_common.c
···12991299 space_available = virtio_transport_space_update(sk, pkt);1300130013011301 /* Update CID in case it has changed after a transport reset event */13021302- vsk->local_addr.svm_cid = dst.svm_cid;13021302+ if (vsk->local_addr.svm_cid != VMADDR_CID_ANY)13031303+ vsk->local_addr.svm_cid = dst.svm_cid;1303130413041305 if (space_available)13051306 sk->sk_write_space(sk);
···7272 ip link set $h1.10 address $h1_10_mac7373}74747575+rif_mac_profile_consolidation_test()7676+{7777+ local count=$1; shift7878+ local h1_20_mac7979+8080+ RET=08181+8282+ if [[ $count -eq 1 ]]; then8383+ return8484+ fi8585+8686+ h1_20_mac=$(mac_get $h1.20)8787+8888+ # Set the MAC of $h1.20 to that of $h1.10 and confirm that they are8989+ # using the same MAC profile.9090+ ip link set $h1.20 address 00:11:11:11:11:119191+ check_err $?9292+9393+ occ=$(devlink -j resource show $DEVLINK_DEV \9494+ | jq '.[][][] | select(.name=="rif_mac_profiles") |.["occ"]')9595+9696+ [[ $occ -eq $((count - 1)) ]]9797+ check_err $? "MAC profile occupancy did not decrease"9898+9999+ log_test "RIF MAC profile consolidation"100100+101101+ ip link set $h1.20 address $h1_20_mac102102+}103103+75104rif_mac_profile_shared_replacement_test()76105{77106 local count=$1; shift···133104 create_max_rif_mac_profiles $count134105135106 rif_mac_profile_replacement_test107107+ rif_mac_profile_consolidation_test $count136108 rif_mac_profile_shared_replacement_test $count137109}138110
···110110 ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, PMU_CAP_LBR_FMT);111111 TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail.");112112113113- /* testcase 4, set capabilities when we don't have PDCM bit */114114- entry_1_0->ecx &= ~X86_FEATURE_PDCM;115115- vcpu_set_cpuid(vm, VCPU_ID, cpuid);116116- ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, host_cap.capabilities);117117- TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail.");118118-119119- /* testcase 5, set capabilities when we don't have PMU version bits */120120- entry_1_0->ecx |= X86_FEATURE_PDCM;121121- eax.split.version_id = 0;122122- entry_1_0->ecx = eax.full;123123- vcpu_set_cpuid(vm, VCPU_ID, cpuid);124124- ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, PMU_CAP_FW_WRITES);125125- TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail.");126126-127127- vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, 0);128128- ASSERT_EQ(vcpu_get_msr(vm, VCPU_ID, MSR_IA32_PERF_CAPABILITIES), 0);129129-130113 kvm_vm_free(vm);131114}
+34-11
tools/testing/selftests/net/fcnal-test.sh
···455455 ip netns del ${NSC} >/dev/null 2>&1456456}457457458458+cleanup_vrf_dup()459459+{460460+ ip link del ${NSA_DEV2} >/dev/null 2>&1461461+ ip netns pids ${NSC} | xargs kill 2>/dev/null462462+ ip netns del ${NSC} >/dev/null 2>&1463463+}464464+465465+setup_vrf_dup()466466+{467467+ # some VRF tests use ns-C which has the same config as468468+ # ns-B but for a device NOT in the VRF469469+ create_ns ${NSC} "-" "-"470470+ connect_ns ${NSA} ${NSA_DEV2} ${NSA_IP}/24 ${NSA_IP6}/64 \471471+ ${NSC} ${NSC_DEV} ${NSB_IP}/24 ${NSB_IP6}/64472472+}473473+458474setup()459475{460476 local with_vrf=${1}···500484501485 ip -netns ${NSB} ro add ${VRF_IP}/32 via ${NSA_IP} dev ${NSB_DEV}502486 ip -netns ${NSB} -6 ro add ${VRF_IP6}/128 via ${NSA_IP6} dev ${NSB_DEV}503503-504504- # some VRF tests use ns-C which has the same config as505505- # ns-B but for a device NOT in the VRF506506- create_ns ${NSC} "-" "-"507507- connect_ns ${NSA} ${NSA_DEV2} ${NSA_IP}/24 ${NSA_IP6}/64 \508508- ${NSC} ${NSC_DEV} ${NSB_IP}/24 ${NSB_IP6}/64509487 else510488 ip -netns ${NSA} ro add ${NSB_LO_IP}/32 via ${NSB_IP} dev ${NSA_DEV}511489 ip -netns ${NSA} ro add ${NSB_LO_IP6}/128 via ${NSB_IP6} dev ${NSA_DEV}···12501240 log_test_addr ${a} $? 1 "Global server, local connection"1251124112521242 # run MD5 tests12431243+ setup_vrf_dup12531244 ipv4_tcp_md512451245+ cleanup_vrf_dup1254124612551247 #12561248 # enable VRF global server···18101798 for a in ${NSA_IP} ${VRF_IP}18111799 do18121800 log_start18011801+ show_hint "Socket not bound to VRF, but address is in VRF"18131802 run_cmd nettest -s -R -P icmp -l ${a} -b18141814- log_test_addr ${a} $? 0 "Raw socket bind to local address"18031803+ log_test_addr ${a} $? 1 "Raw socket bind to local address"1815180418161805 log_start18171806 run_cmd nettest -s -R -P icmp -l ${a} -I ${NSA_DEV} -b···22042191 log_start22052192 show_hint "Fails since VRF device does not support linklocal or multicast"22062193 run_cmd ${ping6} -c1 -w1 ${a}22072207- log_test_addr ${a} $? 2 "ping out, VRF bind"21942194+ log_test_addr ${a} $? 1 "ping out, VRF bind"22082195 done2209219622102197 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV} ${MCAST}%${NSA_DEV}···27322719 log_test_addr ${a} $? 1 "Global server, local connection"2733272027342721 # run MD5 tests27222722+ setup_vrf_dup27352723 ipv6_tcp_md527242724+ cleanup_vrf_dup2736272527372726 #27382727 # enable VRF global server···34293414 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b34303415 log_test_addr ${a} $? 0 "TCP socket bind to local address after device bind"3431341634173417+ # Sadly, the kernel allows binding a socket to a device and then34183418+ # binding to an address not on the device. So this test passes34193419+ # when it really should not34323420 a=${NSA_LO_IP6}34333421 log_start34343434- show_hint "Should fail with 'Cannot assign requested address'"34223422+ show_hint "Tecnically should fail since address is not on device but kernel allows"34353423 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b34363436- log_test_addr ${a} $? 1 "TCP socket bind to out of scope local address"34243424+ log_test_addr ${a} $? 0 "TCP socket bind to out of scope local address"34373425}3438342634393427ipv6_addr_bind_vrf()···34773459 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b34783460 log_test_addr ${a} $? 0 "TCP socket bind to local address with device bind"3479346134623462+ # Sadly, the kernel allows binding a socket to a device and then34633463+ # binding to an address not on the device. The only restriction34643464+ # is that the address is valid in the L3 domain. So this test34653465+ # passes when it really should not34803466 a=${VRF_IP6}34813467 log_start34683468+ show_hint "Tecnically should fail since address is not on device but kernel allows"34823469 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b34833483- log_test_addr ${a} $? 1 "TCP socket bind to VRF address with device bind"34703470+ log_test_addr ${a} $? 0 "TCP socket bind to VRF address with device bind"3484347134853472 a=${NSA_LO_IP6}34863473 log_start
···1313NETIFS[p6]=veth51414NETIFS[p7]=veth61515NETIFS[p8]=veth71616+NETIFS[p9]=veth81717+NETIFS[p10]=veth916181719# Port that does not have a cable connected.1820NETIF_NO_CABLE=eth8
+1-1
tools/testing/selftests/net/icmp_redirect.sh
···311311 ip -netns h1 ro get ${H1_VRF_ARG} ${H2_N2_IP} | \312312 grep -E -v 'mtu|redirected' | grep -q "cache"313313 fi314314- log_test $? 0 "IPv4: ${desc}"314314+ log_test $? 0 "IPv4: ${desc}" 0315315316316 # No PMTU info for test "redirect" and "mtu exception plus redirect"317317 if [ "$with_redirect" = "yes" ] && [ "$desc" != "redirect exception plus mtu" ]; then
+1-1
tools/testing/selftests/net/toeplitz.c
···498498 bool have_toeplitz = false;499499 int index, c;500500501501- while ((c = getopt_long(argc, argv, "46C:d:i:k:r:stT:u:v", long_options, &index)) != -1) {501501+ while ((c = getopt_long(argc, argv, "46C:d:i:k:r:stT:uv", long_options, &index)) != -1) {502502 switch (c) {503503 case '4':504504 cfg_family = AF_INET;