Linux 5.10.191
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.10.191 kernel.
All users of the 5.10 kernel series must upgrade.
The updated 5.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/alpha/kernel/setup.c | 3 arch/riscv/include/asm/mmio.h | 16 arch/x86/entry/vdso/vma.c | 4 arch/x86/include/asm/processor.h | 2 arch/x86/kernel/cpu/amd.c | 1 arch/x86/kernel/cpu/common.c | 5 arch/x86/kernel/vmlinux.lds.S | 12 arch/x86/kvm/x86.c | 2 arch/x86/mm/pkeys.c | 6 drivers/android/binder.c | 1 drivers/android/binder_alloc.c | 6 drivers/android/binder_alloc.h | 1 drivers/dma/mcf-edma.c | 13 drivers/dma/pl330.c | 18 - drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.c | 7 drivers/gpu/drm/drm_gem_shmem_helper.c | 6 drivers/gpu/drm/nouveau/nouveau_connector.c | 2 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h | 1 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c | 4 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk110.c | 10 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk110b.c | 1 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk208.c | 1 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c | 1 drivers/hwmon/pmbus/bel-pfe.c | 16 drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 2 drivers/infiniband/hw/hfi1/chip.c | 1 drivers/isdn/mISDN/dsp.h | 2 drivers/isdn/mISDN/dsp_cmx.c | 2 drivers/isdn/mISDN/dsp_core.c | 2 drivers/mmc/host/moxart-mmc.c | 8 drivers/net/bonding/bond_main.c | 4 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 24 + drivers/net/ethernet/ibm/ibmvnic.c | 38 +- drivers/net/ethernet/mellanox/mlx5/core/sriov.c | 3 drivers/net/phy/at803x.c | 2 drivers/net/tun.c | 2 drivers/net/wireguard/allowedips.c | 8 drivers/net/wireguard/selftest/allowedips.c | 16 drivers/nvme/host/rdma.c | 3 drivers/nvme/host/tcp.c | 3 drivers/scsi/53c700.c | 2 drivers/scsi/qedf/qedf_main.c | 18 + drivers/scsi/qedi/qedi_main.c | 18 + drivers/scsi/raid_class.c | 1 drivers/scsi/scsi_proc.c | 30 - drivers/scsi/snic/snic_disc.c | 1 drivers/scsi/storvsc_drv.c | 4 drivers/usb/common/usb-conn-gpio.c | 6 drivers/usb/dwc3/gadget.c | 9 drivers/usb/storage/alauda.c | 12 fs/btrfs/extent-tree.c | 5 fs/btrfs/extent_io.c | 7 fs/nilfs2/inode.c | 8 fs/nilfs2/segment.c | 2 fs/nilfs2/the_nilfs.h | 2 include/linux/cpu.h | 2 include/net/cfg80211.h | 3 include/net/netfilter/nf_tables.h | 31 + io_uring/io_uring.c | 6 kernel/bpf/verifier.c | 175 +++++++++- net/dccp/output.c | 2 net/dccp/proto.c | 10 net/ipv4/ip_tunnel_core.c | 2 net/ipv6/ndisc.c | 3 net/netfilter/nf_tables_api.c | 171 ++++++--- net/netfilter/nft_flow_offload.c | 6 net/netfilter/nft_immediate.c | 8 net/netfilter/nft_objref.c | 8 net/packet/af_packet.c | 16 net/sched/sch_netem.c | 59 +-- tools/testing/radix-tree/regression1.c | 2 tools/testing/selftests/bpf/prog_tests/align.c | 36 +- tools/testing/selftests/bpf/prog_tests/sk_assign.c | 25 + tools/testing/selftests/bpf/progs/connect4_prog.c | 2 tools/testing/selftests/bpf/progs/test_sk_assign.c | 11 tools/testing/selftests/bpf/progs/test_sk_assign_libbpf.c | 3 tools/testing/selftests/net/forwarding/ethtool.sh | 2 tools/testing/selftests/net/forwarding/ethtool_extended_state.sh | 2 tools/testing/selftests/net/forwarding/lib.sh | 16 tools/testing/selftests/net/forwarding/settings | 1 tools/testing/selftests/net/forwarding/tc_flower.sh | 8 tools/testing/selftests/rseq/Makefile | 4 tools/testing/selftests/rseq/rseq.c | 2 84 files changed, 720 insertions(+), 282 deletions(-)
Alan Stern (1):
usb-storage: alauda: Fix uninit-value in alauda_check_media()
Aleksa Sarai (1):
io_uring: correct check for O_TMPFILE
Alexandra Diupina (1):
scsi: 53c700: Check that command slot is not NULL
Andrea Parri (1):
riscv,mmio: Fix readX()-to-delay() ordering
Andrew Kanner (1):
drivers: net: prevent tun_build_skb() to exceed the packet size limit
Andrii Nakryiko (4):
bpf: allow precision tracking for programs with subprogs
bpf: stop setting precise in current state
bpf: aggressively forget precise markings during state checkpointing selftests/bpf: make test_align selftest more robust
Arnd Bergmann (2):
x86/speculation: Add cpu_show_gds() prototype
x86: Move gds_ucode_mitigated() declaration to header
Boris Brezillon (1):
drm/shmem-helper: Reset vma->vm_ops before calling dma_buf_mmap()
Christoph Hellwig (1):
btrfs: don't stop integrity writeback too early
Christophe JAILLET (1):
dmaengine: mcf-edma: Fix a potential un-allocated memory access
Colin Ian King (1):
radix tree test suite: fix incorrect allocation size for pthreads
Cristian Ciocaltea (1):
x86/cpu/amd: Enable Zenbleed fix for AMD Custom APU 0405
Daniel Jurgens (1):
net/mlx5: Allow 0 for total host VFs
Douglas Miller (1):
IB/hfi1: Fix possible panic during hotplug remove
Elson Roy Serrao (1):
usb: dwc3: Properly handle processing of pending events
Eric Dumazet (3):
net/packet: annotate data-races around tp->status
dccp: fix data-race around dp->dccps_mss_cache
sch_netem: fix issues in netem_change() vs get_dist_table()Felix Fietkau (1):
wifi: cfg80211: fix sband iftype data lookup for AP_VLAN
Florian Westphal (1):
tunnels: fix kasan splat when generating ipv4 pmtu error
Greg Kroah-Hartman (1):
Linux 5.10.191
Ido Schimmel (6):
selftests: forwarding: Add a helper to skip test when using veth pairs
selftests: forwarding: ethtool: Skip when using veth pairs
selftests: forwarding: ethtool_extended_state: Skip when using veth pairs
selftests: forwarding: Skip test when no interfaces are specified
selftests: forwarding: Switch off timeout
selftests: forwarding: tc_flower: Relax success criterion
Ilpo Järvinen (1):
dmaengine: pl330: Return DMA_PAUSED when transaction is paused
Ilya Leoshkevich (1):
selftests/bpf: Fix sk_assign on s390x
Jason A. Donenfeld (1):
wireguard: allowedips: expand maximum node depth
Jie Wang (2):
net: hns3: refactor hclge_mac_link_status_wait for interface reuse
net: hns3: add wait until mac link down
Josef Bacik (1):
btrfs: set cache_block_group_error if we find an error
Karol Herbst (2):
drm/nouveau/gr: enable memory loads on helper invocation on all channels drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes
Kirill A. Shutemov (1):
x86/mm: Fix VDSO and VVAR placement on 5-level paging machines
Li Yang (1):
net: phy: at803x: remove set/get wol callbacks for AR8032
Maciej Żenczykowski (1):
ipv6: adjust ndisc_is_useropt() to also return true for PIO
Mark Brown (1):
selftests/rseq: Fix build with undefined __weak
Masahiro Yamada (1):
alpha: remove __init annotation from exported page_is_ram()
Melissa Wen (1):
drm/amd/display: check attr flag before set cursor degamma on DCN3+
Michael Kelley (1):
scsi: storvsc: Fix handling of virtual Fibre Channel timeouts
Ming Lei (2):
nvme-tcp: fix potential unbalanced freeze & unfreeze
nvme-rdma: fix potential unbalanced freeze & unfreeze
Nathan Chancellor (1):
mISDN: Update parameter type of dsp_cmx_send()
Nick Child (3):
ibmvnic: Enforce stronger sanity checks on login response
ibmvnic: Unmap DMA login rsp buffer on send login fail
ibmvnic: Handle DMA unmapping of login buffs in release functions
Nick Desaulniers (1):
x86/srso: Fix build breakage with the LLVM linker
Nilesh Javali (2):
scsi: qedi: Fix firmware halt over suspend and resume
scsi: qedf: Fix firmware halt over suspend and resume
Pablo Neira Ayuso (1):
netfilter: nf_tables: report use refcount overflow
Prashanth K (1):
usb: common: usb-conn-gpio: Prevent bailing out if initial role is none
Qi Zheng (1):
binder: fix memory leak in binder_init()
Ryusuke Konishi (1):
nilfs2: fix use-after-free of nilfs_root in dirtying inodes via iput
Sergei Antonov (1):
mmc: moxart: read scr register without changing byte order
Tao Ren (1):
hwmon: (pmbus/bel-pfe) Enable PMBUS_SKIP_STATUS_CHECK for pfe1100
Thomas Gleixner (1):
x86/pkeys: Revert a5eff7259790 ("x86/pkeys: Add PKRU value to init_fpstate")Tony Battersby (1):
scsi: core: Fix legacy /proc parsing buffer overflow
Yiyuan Guo (1):
iio: cros_ec: Fix the allocation size for cros_ec_command
Yonghong Song (1):
selftests/bpf: Workaround verification failure for fexit_bpf2bpf/func_replace_return_code
Zhu Wang (2):
scsi: snic: Fix possible memory leak if device_add() fails
scsi: core: Fix possible memory leak if device_add() fails
Ziyang Xuan (1):
bonding: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 10 -SUBLEVEL = 190 +SUBLEVEL = 191 EXTRAVERSION = NAME = Dare mighty things
arch/alpha/kernel/setup.c +1 -2
@@ -394,8 +394,7 @@ setup_memory(void *kernel_end)extern void setup_memory (void *);#endif /* !CONFIG_DISCONTIGMEM */ -int __init -page_is_ram (unsigned long pfn) +int page_is_ram (unsigned long pfn) {struct memclust_struct * cluster;struct memdesc_struct * memdesc;
arch/riscv/include/asm/mmio.h +8 -8
@@ -101,9 +101,9 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)* Relaxed I/O memory access primitives. These follow the Device memory * ordering rules but do not guarantee any ordering relative to Normal memory * accesses. These are defined to order the indicated access (either a read or -* write) with all other I/O memory accesses. Since the platform specification -* defines that all I/O regions are strongly ordered on channel 2, no explicit -* fences are required to enforce this ordering. +* write) with all other I/O memory accesses to the same peripheral. Since the +* platform specification defines that all I/O regions are strongly ordered on +* channel 0, no explicit fences are required to enforce this ordering. */ /* FIXME: These are now the same as asm-generic */ #define __io_rbr () do {} while (0)
@@ -125,14 +125,14 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)#endif /* -* I/O memory access primitives. Reads are ordered relative to any -* following Normal memory access. Writes are ordered relative to any prior -* Normal memory access. The memory barriers here are necessary as RISC-V +* I/O memory access primitives. Reads are ordered relative to any following +* Normal memory read and delay() loop. Writes are ordered relative to any +* prior Normal memory write. The memory barriers here are necessary as RISC-V * doesn't define any ordering between the memory space and the I/O space. */ #define __io_br () do {} while (0) -#define __io_ar (v) __asm__ __volatile__ ("fence i,r" : : : "memory") -#define __io_bw () __asm__ __volatile__ ("fence w,o" : : : "memory") +#define __io_ar (v) ({ __asm__ __volatile__ ("fence i,ir" : : : "memory"); }) +#define __io_bw () ({ __asm__ __volatile__ ("fence w,o" : : : "memory"); })#define __io_aw () mmiowb_set_pending()#define readb (c) ({ u8 __v; __io_br(); __v = readb_cpu(c); __io_ar(__v); __v; })
arch/x86/entry/vdso/vma.c +2 -2
@@ -339,8 +339,8 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)/* Round the lowest possible end address up to a PMD boundary. */ end = (start + len +PMD_SIZE -1 ) &PMD_MASK ; -if (end >=TASK_SIZE_MAX ) - end =TASK_SIZE_MAX ; +if (end >=DEFAULT_MAP_WINDOW ) + end =DEFAULT_MAP_WINDOW ; end -= len;if (end > start) {
arch/x86/include/asm/processor.h +2 -0
@@ -864,4 +864,6 @@ enum mds_mitigations { MDS_MITIGATION_VMWERV, }; +extern bool gds_ucode_mitigated (void ); +#endif /* _ASM_X86_PROCESSOR_H */
arch/x86/kernel/cpu/amd.c +1 -0
@@ -74,6 +74,7 @@ static const int amd_erratum_1054[] =static const int amd_zenbleed[] =AMD_LEGACY_ERRATUM (AMD_MODEL_RANGE (0x17 ,0x30 ,0x0 ,0x4f ,0xf ),AMD_MODEL_RANGE (0x17 ,0x60 ,0x0 ,0x7f ,0xf ), +AMD_MODEL_RANGE (0x17 ,0x90 ,0x0 ,0x91 ,0xf ),AMD_MODEL_RANGE (0x17 ,0xa0 ,0x0 ,0xaf ,0xf )); static const int amd_div0[] =
arch/x86/kernel/cpu/common.c +0 -5
@@ -472,8 +472,6 @@ static bool pku_disabled; static __always_inline void setup_pku(struct cpuinfo_x86 *c) { -struct pkru_state *pk; -/* check the boot processor, plus compile options for PKU: */ if (!cpu_feature_enabled (X86_FEATURE_PKU ))return ;
@@ -484,9 +482,6 @@ static __always_inline void setup_pku(struct cpuinfo_x86 *c)return ;cr4_set_bits (X86_CR4_PKE ); - pk =get_xsave_addr (&init_fpstate.xsave,XFEATURE_PKRU ); -if (pk) - pk->pkru = init_pkru_value;/* * Seting X86_CR4_PKE will cause the X86_FEATURE_OSPKE * cpuid bit to be set. We need to ensure that we
arch/x86/kernel/vmlinux.lds.S +9 -3
@@ -524,11 +524,17 @@ INIT_PER_CPU(irq_stack_backing_store); #ifdef CONFIG_CPU_SRSO /* - * GNU ld cannot do XOR so do: (A | B) - (A & B) in order to compute the XOR + * GNU ld cannot do XOR until 2.41. + * https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f6f78318fca803c4907fb8d7f6ded8295f1947b1 + * + * LLVM lld cannot do XOR until lld-17. + * https://github.com/llvm/llvm-project/commit/fae96104d4378166cbe5c875ef8ed808a356f3fb + * + * Instead do: (A | B) - (A & B) in order to compute the XOR * of the two function addresses: */ -. = ASSERT(((srso_untrain_ret_alias | srso_safe_ret_alias) - - (srso_untrain_ret_alias & srso_safe_ret_alias)) == ((1 << 2) | (1 << 8) | (1 << 14) | (1 << 20)), +. = ASSERT(((ABSOLUTE(srso_untrain_ret_alias) | srso_safe_ret_alias) - + (ABSOLUTE(srso_untrain_ret_alias) & srso_safe_ret_alias)) == ((1 << 2) | (1 << 8) | (1 << 14) | (1 << 20)), "SRSO function pair won't alias"); #endif
arch/x86/kvm/x86.c +0 -2
@@ -255,8 +255,6 @@ static struct kmem_cache *x86_fpu_cache;static struct kmem_cache *x86_emulator_cache; -extern bool gds_ucode_mitigated (void ); -/* * When called, it means the previous get/set msr reached an invalid msr. * Return true if we want to ignore/silent this failed msr access.
arch/x86/mm/pkeys.c +0 -6
@@ -10,7 +10,6 @@#include <asm/cpufeature.h> /* boot_cpu_has, ... */ #include <asm/mmu_context.h> /* vma_pkey() */ -#include <asm/fpu/internal.h> /* init_fpstate */ int __execute_only_pkey (struct mm_struct *mm) {
@@ -154,7 +153,6 @@ static ssize_t init_pkru_read_file(struct file *file, char __user *user_buf,static ssize_t init_pkru_write_file (struct file *file,const char __user *user_buf,size_t count,loff_t *ppos) { -struct pkru_state *pk;char buf[32 ];ssize_t len;u32 new_init_pkru;
@@ -177,10 +175,6 @@ static ssize_t init_pkru_write_file(struct file *file,return -EINVAL ;WRITE_ONCE (init_pkru_value, new_init_pkru); - pk =get_xsave_addr (&init_fpstate.xsave,XFEATURE_PKRU ); -if (!pk) -return -EINVAL ; - pk->pkru = new_init_pkru;return count; }
drivers/android/binder.c +1 -0
@@ -6541,6 +6541,7 @@ static int __init binder_init(void) err_alloc_device_names_failed:debugfs_remove_recursive (binder_debugfs_dir_entry_root); +binder_alloc_shrinker_exit ();return ret; }
drivers/android/binder_alloc.c +6 -0
@@ -1086,6 +1086,12 @@ int binder_alloc_shrinker_init(void)return ret; } +void binder_alloc_shrinker_exit (void ) +{ +unregister_shrinker (&binder_shrinker); +list_lru_destroy (&binder_alloc_lru); +} +/** * check_buffer() - verify that buffer/offset is safe to access * @alloc: binder_alloc for this proc
drivers/android/binder_alloc.h +1 -0
@@ -125,6 +125,7 @@ extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc, int pid);extern void binder_alloc_init (struct binder_alloc *alloc);extern int binder_alloc_shrinker_init (void ); +extern void binder_alloc_shrinker_exit (void );extern void binder_alloc_vma_close (struct binder_alloc *alloc);extern struct binder_buffer * binder_alloc_prepare_to_free(struct binder_alloc *alloc,
drivers/dma/mcf-edma.c +7 -6
@@ -191,7 +191,13 @@ static int mcf_edma_probe(struct platform_device *pdev)return -EINVAL ; } - chans = pdata->dma_channels; +if (!pdata->dma_channels) { +dev_info (&pdev->dev,"setting default channel number to 64" ); + chans =64 ; + }else { + chans = pdata->dma_channels; + } + len =sizeof (*mcf_edma) +sizeof (*mcf_chan) * chans; mcf_edma =devm_kzalloc (&pdev->dev, len,GFP_KERNEL );if (!mcf_edma)
@@ -203,11 +209,6 @@ static int mcf_edma_probe(struct platform_device *pdev) mcf_edma->drvdata = &mcf_data; mcf_edma->big_endian =1 ; -if (!mcf_edma->n_chans) { -dev_info (&pdev->dev,"setting default channel number to 64" ); - mcf_edma->n_chans =64 ; - } -mutex_init (&mcf_edma->fsl_edma_mutex); res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );
drivers/dma/pl330.c +16 -2
@@ -403,6 +403,12 @@ enum desc_status {* of a channel can be BUSY at any time. */ BUSY , +/* +* Pause was called while descriptor was BUSY. Due to hardware +* limitations, only termination is possible for descriptors +* that have been paused. +*/ + PAUSED,/* * Sitting on the channel work_list but xfer done * by PL330 core
@@ -2043,7 +2049,7 @@ static inline void fill_queue(struct dma_pl330_chan *pch)list_for_each_entry (desc, &pch->work_list, node) {/* If already submitted */ -if (desc->status ==BUSY ) +if (desc->status ==BUSY || desc->status ==PAUSED )continue ; ret =pl330_submit_req (pch->thread, desc);
@@ -2328,6 +2334,7 @@ static int pl330_pause(struct dma_chan *chan) {struct dma_pl330_chan *pch =to_pchan (chan);struct pl330_dmac *pl330 = pch->dmac; +struct dma_pl330_desc *desc;unsigned long flags;pm_runtime_get_sync (pl330->ddma.dev);
@@ -2337,6 +2344,10 @@ static int pl330_pause(struct dma_chan *chan)_stop (pch->thread);spin_unlock (&pl330->lock); +list_for_each_entry (desc, &pch->work_list, node) { +if (desc->status ==BUSY ) + desc->status =PAUSED ; + }spin_unlock_irqrestore (&pch->lock, flags);pm_runtime_mark_last_busy (pl330->ddma.dev);pm_runtime_put_autosuspend (pl330->ddma.dev);
@@ -2427,7 +2438,7 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,else if (running && desc == running) transferred =pl330_get_current_xferred_count (pch, desc); -else if (desc->status ==BUSY ) +else if (desc->status ==BUSY || desc->status ==PAUSED )/* * Busy but not running means either just enqueued, * or finished and not yet marked done
@@ -2444,6 +2455,9 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,case DONE : ret =DMA_COMPLETE ;break ; +case PAUSED : + ret =DMA_PAUSED ; +break ;case PREP :case BUSY : ret =DMA_IN_PROGRESS ;
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.c +5 -2
@@ -354,8 +354,11 @@ void dpp3_set_cursor_attributes(int cur_rom_en =0 ;if (color_format ==CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA || - color_format ==CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA ) - cur_rom_en =1 ; + color_format ==CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA ) { +if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) { + cur_rom_en =1 ; + } + } REG_UPDATE_3(CURSOR0_CONTROL, CUR0_MODE, color_format,
drivers/gpu/drm/drm_gem_shmem_helper.c +6 -0
@@ -614,7 +614,13 @@ int drm_gem_shmem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)int ret;if (obj->import_attach) { +/* Reset both vm_ops and vm_private_data, so we don't end up with +* vm_ops pointing to our implementation if the dma-buf backend +* doesn't set those fields. +*/ vma->vm_private_data =NULL ; + vma->vm_ops =NULL ; + ret =dma_buf_mmap (obj->dma_buf, vma,0 );/* Drop the reference drm_gem_mmap_obj() acquired.*/
drivers/gpu/drm/nouveau/nouveau_connector.c +1 -1
@@ -947,7 +947,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)/* Determine display colour depth for everything except LVDS now, * DP requires this before mode_valid() is called. */ -if (connector->connector_type !=DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode) +if (connector->connector_type !=DRM_MODE_CONNECTOR_LVDS )nouveau_connector_detect_depth (connector);/* Find the native mode if this is a digital panel, if we didn't
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h +1 -0
@@ -123,6 +123,7 @@ void gk104_grctx_generate_r418800(struct gf100_gr *);extern const struct gf100_grctx_func gk110_grctx;void gk110_grctx_generate_r419eb0 (struct gf100_gr *); +void gk110_grctx_generate_r419f78 (struct gf100_gr *);extern const struct gf100_grctx_func gk110b_grctx;extern const struct gf100_grctx_func gk208_grctx;
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c +3 -1
@@ -916,7 +916,9 @@ static void gk104_grctx_generate_r419f78(struct gf100_gr *gr) {struct nvkm_device *device = gr->base.engine.subdev.device; -nvkm_mask (device,0x419f78 ,0x00000001 ,0x00000000 ); + +/* bit 3 set disables loads in fp helper invocations, we need it enabled */ +nvkm_mask (device,0x419f78 ,0x00000009 ,0x00000000 ); }void
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk110.c +10 -0
@@ -820,6 +820,15 @@ gk110_grctx_generate_r419eb0(struct gf100_gr *gr)nvkm_mask (device,0x419eb0 ,0x00001000 ,0x00001000 ); } +void +gk110_grctx_generate_r419f78 (struct gf100_gr *gr) +{ +struct nvkm_device *device = gr->base.engine.subdev.device; + +/* bit 3 set disables loads in fp helper invocations, we need it enabled */ +nvkm_mask (device,0x419f78 ,0x00000008 ,0x00000000 ); +} +const struct gf100_grctx_func gk110_grctx = { .main = gf100_grctx_generate_main,
@@ -852,4 +861,5 @@ gk110_grctx = { .gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr, .r418800 = gk104_grctx_generate_r418800, .r419eb0 = gk110_grctx_generate_r419eb0, + .r419f78 = gk110_grctx_generate_r419f78, };
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk110b.c +1 -0
@@ -101,4 +101,5 @@ gk110b_grctx = { .gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr, .r418800 = gk104_grctx_generate_r418800, .r419eb0 = gk110_grctx_generate_r419eb0, + .r419f78 = gk110_grctx_generate_r419f78, };
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk208.c +1 -0
@@ -566,4 +566,5 @@ gk208_grctx = { .dist_skip_table = gf117_grctx_generate_dist_skip_table, .gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr, .r418800 = gk104_grctx_generate_r418800, + .r419f78 = gk110_grctx_generate_r419f78, };
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c +1 -0
@@ -991,4 +991,5 @@ gm107_grctx = { .r406500 = gm107_grctx_generate_r406500, .gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr, .r419e00 = gm107_grctx_generate_r419e00, + .r419f78 = gk110_grctx_generate_r419f78, };
drivers/hwmon/pmbus/bel-pfe.c +8 -8
@@ -17,12 +17,13 @@enum chips {pfe1100, pfe3000};/* -* Disable status check for pfe3000 devices, because some devices report -* communication error (invalid command) for VOUT_MODE command (0x20) -* although correct VOUT_MODE (0x16) is returned: it leads to incorrect -* exponent in linear mode. +* Disable status check because some devices report communication error +* (invalid command) for VOUT_MODE command (0x20) although the correct +* VOUT_MODE (0x16) is returned: it leads to incorrect exponent in linear +* mode. +* This affects both pfe3000 and pfe1100. */ -static struct pmbus_platform_data pfe3000_plat_data = { +static struct pmbus_platform_data pfe_plat_data = { .flags =PMBUS_SKIP_STATUS_CHECK , };
@@ -94,16 +95,15 @@ static int pfe_pmbus_probe(struct i2c_client *client)int model; model = (int )i2c_match_id (pfe_device_id, client)->driver_data; + client->dev.platform_data = &pfe_plat_data;/* * PFE3000-12-069RA devices may not stay in page 0 during device * probe which leads to probe failure (read status word failed). * So let's set the device to page 0 at the beginning. */ -if (model == pfe3000) { - client->dev.platform_data = &pfe3000_plat_data; +if (model == pfe3000)i2c_smbus_write_byte_data (client,PMBUS_PAGE ,0 ); - }return pmbus_do_probe (client, &pfe_driver_info[model]); }
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c +1 -1
@@ -263,7 +263,7 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,platform_set_drvdata (pdev, indio_dev); state->ec = ec->ec_dev; - state->msg =devm_kzalloc (&pdev->dev, + state->msg =devm_kzalloc (&pdev->dev,sizeof (*state->msg) +max ((u16 )sizeof (struct ec_params_motion_sense ), state->ec->max_response),GFP_KERNEL );if (!state->msg)
drivers/infiniband/hw/hfi1/chip.c +1 -0
@@ -12348,6 +12348,7 @@ static void free_cntrs(struct hfi1_devdata *dd)if (dd->synth_stats_timer.function)del_timer_sync (&dd->synth_stats_timer); +cancel_work_sync (&dd->update_cntr_work); ppd = (struct hfi1_pportdata *)(dd +1 );for (i =0 ; i < dd->num_pports; i++, ppd++) {kfree (ppd->cntrs);
drivers/isdn/mISDN/dsp.h +1 -1
@@ -247,7 +247,7 @@ extern void dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp);extern int dsp_cmx_conf (struct dsp *dsp,u32 conf_id);extern void dsp_cmx_receive (struct dsp *dsp,struct sk_buff *skb);extern void dsp_cmx_hdlc (struct dsp *dsp,struct sk_buff *skb); -extern void dsp_cmx_send (void *arg); +extern void dsp_cmx_send (struct timer_list *arg);extern void dsp_cmx_transmit (struct dsp *dsp,struct sk_buff *skb);extern int dsp_cmx_del_conf_member (struct dsp *dsp);extern int dsp_cmx_del_conf (struct dsp_conf *conf);
drivers/isdn/mISDN/dsp_cmx.c +1 -1
@@ -1625,7 +1625,7 @@ static u16 dsp_count; /* last sample count */static int dsp_count_valid;/* if we have last sample count */ void -dsp_cmx_send (void *arg) +dsp_cmx_send (struct timer_list *arg) {struct dsp_conf *conf;struct dsp_conf_member *member;
drivers/isdn/mISDN/dsp_core.c +1 -1
@@ -1200,7 +1200,7 @@ static int __init dsp_init(void) }/* set sample timer */ -timer_setup (&dsp_spl_tl, (void *)dsp_cmx_send,0 ); +timer_setup (&dsp_spl_tl, dsp_cmx_send,0 ); dsp_spl_tl.expires = jiffies + dsp_tics; dsp_spl_jiffies = dsp_spl_tl.expires;add_timer (&dsp_spl_tl);
drivers/mmc/host/moxart-mmc.c +1 -7
@@ -339,13 +339,7 @@ static void moxart_transfer_pio(struct moxart_host *host)return ; }for (len =0 ; len < remain && len < host->fifo_width;) { -/* SCR data must be read in big endian. */ -if (data->mrq->cmd->opcode ==SD_APP_SEND_SCR ) - *sgp =ioread32be (host->base + -REG_DATA_WINDOW ); -else - *sgp =ioread32 (host->base + -REG_DATA_WINDOW ); + *sgp =ioread32 (host->base +REG_DATA_WINDOW ); sgp++; len +=4 ; }
drivers/net/bonding/bond_main.c +3 -1
@@ -4920,7 +4920,9 @@ void bond_setup(struct net_device *bond_dev) bond_dev->hw_features =BOND_VLAN_FEATURES |NETIF_F_HW_VLAN_CTAG_RX | -NETIF_F_HW_VLAN_CTAG_FILTER ; +NETIF_F_HW_VLAN_CTAG_FILTER | +NETIF_F_HW_VLAN_STAG_RX | +NETIF_F_HW_VLAN_STAG_FILTER ; bond_dev->hw_features |=NETIF_F_GSO_ENCAP_ALL |NETIF_F_GSO_UDP_L4 ;#ifdef CONFIG_XFRM_OFFLOAD
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +18 -6
@@ -71,6 +71,8 @@ static int hclge_set_default_loopback(struct hclge_dev *hdev);static void hclge_sync_mac_table (struct hclge_dev *hdev);static void hclge_restore_hw_table (struct hclge_dev *hdev);static void hclge_sync_promisc_mode (struct hclge_dev *hdev); +static int hclge_mac_link_status_wait (struct hclge_dev *hdev,int link_ret, +int wait_cnt);static struct hnae3_ae_algo ae_algo;
@@ -6558,6 +6560,8 @@ static void hclge_enable_fd(struct hnae3_handle *handle, bool enable)static void hclge_cfg_mac_mode (struct hclge_dev *hdev,bool enable) { +#define HCLGE_LINK_STATUS_WAIT_CNT 3 +struct hclge_desc desc;struct hclge_config_mac_mode_cmd *req = (struct hclge_config_mac_mode_cmd *)desc.data;
@@ -6582,9 +6586,15 @@ static void hclge_cfg_mac_mode(struct hclge_dev *hdev, bool enable) req->txrx_pad_fcs_loop_en =cpu_to_le32 (loop_en); ret =hclge_cmd_send (&hdev->hw, &desc,1 ); -if (ret) +if (ret) {dev_err (&hdev->pdev->dev,"mac enable fail, ret =%d.\n" , ret); +return ; + } + +if (!enable) +hclge_mac_link_status_wait (hdev,HCLGE_LINK_STATUS_DOWN , +HCLGE_LINK_STATUS_WAIT_CNT ); } static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid,
@@ -6647,10 +6657,9 @@ static void hclge_phy_link_status_wait(struct hclge_dev *hdev, }while (++i <HCLGE_PHY_LINK_STATUS_NUM ); } -static int hclge_mac_link_status_wait (struct hclge_dev *hdev,int link_ret) +static int hclge_mac_link_status_wait (struct hclge_dev *hdev,int link_ret, +int wait_cnt) { -#define HCLGE_MAC_LINK_STATUS_NUM 100 -int link_status;int i =0 ;int ret;
@@ -6663,13 +6672,15 @@ static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret)return 0 ;msleep (HCLGE_LINK_STATUS_MS ); - }while (++i <HCLGE_MAC_LINK_STATUS_NUM ); + }while (++i < wait_cnt);return -EBUSY ; }static int hclge_mac_phy_link_status_wait (struct hclge_dev *hdev,bool en,bool is_phy) { +#define HCLGE_MAC_LINK_STATUS_NUM 100 +int link_ret; link_ret = en ?HCLGE_LINK_STATUS_UP :HCLGE_LINK_STATUS_DOWN ;
@@ -6677,7 +6688,8 @@ static int hclge_mac_phy_link_status_wait(struct hclge_dev *hdev, bool en,if (is_phy)hclge_phy_link_status_wait (hdev, link_ret); -return hclge_mac_link_status_wait (hdev, link_ret); +return hclge_mac_link_status_wait (hdev, link_ret, +HCLGE_MAC_LINK_STATUS_NUM ); }static int hclge_set_app_loopback (struct hclge_dev *hdev,bool en)
drivers/net/ethernet/ibm/ibmvnic.c +32 -6
@@ -929,12 +929,22 @@ static int ibmvnic_login(struct net_device *netdev)static void release_login_buffer (struct ibmvnic_adapter *adapter) { +if (!adapter->login_buf) +return ; + +dma_unmap_single (&adapter->vdev->dev, adapter->login_buf_token, + adapter->login_buf_sz,DMA_TO_DEVICE );kfree (adapter->login_buf); adapter->login_buf =NULL ; }static void release_login_rsp_buffer (struct ibmvnic_adapter *adapter) { +if (!adapter->login_rsp_buf) +return ; + +dma_unmap_single (&adapter->vdev->dev, adapter->login_rsp_buf_token, + adapter->login_rsp_buf_sz,DMA_FROM_DEVICE );kfree (adapter->login_rsp_buf); adapter->login_rsp_buf =NULL ; }
@@ -3861,11 +3871,14 @@ static int send_login(struct ibmvnic_adapter *adapter)if (rc) { adapter->login_pending = false;netdev_err (adapter->netdev,"Failed to send login, rc=%d\n" , rc); - goto buf_rsp_map_failed; + goto buf_send_failed; }return 0 ; +buf_send_failed: +dma_unmap_single (dev, rsp_buffer_token, rsp_buffer_size, +DMA_FROM_DEVICE ); buf_rsp_map_failed:kfree (login_rsp_buffer); adapter->login_rsp_buf =NULL ;
@@ -4430,6 +4443,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,int num_tx_pools;int num_rx_pools;u64 *size_array; +u32 rsp_len;int i;/* CHECK: Test/set of login_pending does not need to be atomic
@@ -4441,11 +4455,6 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq, } adapter->login_pending = false; -dma_unmap_single (dev, adapter->login_buf_token, adapter->login_buf_sz, -DMA_TO_DEVICE ); -dma_unmap_single (dev, adapter->login_rsp_buf_token, - adapter->login_rsp_buf_sz,DMA_FROM_DEVICE ); -/* If the number of queues requested can't be allocated by the * server, the login response will return with code 1. We will need * to resend the login buffer with fewer queues requested.
@@ -4481,6 +4490,23 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,ibmvnic_reset (adapter,VNIC_RESET_FATAL );return -EIO ; } + + rsp_len =be32_to_cpu (login_rsp->len); +if (be32_to_cpu (login->login_rsp_len) < rsp_len || + rsp_len <=be32_to_cpu (login_rsp->off_txsubm_subcrqs) || + rsp_len <=be32_to_cpu (login_rsp->off_rxadd_subcrqs) || + rsp_len <=be32_to_cpu (login_rsp->off_rxadd_buff_size) || + rsp_len <=be32_to_cpu (login_rsp->off_supp_tx_desc)) { +/* This can happen if a login request times out and there are +* 2 outstanding login requests sent, the LOGIN_RSP crq +* could have been for the older login request. So we are +* parsing the newer response buffer which may be incomplete +*/ +dev_err (dev,"FATAL: Login rsp offsets/lengths invalid\n" ); +ibmvnic_reset (adapter,VNIC_RESET_FATAL ); +return -EIO ; + } + size_array = (u64 *)((u8 *)(adapter->login_rsp_buf) +be32_to_cpu (adapter->login_rsp_buf->off_rxadd_buff_size));/* variable buffer sizes are not supported, so just read the
drivers/net/ethernet/mellanox/mlx5/core/sriov.c +1 -2
@@ -211,8 +211,7 @@ static u16 mlx5_get_max_vfs(struct mlx5_core_dev *dev) host_total_vfs =MLX5_GET (query_esw_functions_out, out, host_params_context.host_total_vfs);kvfree (out); -if (host_total_vfs) -return host_total_vfs; +return host_total_vfs; } done:
drivers/net/phy/at803x.c +0 -2
@@ -1115,8 +1115,6 @@ static struct phy_driver at803x_driver[] = { .flags = PHY_POLL_CABLE_TEST, .config_init = at803x_config_init, .link_change_notify = at803x_link_change_notify, - .set_wol = at803x_set_wol, - .get_wol = at803x_get_wol, .suspend = at803x_suspend, .resume = at803x_resume,/* PHY_BASIC_FEATURES */
drivers/net/tun.c +1 -1
@@ -1604,7 +1604,7 @@ static bool tun_can_build_skb(struct tun_struct *tun, struct tun_file *tfile,if (zerocopy)return false; -if (SKB_DATA_ALIGN (len +TUN_RX_PAD ) + +if (SKB_DATA_ALIGN (len +TUN_RX_PAD +XDP_PACKET_HEADROOM ) +SKB_DATA_ALIGN (sizeof (struct skb_shared_info )) >PAGE_SIZE )return false;
drivers/net/wireguard/allowedips.c +4 -4
@@ -6,7 +6,7 @@#include "allowedips.h" #include "peer.h" -enum {MAX_ALLOWEDIPS_BITS =128 }; +enum {MAX_ALLOWEDIPS_DEPTH =129 };static struct kmem_cache *node_cache;
@@ -42,7 +42,7 @@ static void push_rcu(struct allowedips_node **stack, struct allowedips_node __rcu *p, unsigned int *len) { if (rcu_access_pointer(p)) { - if (WARN_ON(IS_ENABLED(DEBUG) && *len >= MAX_ALLOWEDIPS_BITS)) + if (WARN_ON(IS_ENABLED(DEBUG) && *len >= MAX_ALLOWEDIPS_DEPTH)) return; stack[(*len)++] =rcu_dereference_raw (p); }
@@ -55,7 +55,7 @@ static void node_free_rcu(struct rcu_head *rcu)static void root_free_rcu (struct rcu_head *rcu) { -struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_BITS ] = { +struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_DEPTH ] = { container_of(rcu, struct allowedips_node, rcu) };unsigned int len =1 ;
@@ -68,7 +68,7 @@ static void root_free_rcu(struct rcu_head *rcu)static void root_remove_peer_lists (struct allowedips_node *root) { -struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_BITS ] = { root }; +struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_DEPTH ] = { root };unsigned int len =1 ;while (len >0 && (node = stack[--len])) {
drivers/net/wireguard/selftest/allowedips.c +10 -6
@@ -593,16 +593,20 @@ bool __init wg_allowedips_selftest(void)wg_allowedips_remove_by_peer (&t, a, &mutex);test_negative (4 , a,192 ,168 ,0 ,1 ); -/* These will hit the WARN_ON(len >= MAX_ALLOWEDIPS_BITS) in free_node +/* These will hit the WARN_ON(len >= MAX_ALLOWEDIPS_DEPTH) in free_node * if something goes wrong. */ -for (i =0 ; i <MAX_ALLOWEDIPS_BITS ; ++i) { - part =cpu_to_be64 (~(1LLU << (i %64 ))); -memset (&ip,0xff ,16 ); -memcpy ((u8 *)&ip + (i <64 ) *8 , &part,8 ); +for (i =0 ; i <64 ; ++i) { + part =cpu_to_be64 (~0LLU << i); +memset (&ip,0xff ,8 ); +memcpy ((u8 *)&ip +8 , &part,8 ); +wg_allowedips_insert_v6 (&t, &ip,128 , a, &mutex); +memcpy (&ip, &part,8 ); +memset ((u8 *)&ip +8 ,0 ,8 );wg_allowedips_insert_v6 (&t, &ip,128 , a, &mutex); } - +memset (&ip,0 ,16 ); +wg_allowedips_insert_v6 (&t, &ip,128 , a, &mutex);wg_allowedips_free (&t, &mutex);wg_allowedips_init (&t);
drivers/nvme/host/rdma.c +2 -1
@@ -989,6 +989,7 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new) goto out_cleanup_connect_q;if (!new) { +nvme_start_freeze (&ctrl->ctrl);nvme_start_queues (&ctrl->ctrl);if (!nvme_wait_freeze_timeout (&ctrl->ctrl,NVME_IO_TIMEOUT )) {/*
@@ -997,6 +998,7 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new)* to be safe. */ ret = -ENODEV ; +nvme_unfreeze (&ctrl->ctrl); goto out_wait_freeze_timed_out; } blk_mq_update_nr_hw_queues(ctrl->ctrl.tagset,
@@ -1042,7 +1044,6 @@ static void nvme_rdma_teardown_io_queues(struct nvme_rdma_ctrl *ctrl, bool remove) {if (ctrl->ctrl.queue_count >1 ) { -nvme_start_freeze (&ctrl->ctrl);nvme_stop_queues (&ctrl->ctrl);nvme_sync_io_queues (&ctrl->ctrl);nvme_rdma_stop_io_queues (ctrl);
drivers/nvme/host/tcp.c +2 -1
@@ -1859,6 +1859,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new) goto out_cleanup_connect_q;if (!new) { +nvme_start_freeze (ctrl);nvme_start_queues (ctrl);if (!nvme_wait_freeze_timeout (ctrl,NVME_IO_TIMEOUT )) {/*
@@ -1867,6 +1868,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)* to be safe. */ ret = -ENODEV ; +nvme_unfreeze (ctrl); goto out_wait_freeze_timed_out; } blk_mq_update_nr_hw_queues(ctrl->tagset,
@@ -1989,7 +1991,6 @@ static void nvme_tcp_teardown_io_queues(struct nvme_ctrl *ctrl,if (ctrl->queue_count <=1 )return ;blk_mq_quiesce_queue (ctrl->admin_q); -nvme_start_freeze (ctrl);nvme_stop_queues (ctrl);nvme_sync_io_queues (ctrl);nvme_tcp_stop_io_queues (ctrl);
drivers/scsi/53c700.c +1 -1
@@ -1600,7 +1600,7 @@ NCR_700_intr(int irq, void *dev_id)printk ("scsi%d (%d:%d) PHASE MISMATCH IN SEND MESSAGE %d remain, return %p[%04x], phase %s\n" , host->host_no, pun, lun, count, (void *)temp, temp - hostdata->pScript,sbcl_to_string (NCR_700_readb (host,SBCL_REG )));#endif resume_offset = hostdata->pScript + Ent_SendMessagePhaseMismatch; - }else if (dsp >=to32bit (&slot->pSG[0 ].ins) && + }else if (slot && dsp >=to32bit (&slot->pSG[0 ].ins) && dsp <=to32bit (&slot->pSG[NCR_700_SG_SEGMENTS ].ins)) {int data_transfer =NCR_700_readl (host,DBC_REG ) &0xffffff ;int SGcount = (dsp -to32bit (&slot->pSG[0 ].ins))/sizeof (struct NCR_700_SG_List );
drivers/scsi/qedf/qedf_main.c +18 -0
@@ -31,6 +31,7 @@ static void qedf_remove(struct pci_dev *pdev);static void qedf_shutdown (struct pci_dev *pdev);static void qedf_schedule_recovery_handler (void *dev);static void qedf_recovery_handler (struct work_struct *work); +static int qedf_suspend (struct pci_dev *pdev,pm_message_t state);/* * Driver module parameters.
@@ -3272,6 +3273,7 @@ static struct pci_driver qedf_pci_driver = { .probe = qedf_probe, .remove = qedf_remove, .shutdown = qedf_shutdown, + .suspend = qedf_suspend, };static int __qedf_probe (struct pci_dev *pdev,int mode)
@@ -3986,6 +3988,22 @@ static void qedf_shutdown(struct pci_dev *pdev)__qedf_remove (pdev,QEDF_MODE_NORMAL ); } +static int qedf_suspend (struct pci_dev *pdev,pm_message_t state) +{ +struct qedf_ctx *qedf; + +if (!pdev) { +QEDF_ERR (NULL ,"pdev is NULL.\n" ); +return -ENODEV ; + } + + qedf =pci_get_drvdata (pdev); + +QEDF_ERR (&qedf->dbg_ctx,"%s: Device does not support suspend operation\n" , __func__); + +return -EPERM ; +} +/* * Recovery handler code */
drivers/scsi/qedi/qedi_main.c +18 -0
@@ -69,6 +69,7 @@ static struct nvm_iscsi_block *qedi_get_nvram_block(struct qedi_ctx *qedi);static void qedi_recovery_handler (struct work_struct *work);static void qedi_schedule_hw_err_handler (void *dev,enum qed_hw_err_type err_type); +static int qedi_suspend (struct pci_dev *pdev,pm_message_t state);static int qedi_iscsi_event_cb (void *context,u8 fw_event_code,void *fw_handle) {
@@ -2517,6 +2518,22 @@ static void qedi_shutdown(struct pci_dev *pdev)__qedi_remove (pdev,QEDI_MODE_SHUTDOWN ); } +static int qedi_suspend (struct pci_dev *pdev,pm_message_t state) +{ +struct qedi_ctx *qedi; + +if (!pdev) { +QEDI_ERR (NULL ,"pdev is NULL.\n" ); +return -ENODEV ; + } + + qedi =pci_get_drvdata (pdev); + +QEDI_ERR (&qedi->dbg_ctx,"%s: Device does not support suspend operation\n" , __func__); + +return -EPERM ; +} +static int __qedi_probe (struct pci_dev *pdev,int mode) {struct qedi_ctx *qedi;
@@ -2875,6 +2892,7 @@ static struct pci_driver qedi_pci_driver = { .remove = qedi_remove, .shutdown = qedi_shutdown, .err_handler = &qedi_err_handler, + .suspend = qedi_suspend, };static int __init qedi_init (void )
drivers/scsi/raid_class.c +1 -0
@@ -248,6 +248,7 @@ int raid_component_add(struct raid_template *r,struct device *raid_dev,return 0 ; err_out: +put_device (&rc->dev);list_del (&rc->node); rd->component_count--;put_device (component_dev);
drivers/scsi/scsi_proc.c +17 -13
@@ -311,7 +311,7 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf, size_t length, loff_t *ppos) { int host, channel, id, lun; -char *buffer, *p; +char *buffer, *end, *p;int err;if (!buf || length >PAGE_SIZE )
@@ -326,10 +326,14 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf, goto out; err = -EINVAL ; -if (length <PAGE_SIZE ) - buffer[length] ='\0' ; -else if (buffer[PAGE_SIZE -1 ]) - goto out; +if (length <PAGE_SIZE ) { + end = buffer + length; + *end ='\0' ; + }else { + end = buffer +PAGE_SIZE -1 ; +if (*end) + goto out; + }/* * Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
@@ -338,10 +342,10 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf,if (!strncmp ("scsi add-single-device" , buffer,22 )) { p = buffer +23 ; - host =simple_strtoul (p, &p,0 ); - channel =simple_strtoul (p +1 , &p,0 ); - id =simple_strtoul (p +1 , &p,0 ); - lun =simple_strtoul (p +1 , &p,0 ); + host = (p < end) ?simple_strtoul (p, &p,0 ) :0 ; + channel = (p +1 < end) ?simple_strtoul (p +1 , &p,0 ) :0 ; + id = (p +1 < end) ?simple_strtoul (p +1 , &p,0 ) :0 ; + lun = (p +1 < end) ?simple_strtoul (p +1 , &p,0 ) :0 ; err =scsi_add_single_device (host, channel, id, lun);
@@ -352,10 +356,10 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf, }else if (!strncmp ("scsi remove-single-device" , buffer,25 )) { p = buffer +26 ; - host =simple_strtoul (p, &p,0 ); - channel =simple_strtoul (p +1 , &p,0 ); - id =simple_strtoul (p +1 , &p,0 ); - lun =simple_strtoul (p +1 , &p,0 ); + host = (p < end) ?simple_strtoul (p, &p,0 ) :0 ; + channel = (p +1 < end) ?simple_strtoul (p +1 , &p,0 ) :0 ; + id = (p +1 < end) ?simple_strtoul (p +1 , &p,0 ) :0 ; + lun = (p +1 < end) ?simple_strtoul (p +1 , &p,0 ) :0 ; err =scsi_remove_single_device (host, channel, id, lun); }
drivers/scsi/snic/snic_disc.c +1 -0
@@ -317,6 +317,7 @@ snic_tgt_create(struct snic *snic, struct snic_tgt_id *tgtid)"Snic Tgt: device_add, with err = %d\n" , ret); +put_device (&tgt->dev);put_device (&snic->shost->shost_gendev);spin_lock_irqsave (snic->shost->host_lock, flags);list_del (&tgt->list);
drivers/scsi/storvsc_drv.c +0 -4
@@ -1641,10 +1641,6 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)*/ static enum blk_eh_timer_return storvsc_eh_timed_out (struct scsi_cmnd *scmnd) { -#if IS_ENABLED (CONFIG_SCSI_FC_ATTRS ) -if (scmnd->device->host->transportt == fc_transport_template) -return fc_eh_timed_out (scmnd); -#endif return BLK_EH_RESET_TIMER ; }
drivers/usb/common/usb-conn-gpio.c +5 -1
@@ -42,6 +42,7 @@ struct usb_conn_info {struct power_supply_desc desc;struct power_supply *charger; +bool initial_detection; };/*
@@ -86,11 +87,13 @@ static void usb_conn_detect_cable(struct work_struct *work)dev_dbg (info->dev,"role %d/%d, gpios: id %d, vbus %d\n" , info->last_role, role, id, vbus); -if (info->last_role == role) { +if (!info->initial_detection && info->last_role == role) {dev_warn (info->dev,"repeated role: %d\n" , role);return ; } + info->initial_detection = false; +if (info->last_role ==USB_ROLE_HOST && info->vbus)regulator_disable (info->vbus);
@@ -277,6 +280,7 @@ static int usb_conn_probe(struct platform_device *pdev)platform_set_drvdata (pdev, info);/* Perform initial detection */ + info->initial_detection = true;usb_conn_queue_dwork (info,0 );return 0 ;
drivers/usb/dwc3/gadget.c +8 -1
@@ -3830,9 +3830,14 @@ static irqreturn_t dwc3_check_event_buf(struct dwc3_event_buffer *evt)u32 reg;if (pm_runtime_suspended (dwc->dev)) { + dwc->pending_events = true; +/* +* Trigger runtime resume. The get() function will be balanced +* after processing the pending events in dwc3_process_pending +* events(). +*/ pm_runtime_get (dwc->dev);disable_irq_nosync (dwc->irq_gadget); - dwc->pending_events = true;return IRQ_HANDLED ; }
@@ -4091,6 +4096,8 @@ void dwc3_gadget_process_pending_events(struct dwc3 *dwc) {if (dwc->pending_events) {dwc3_interrupt (dwc->irq_gadget, dwc->ev_buf); +dwc3_thread_interrupt (dwc->irq_gadget, dwc->ev_buf); +pm_runtime_put (dwc->dev); dwc->pending_events = false;enable_irq (dwc->irq_gadget); }
drivers/usb/storage/alauda.c +9 -3
@@ -318,7 +318,8 @@ static int alauda_get_media_status(struct us_data *us, unsigned char *data) rc =usb_stor_ctrl_transfer (us, us->recv_ctrl_pipe, command,0xc0 ,0 ,1 , data,2 ); -usb_stor_dbg (us,"Media status %02X %02X\n" , data[0 ], data[1 ]); +if (rc ==USB_STOR_XFER_GOOD ) +usb_stor_dbg (us,"Media status %02X %02X\n" , data[0 ], data[1 ]);return rc; }
@@ -454,9 +455,14 @@ static int alauda_init_media(struct us_data *us)static int alauda_check_media (struct us_data *us) {struct alauda_info *info = (struct alauda_info *) us->extra; -unsigned char status[2 ]; +unsigned char *status = us->iobuf; +int rc; -alauda_get_media_status (us, status); + rc =alauda_get_media_status (us, status); +if (rc !=USB_STOR_XFER_GOOD ) { + status[0 ] =0xF0 ;/* Pretend there's no media */ + status[1 ] =0 ; + }/* Check for no media or door open */ if ((status[0] & 0x80) || ((status[0] & 0x1F) == 0x10)
fs/btrfs/extent-tree.c +4 -1
@@ -4138,8 +4138,11 @@ static noinline int find_free_extent(struct btrfs_root *root, ret =0 ; } -if (unlikely (block_group->cached ==BTRFS_CACHE_ERROR )) +if (unlikely (block_group->cached ==BTRFS_CACHE_ERROR )) { +if (!cache_block_group_error) + cache_block_group_error = -EIO ; goto loop; + } bg_ret =NULL ; ret =do_allocation (block_group, &ffe_ctl, &bg_ret);
fs/btrfs/extent_io.c +4 -3
@@ -4034,11 +4034,12 @@ int btree_write_cache_pages(struct address_space *mapping,free_extent_buffer (eb);/* -* the filesystem may choose to bump up nr_to_write. +* The filesystem may choose to bump up nr_to_write. * We have to make sure to honor the new nr_to_write -* at any time +* at any time. */ - nr_to_write_done = wbc->nr_to_write <=0 ; + nr_to_write_done = (wbc->sync_mode ==WB_SYNC_NONE && + wbc->nr_to_write <=0 ); }pagevec_release (&pvec);cond_resched ();
fs/nilfs2/inode.c +8 -0
@@ -1103,9 +1103,17 @@ int nilfs_set_file_dirty(struct inode *inode, unsigned int nr_dirty)int __nilfs_mark_inode_dirty (struct inode *inode,int flags) { +struct the_nilfs *nilfs = inode->i_sb->s_fs_info;struct buffer_head *ibh;int err; +/* +* Do not dirty inodes after the log writer has been detached +* and its nilfs_root struct has been freed. +*/ +if (unlikely (nilfs_purging (nilfs))) +return 0 ; + err =nilfs_load_inode_block (inode, &ibh);if (unlikely (err)) { nilfs_warn(inode->i_sb,
fs/nilfs2/segment.c +2 -0
@@ -2850,6 +2850,7 @@ void nilfs_detach_log_writer(struct super_block *sb)nilfs_segctor_destroy (nilfs->ns_writer); nilfs->ns_writer =NULL ; } +set_nilfs_purging (nilfs);/* Force to free the list of dirty files */ spin_lock (&nilfs->ns_inode_lock);
@@ -2862,4 +2863,5 @@ void nilfs_detach_log_writer(struct super_block *sb)up_write (&nilfs->ns_segctor_sem);nilfs_dispose_list (nilfs, &garbage_list,1 ); +clear_nilfs_purging (nilfs); }
fs/nilfs2/the_nilfs.h +2 -0
@@ -29,6 +29,7 @@ enum {THE_NILFS_DISCONTINUED ,/* 'next' pointer chain has broken */ THE_NILFS_GC_RUNNING ,/* gc process is running */ THE_NILFS_SB_DIRTY ,/* super block is dirty */ + THE_NILFS_PURGING, /* disposing dirty files for cleanup */ };/**
@@ -208,6 +209,7 @@ THE_NILFS_FNS(INIT, init) THE_NILFS_FNS(DISCONTINUED, discontinued) THE_NILFS_FNS(GC_RUNNING, gc_running) THE_NILFS_FNS(SB_DIRTY, sb_dirty) +THE_NILFS_FNS (PURGING , purging)/* * Mount option operations
include/linux/cpu.h +2 -0
@@ -72,6 +72,8 @@ extern ssize_t cpu_show_retbleed(struct device *dev, struct device_attribute *attr, char *buf);extern ssize_t cpu_show_spec_rstack_overflow (struct device *dev,struct device_attribute *attr,char *buf); +extern ssize_t cpu_show_gds (struct device *dev, +struct device_attribute *attr,char *buf); extern __printf(4, 5) struct device *cpu_device_create(struct device *parent, void *drvdata,
include/net/cfg80211.h +3 -0
@@ -513,6 +513,9 @@ ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *sband,if (WARN_ON (iftype >=NL80211_IFTYPE_MAX ))return NULL ; +if (iftype ==NL80211_IFTYPE_AP_VLAN ) + iftype =NL80211_IFTYPE_AP ; +for (i =0 ; i < sband->n_iftype_data; i++) {const struct ieee80211_sband_iftype_data *data = &sband->iftype_data[i];
include/net/netfilter/nf_tables.h +27 -4
@@ -1073,6 +1073,29 @@ int __nft_release_basechain(struct nft_ctx *ctx);unsigned int nft_do_chain (struct nft_pktinfo *pkt,void *priv); +static inline bool nft_use_inc (u32 *use) +{ +if (*use ==UINT_MAX ) +return false; + + (*use)++; + +return true; +} + +static inline void nft_use_dec (u32 *use) +{ +WARN_ON_ONCE ((*use)-- ==0 ); +} + +/* For error and abort path: restore use counter to previous state. */ +static inline void nft_use_inc_restore (u32 *use) +{ +WARN_ON_ONCE (!nft_use_inc (use)); +} + +#define nft_use_dec_restore nft_use_dec +/** * struct nft_table - nf_tables table *
@@ -1150,8 +1173,8 @@ struct nft_object {struct list_head list;struct rhlist_head rhlhead;struct nft_object_hash_key key; - u32 genmask:2, - use:30; + u32 genmask:2; +u32 use;u64 handle;u16 udlen;u8 *udata;
@@ -1253,8 +1276,8 @@ struct nft_flowtable {char *name;int hooknum;int ops_len; - u32 genmask:2, - use:30; + u32 genmask:2; +u32 use;u64 handle;/* runtime data below here */ struct list_head hook_list____cacheline_aligned ;
io_uring/io_uring.c +4 -2
@@ -4229,9 +4229,11 @@ static int io_openat2(struct io_kiocb *req, unsigned int issue_flags)if (issue_flags &IO_URING_F_NONBLOCK ) {/* * Don't bother trying for O_TRUNC, O_CREAT, or O_TMPFILE open, -* it'll always -EAGAIN +* it'll always -EAGAIN. Note that we test for __O_TMPFILE +* because O_TMPFILE includes O_DIRECTORY, which isn't a flag +* we need to force async for. */ -if (req->open.how.flags & (O_TRUNC |O_CREAT |O_TMPFILE )) +if (req->open.how.flags & (O_TRUNC |O_CREAT | __O_TMPFILE))return -EAGAIN ; op.lookup_flags |=LOOKUP_CACHED ; op.open_flag |=O_NONBLOCK ;
kernel/bpf/verifier.c +162 -13
244 lines not on this page · raw message
net/dccp/output.c +1 -1
@@ -185,7 +185,7 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)/* And store cached results */ icsk->icsk_pmtu_cookie = pmtu; - dp->dccps_mss_cache = cur_mps; +WRITE_ONCE (dp->dccps_mss_cache, cur_mps);return cur_mps; }
net/dccp/proto.c +8 -2
@@ -639,7 +639,7 @@ static int do_dccp_getsockopt(struct sock *sk, int level, int optname,return dccp_getsockopt_service (sk, len, (__be32 __user *)optval, optlen);case DCCP_SOCKOPT_GET_CUR_MPS : - val = dp->dccps_mss_cache; + val =READ_ONCE (dp->dccps_mss_cache);break ;case DCCP_SOCKOPT_AVAILABLE_CCIDS :return ccid_getsockopt_builtin_ccids (sk, len, optval, optlen);
@@ -748,7 +748,7 @@ int dccp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)trace_dccp_probe (sk, len); -if (len > dp->dccps_mss_cache) +if (len >READ_ONCE (dp->dccps_mss_cache))return -EMSGSIZE ;lock_sock (sk);
@@ -781,6 +781,12 @@ int dccp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) goto out_discard; } +/* We need to check dccps_mss_cache after socket is locked. */ +if (len > dp->dccps_mss_cache) { + rc = -EMSGSIZE ; + goto out_discard; + } +skb_reserve (skb, sk->sk_prot->max_header); rc =memcpy_from_msg (skb_put (skb, len), msg, len);if (rc !=0 )
net/ipv4/ip_tunnel_core.c +1 -1
@@ -224,7 +224,7 @@ static int iptunnel_pmtud_build_icmp(struct sk_buff *skb, int mtu) .un.frag.__unused = 0, .un.frag.mtu = ntohs(mtu), }; - icmph->checksum =ip_compute_csum (icmph, len); + icmph->checksum =csum_fold (skb_checksum (skb,0 , len,0 ));skb_reset_transport_header (skb); niph =skb_push (skb,sizeof (*niph));
net/ipv6/ndisc.c +2 -1
@@ -196,7 +196,8 @@ static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur,static inline int ndisc_is_useropt (const struct net_device *dev,struct nd_opt_hdr *opt) { -return opt->nd_opt_type ==ND_OPT_RDNSS || +return opt->nd_opt_type ==ND_OPT_PREFIX_INFO || + opt->nd_opt_type ==ND_OPT_RDNSS || opt->nd_opt_type ==ND_OPT_DNSSL || opt->nd_opt_type ==ND_OPT_CAPTIVE_PORTAL || opt->nd_opt_type == ND_OPT_PREF64 ||
net/netfilter/nf_tables_api.c +105 -66
529 lines not on this page · raw message
net/netfilter/nft_flow_offload.c +4 -2
@@ -174,8 +174,10 @@ static int nft_flow_offload_init(const struct nft_ctx *ctx,if (IS_ERR (flowtable))return PTR_ERR (flowtable); +if (!nft_use_inc (&flowtable->use)) +return -EMFILE ; + priv->flowtable = flowtable; - flowtable->use++;return nf_ct_netns_get (ctx->net, ctx->family); }
@@ -194,7 +196,7 @@ static void nft_flow_offload_activate(const struct nft_ctx *ctx, {struct nft_flow_offload *priv =nft_expr_priv (expr); - priv->flowtable->use++; +nft_use_inc_restore (&priv->flowtable->use); } static void nft_flow_offload_destroy(const struct nft_ctx *ctx,
net/netfilter/nft_immediate.c +4 -4
@@ -168,7 +168,7 @@ static void nft_immediate_deactivate(const struct nft_ctx *ctx,nft_immediate_chain_deactivate (ctx, chain, phase);nft_chain_del (chain); chain->bound = false; - chain->table->use--; +nft_use_dec (&chain->table->use);break ; }break ;
@@ -207,7 +207,7 @@ static void nft_immediate_destroy(const struct nft_ctx *ctx,* let the transaction records release this chain and its rules. */ if (chain->bound) { - chain->use--; +nft_use_dec (&chain->use);break ; }
@@ -215,9 +215,9 @@ static void nft_immediate_destroy(const struct nft_ctx *ctx, chain_ctx = *ctx; chain_ctx.chain = chain; - chain->use--; +nft_use_dec (&chain->use);list_for_each_entry_safe (rule, n, &chain->rules, list) { - chain->use--; +nft_use_dec (&chain->use);list_del (&rule->list);nf_tables_rule_destroy (&chain_ctx, rule); }
net/netfilter/nft_objref.c +5 -3
@@ -41,8 +41,10 @@ static int nft_objref_init(const struct nft_ctx *ctx,if (IS_ERR (obj))return -ENOENT ; +if (!nft_use_inc (&obj->use)) +return -EMFILE ; +nft_objref_priv (expr) = obj; - obj->use++;return 0 ; }
@@ -71,7 +73,7 @@ static void nft_objref_deactivate(const struct nft_ctx *ctx,if (phase ==NFT_TRANS_COMMIT )return ; - obj->use--; +nft_use_dec (&obj->use); } static void nft_objref_activate(const struct nft_ctx *ctx,
@@ -79,7 +81,7 @@ static void nft_objref_activate(const struct nft_ctx *ctx, {struct nft_object *obj =nft_objref_priv (expr); - obj->use++; +nft_use_inc_restore (&obj->use); }static struct nft_expr_type nft_objref_type;
net/packet/af_packet.c +10 -6
@@ -366,18 +366,20 @@ static void __packet_set_status(struct packet_sock *po, void *frame, int status) {union tpacket_uhdr h; +/* WRITE_ONCE() are paired with READ_ONCE() in __packet_get_status */ + h.raw = frame;switch (po->tp_version) {case TPACKET_V1 : - h.h1->tp_status = status; +WRITE_ONCE (h.h1->tp_status, status);flush_dcache_page (pgv_to_page (&h.h1->tp_status));break ;case TPACKET_V2 : - h.h2->tp_status = status; +WRITE_ONCE (h.h2->tp_status, status);flush_dcache_page (pgv_to_page (&h.h2->tp_status));break ;case TPACKET_V3 : - h.h3->tp_status = status; +WRITE_ONCE (h.h3->tp_status, status);flush_dcache_page (pgv_to_page (&h.h3->tp_status));break ;default :
@@ -394,17 +396,19 @@ static int __packet_get_status(const struct packet_sock *po, void *frame)smp_rmb (); +/* READ_ONCE() are paired with WRITE_ONCE() in __packet_set_status */ + h.raw = frame;switch (po->tp_version) {case TPACKET_V1 :flush_dcache_page (pgv_to_page (&h.h1->tp_status)); -return h.h1->tp_status; +return READ_ONCE (h.h1->tp_status);case TPACKET_V2 :flush_dcache_page (pgv_to_page (&h.h2->tp_status)); -return h.h2->tp_status; +return READ_ONCE (h.h2->tp_status);case TPACKET_V3 :flush_dcache_page (pgv_to_page (&h.h3->tp_status)); -return h.h3->tp_status; +return READ_ONCE (h.h3->tp_status);default :WARN (1 ,"TPACKET version not supported.\n" );BUG ();
net/sched/sch_netem.c +25 -34
105 lines not on this page · raw message
tools/testing/radix-tree/regression1.c +1 -1
@@ -177,7 +177,7 @@ void regression1_test(void) nr_threads =2 ;pthread_barrier_init (&worker_barrier,NULL , nr_threads); - threads =malloc (nr_threads *sizeof (pthread_t *)); + threads =malloc (nr_threads *sizeof (*threads));for (i =0 ; i < nr_threads; i++) { arg = i;
tools/testing/selftests/bpf/prog_tests/align.c +23 -13
@@ -2,7 +2,7 @@#include <test_progs.h> #define MAX_INSNS 512 -#define MAX_MATCHES 16 +#define MAX_MATCHES 24struct bpf_reg_match {unsigned int line;
@@ -267,6 +267,7 @@ static struct bpf_align_test tests[] = {*/ BPF_MOV64_REG (BPF_REG_5 ,BPF_REG_2 ),BPF_ALU64_REG (BPF_ADD ,BPF_REG_5 ,BPF_REG_6 ), +BPF_MOV64_REG (BPF_REG_4 ,BPF_REG_5 ),BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,14 ),BPF_MOV64_REG (BPF_REG_4 ,BPF_REG_5 ), BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 4),
@@ -280,6 +281,7 @@ static struct bpf_align_test tests[] = {BPF_MOV64_REG (BPF_REG_5 ,BPF_REG_2 ),BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,14 ),BPF_ALU64_REG (BPF_ADD ,BPF_REG_5 ,BPF_REG_6 ), +BPF_MOV64_REG (BPF_REG_4 ,BPF_REG_5 ),BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,4 ),BPF_ALU64_REG (BPF_ADD ,BPF_REG_5 ,BPF_REG_6 ), BPF_MOV64_REG(BPF_REG_4, BPF_REG_5),
@@ -311,44 +313,52 @@ static struct bpf_align_test tests[] = { {15, "R4=pkt(id=1,off=18,r=18,umax_value=1020,var_off=(0x0; 0x3fc))"}, {15, "R5=pkt(id=1,off=14,r=18,umax_value=1020,var_off=(0x0; 0x3fc))"},/* Variable offset is added to R5 packet pointer, -* resulting in auxiliary alignment of 4. +* resulting in auxiliary alignment of 4. To avoid BPF +* verifier's precision backtracking logging +* interfering we also have a no-op R4 = R5 +* instruction to validate R5 state. We also check +* that R4 is what it should be in such case. */ - {18, "R5_w=pkt(id=2,off=0,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, + {19, "R4_w=pkt(id=2,off=0,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, + {19, "R5_w=pkt(id=2,off=0,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},/* Constant offset is added to R5, resulting in * reg->off of 14. */ - {19, "R5_w=pkt(id=2,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, + {20, "R5_w=pkt(id=2,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},/* At the time the word size load is performed from R5, * its total fixed offset is NET_IP_ALIGN + reg->off * (14) which is 16. Then the variable offset is 4-byte * aligned, so the total offset is 4-byte aligned and * meets the load's requirements. */ - {23, "R4=pkt(id=2,off=18,r=18,umax_value=1020,var_off=(0x0; 0x3fc))"}, - {23, "R5=pkt(id=2,off=14,r=18,umax_value=1020,var_off=(0x0; 0x3fc))"}, + {24, "R4=pkt(id=2,off=18,r=18,umax_value=1020,var_off=(0x0; 0x3fc))"}, + {24, "R5=pkt(id=2,off=14,r=18,umax_value=1020,var_off=(0x0; 0x3fc))"},/* Constant offset is added to R5 packet pointer, * resulting in reg->off value of 14. */ - {26, "R5_w=pkt(id=0,off=14,r=8"}, + {27, "R5_w=pkt(id=0,off=14,r=8"},/* Variable offset is added to R5, resulting in a -* variable offset of (4n). +* variable offset of (4n). See comment for insn #19 +* for R4 = R5 trick. */ - {27, "R5_w=pkt(id=3,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, + {29, "R4_w=pkt(id=3,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, + {29, "R5_w=pkt(id=3,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},/* Constant is added to R5 again, setting reg->off to 18. */ - {28, "R5_w=pkt(id=3,off=18,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, + {30, "R5_w=pkt(id=3,off=18,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},/* And once more we add a variable; resulting var_off * is still (4n), fixed offset is not changed. * Also, we create a new reg->id. */ - {29, "R5_w=pkt(id=4,off=18,r=0,umax_value=2040,var_off=(0x0; 0x7fc)"}, + {32, "R4_w=pkt(id=4,off=18,r=0,umax_value=2040,var_off=(0x0; 0x7fc)"}, + {32, "R5_w=pkt(id=4,off=18,r=0,umax_value=2040,var_off=(0x0; 0x7fc)"},/* At the time the word size load is performed from R5, * its total fixed offset is NET_IP_ALIGN + reg->off (18) * which is 20. Then the variable offset is (4n), so * the total offset is 4-byte aligned and meets the * load's requirements. */ - {33, "R4=pkt(id=4,off=22,r=22,umax_value=2040,var_off=(0x0; 0x7fc)"}, - {33, "R5=pkt(id=4,off=18,r=22,umax_value=2040,var_off=(0x0; 0x7fc)"}, + {35, "R4=pkt(id=4,off=22,r=22,umax_value=2040,var_off=(0x0; 0x7fc)"}, + {35, "R5=pkt(id=4,off=18,r=22,umax_value=2040,var_off=(0x0; 0x7fc)"}, }, }, {
tools/testing/selftests/bpf/prog_tests/sk_assign.c +19 -6
@@ -29,7 +29,23 @@ static int stop, duration;static bool configure_stack (void ) { +char tc_version[128 ];char tc_cmd[BUFSIZ ]; +char *prog; +FILE *tc; + +/* Check whether tc is built with libbpf. */ + tc =popen ("tc -V" ,"r" ); +if (CHECK_FAIL (!tc)) +return false; +if (CHECK_FAIL (!fgets (tc_version,sizeof (tc_version), tc))) +return false; +if (strstr (tc_version,", libbpf " )) + prog ="test_sk_assign_libbpf.o" ; +else + prog ="test_sk_assign.o" ; +if (CHECK_FAIL (pclose (tc))) +return false;/* Move to a new networking namespace */ if (CHECK_FAIL (unshare (CLONE_NEWNET )))
@@ -46,8 +62,8 @@ configure_stack(void)/* Load qdisc, BPF program */ if (CHECK_FAIL (system ("tc qdisc add dev lo clsact" )))return false; -sprintf (tc_cmd,"%s %s %s %s" ,"tc filter add dev lo ingress bpf" , -"direct-action object-file ./test_sk_assign.o" , +sprintf (tc_cmd,"%s %s %s %s %s" ,"tc filter add dev lo ingress bpf" , +"direct-action object-file" , prog,"section classifier/sk_assign_test" , (env.verbosity <VERBOSE_VERY ) ?" 2>/dev/null" :"verbose" ); if (CHECK(system(tc_cmd), "BPF load failed;",
@@ -129,15 +145,12 @@ get_port(int fd)static ssize_t rcv_msg (int srv_client,int type) { -struct sockaddr_storage ss;char buf[BUFSIZ ]; -socklen_t slen;if (type ==SOCK_STREAM )return read (srv_client, &buf,sizeof (buf));else -return recvfrom (srv_client, &buf,sizeof (buf),0 , - (struct sockaddr *)&ss, &slen); +return recvfrom (srv_client, &buf,sizeof (buf),0 ,NULL ,NULL ); } static int
tools/testing/selftests/bpf/progs/connect4_prog.c +1 -1
@@ -33,7 +33,7 @@ int _version SEC("version") = 1; -__attribute__ ((noinline)) +__attribute__ ((noinline))__weak int do_bind (struct bpf_sock_addr *ctx) {struct sockaddr_in sa = {};
tools/testing/selftests/bpf/progs/test_sk_assign.c +11 -0
@@ -16,6 +16,16 @@#include <bpf/bpf_helpers.h> #include <bpf/bpf_endian.h> +#if defined(IPROUTE2_HAVE_LIBBPF ) +/* Use a new-style map definition. */ +struct { + __uint(type, BPF_MAP_TYPE_SOCKMAP); + __type(key, int); + __type(value, __u64); + __uint(pinning, LIBBPF_PIN_BY_NAME); + __uint(max_entries, 1); +} server_map SEC(".maps"); +#else /* Pin map under /sys/fs/bpf/tc/globals/<map name> */ #define PIN_GLOBAL_NS 2
@@ -35,6 +45,7 @@ struct { .max_elem = 1, .pinning = PIN_GLOBAL_NS, }; +#endif int _version SEC("version") = 1; char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/test_sk_assign_libbpf.c new file +3 -0
@@ -0,0 +1,3 @@ +// SPDX-License-Identifier: GPL-2.0 +#define IPROUTE2_HAVE_LIBBPF +#include "test_sk_assign.c"
tools/testing/selftests/net/forwarding/ethtool.sh +2 -0
@@ -286,6 +286,8 @@ different_speeds_autoneg_on() ethtool -s $h1 autoneg on } +skip_on_veth + trap cleanup EXIT setup_prepare
tools/testing/selftests/net/forwarding/ethtool_extended_state.sh +2 -0
@@ -95,6 +95,8 @@ no_cable() ip link set dev $swp3 down } +skip_on_veth + setup_prepare tests_run
tools/testing/selftests/net/forwarding/lib.sh +16 -0
@@ -69,6 +69,17 @@ check_tc_action_hw_stats_support() fi } +skip_on_veth() +{ + local kind=$(ip -j -d link show dev ${NETIFS[p1]} | + jq -r '.[].linkinfo.info_kind') + + if [[ $kind == veth ]]; then + echo "SKIP: Test cannot be run with veth pairs" + exit $ksft_skip + fi +} + if [[ "$(id -u)" -ne 0 ]]; then echo "SKIP: need root privileges" exit 0
@@ -121,6 +132,11 @@ create_netif_veth() for ((i = 1; i <= NUM_NETIFS; ++i)); do local j=$((i+1)) + if [ -z ${NETIFS[p$i]} ]; then + echo "SKIP: Cannot create interface. Name not specified" + exit $ksft_skip + fi + ip link show dev ${NETIFS[p$i]} &> /dev/null if [[ $? -ne 0 ]]; then ip link add ${NETIFS[p$i]} type veth \
tools/testing/selftests/net/forwarding/settings new file +1 -0
@@ -0,0 +1 @@ +timeout=0
tools/testing/selftests/net/forwarding/tc_flower.sh +4 -4
@@ -49,8 +49,8 @@ match_dst_mac_test() tc_check_packets "dev $h2 ingress" 101 1 check_fail $? "Matched on a wrong filter" - tc_check_packets "dev $h2 ingress" 102 1 - check_err $? "Did not match on correct filter" + tc_check_packets "dev $h2 ingress" 102 0 + check_fail $? "Did not match on correct filter" tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
@@ -75,8 +75,8 @@ match_src_mac_test() tc_check_packets "dev $h2 ingress" 101 1 check_fail $? "Matched on a wrong filter" - tc_check_packets "dev $h2 ingress" 102 1 - check_err $? "Did not match on correct filter" + tc_check_packets "dev $h2 ingress" 102 0 + check_fail $? "Did not match on correct filter" tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
tools/testing/selftests/rseq/Makefile +3 -1
@@ -4,8 +4,10 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) CLANG_FLAGS += -no-integrated-as endif +top_srcdir = ../../../.. + CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L$(OUTPUT) -Wl,-rpath=./ \ - $(CLANG_FLAGS) + $(CLANG_FLAGS) -I$(top_srcdir)/tools/include LDLIBS += -lpthread -ldl # Own dependencies because we only want to build against 1st prerequisite, but
tools/testing/selftests/rseq/rseq.c +2 -0
@@ -29,6 +29,8 @@#include <dlfcn.h> #include <stddef.h> +#include <linux/compiler.h> +#include "../kselftest.h" #include "rseq.h"