25 Jan, 2021

2 commits


20 Jan, 2021

11 commits

  • This is the 5.10.9 stable release

    * tag 'v5.10.9': (153 commits)
    Linux 5.10.9
    netfilter: nf_nat: Fix memleak in nf_nat_init
    netfilter: conntrack: fix reading nf_conntrack_buckets
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • This is the 5.10.8 stable release

    * tag 'v5.10.8': (104 commits)
    Linux 5.10.8
    tools headers UAPI: Sync linux/fscrypt.h with the kernel sources
    drm/panfrost: Remove unused variables in panfrost_job_close()
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • This is the 5.10.7 stable release

    * tag 'v5.10.7': (144 commits)
    Linux 5.10.7
    scsi: target: Fix XCOPY NAA identifier lookup
    rtlwifi: rise completion at the last step of firmware callback
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • This is the 5.10.6 stable release

    * tag 'v5.10.6': (21 commits)
    Linux 5.10.6
    mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start
    exec: Transform exec_update_mutex into a rw_semaphore
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/rtc/rtc-pcf2127.c

    Jason Liu
     
  • This is the 5.10.5 stable release

    * tag 'v5.10.5': (63 commits)
    Linux 5.10.5
    device-dax: Fix range release
    ext4: avoid s_mb_prefetch to be zero in individual scenarios
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • Changes in 5.10.9
    btrfs: reloc: fix wrong file extent type check to avoid false ENOENT
    btrfs: prevent NULL pointer dereference in extent_io_tree_panic
    ALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machines
    ALSA: doc: Fix reference to mixart.rst
    ASoC: AMD Renoir - add DMI entry for Lenovo ThinkPad X395
    ASoC: dapm: remove widget from dirty list on free
    x86/hyperv: check cpu mask after interrupt has been disabled
    drm/amdgpu: add green_sardine device id (v2)
    drm/amdgpu: fix DRM_INFO flood if display core is not supported (bug 210921)
    Revert "drm/amd/display: Fixed Intermittent blue screen on OLED panel"
    drm/amdgpu: add new device id for Renior
    drm/i915: Allow the sysadmin to override security mitigations
    drm/i915/gt: Limit VFE threads based on GT
    drm/i915/backlight: fix CPU mode backlight takeover on LPT
    drm/bridge: sii902x: Refactor init code into separate function
    dt-bindings: display: sii902x: Add supply bindings
    drm/bridge: sii902x: Enable I/O and core VCC supplies if present
    tracing/kprobes: Do the notrace functions check without kprobes on ftrace
    tools/bootconfig: Add tracing_on support to helper scripts
    ext4: use IS_ERR instead of IS_ERR_OR_NULL and set inode null when IS_ERR
    ext4: fix wrong list_splice in ext4_fc_cleanup
    ext4: fix bug for rename with RENAME_WHITEOUT
    cifs: check pointer before freeing
    cifs: fix interrupted close commands
    riscv: Drop a duplicated PAGE_KERNEL_EXEC
    riscv: return -ENOSYS for syscall -1
    riscv: Fixup CONFIG_GENERIC_TIME_VSYSCALL
    riscv: Fix KASAN memory mapping.
    mips: fix Section mismatch in reference
    mips: lib: uncached: fix non-standard usage of variable 'sp'
    MIPS: boot: Fix unaligned access with CONFIG_MIPS_RAW_APPENDED_DTB
    MIPS: Fix malformed NT_FILE and NT_SIGINFO in 32bit coredumps
    MIPS: relocatable: fix possible boot hangup with KASLR enabled
    RDMA/ocrdma: Fix use after free in ocrdma_dealloc_ucontext_pd()
    ACPI: scan: Harden acpi_device_add() against device ID overflows
    xen/privcmd: allow fetching resource sizes
    compiler.h: Raise minimum version of GCC to 5.1 for arm64
    mm/vmalloc.c: fix potential memory leak
    mm/hugetlb: fix potential missing huge page size info
    mm/process_vm_access.c: include compat.h
    dm raid: fix discard limits for raid1
    dm snapshot: flush merged data before committing metadata
    dm integrity: fix flush with external metadata device
    dm integrity: fix the maximum number of arguments
    dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq
    dm crypt: do not wait for backlogged crypto request completion in softirq
    dm crypt: do not call bio_endio() from the dm-crypt tasklet
    dm crypt: defer decryption to a tasklet if interrupts disabled
    stmmac: intel: change all EHL/TGL to auto detect phy addr
    r8152: Add Lenovo Powered USB-C Travel Hub
    btrfs: tree-checker: check if chunk item end overflows
    ext4: don't leak old mountpoint samples
    io_uring: don't take files/mm for a dead task
    io_uring: drop mm and files after task_work_run
    ARC: build: remove non-existing bootpImage from KBUILD_IMAGE
    ARC: build: add uImage.lzma to the top-level target
    ARC: build: add boot_targets to PHONY
    ARC: build: move symlink creation to arch/arc/Makefile to avoid race
    ARM: omap2: pmic-cpcap: fix maximum voltage to be consistent with defaults on xt875
    ath11k: fix crash caused by NULL rx_channel
    netfilter: ipset: fixes possible oops in mtype_resize
    ath11k: qmi: try to allocate a big block of DMA memory first
    btrfs: fix async discard stall
    btrfs: merge critical sections of discard lock in workfn
    btrfs: fix transaction leak and crash after RO remount caused by qgroup rescan
    regulator: bd718x7: Add enable times
    ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram
    ARM: dts: ux500/golden: Set display max brightness
    habanalabs: adjust pci controller init to new firmware
    habanalabs/gaudi: retry loading TPC f/w on -EINTR
    habanalabs: register to pci shutdown callback
    staging: spmi: hisi-spmi-controller: Fix some error handling paths
    spi: altera: fix return value for altera_spi_txrx()
    habanalabs: Fix memleak in hl_device_reset
    hwmon: (pwm-fan) Ensure that calculation doesn't discard big period values
    lib/raid6: Let $(UNROLL) rules work with macOS userland
    kconfig: remove 'kvmconfig' and 'xenconfig' shorthands
    spi: fix the divide by 0 error when calculating xfer waiting time
    io_uring: drop file refs after task cancel
    bfq: Fix computation of shallow depth
    arch/arc: add copy_user_page() to to fix build error on ARC
    misdn: dsp: select CONFIG_BITREVERSE
    net: ethernet: fs_enet: Add missing MODULE_LICENSE
    selftests: fix the return value for UDP GRO test
    nvme-pci: mark Samsung PM1725a as IGNORE_DEV_SUBNQN
    nvme: avoid possible double fetch in handling CQE
    nvmet-rdma: Fix list_del corruption on queue establishment failure
    drm/amd/display: fix sysfs amdgpu_current_backlight_pwm NULL pointer issue
    drm/amdgpu: fix a GPU hang issue when remove device
    drm/amd/pm: fix the failure when change power profile for renoir
    drm/amdgpu: fix potential memory leak during navi12 deinitialization
    usb: typec: Fix copy paste error for NVIDIA alt-mode description
    iommu/vt-d: Fix lockdep splat in sva bind()/unbind()
    ACPI: scan: add stub acpi_create_platform_device() for !CONFIG_ACPI
    drm/msm: Call msm_init_vram before binding the gpu
    ARM: picoxcell: fix missing interrupt-parent properties
    poll: fix performance regression due to out-of-line __put_user()
    rcu-tasks: Move RCU-tasks initialization to before early_initcall()
    bpf: Simplify task_file_seq_get_next()
    bpf: Save correct stopping point in file seq iteration
    x86/sev-es: Fix SEV-ES OUT/IN immediate opcode vc handling
    cfg80211: select CONFIG_CRC32
    nvme-fc: avoid calling _nvme_fc_abort_outstanding_ios from interrupt context
    iommu/vt-d: Update domain geometry in iommu_ops.at(de)tach_dev
    net/mlx5e: CT: Use per flow counter when CT flow accounting is enabled
    net/mlx5: Fix passing zero to 'PTR_ERR'
    net/mlx5: E-Switch, fix changing vf VLANID
    blk-mq-debugfs: Add decode for BLK_MQ_F_TAG_HCTX_SHARED
    mm: fix clear_refs_write locking
    mm: don't play games with pinned pages in clear_page_refs
    mm: don't put pinned pages into the swap cache
    perf intel-pt: Fix 'CPU too large' error
    dump_common_audit_data(): fix racy accesses to ->d_name
    ASoC: meson: axg-tdm-interface: fix loopback
    ASoC: meson: axg-tdmin: fix axg skew offset
    ASoC: Intel: fix error code cnl_set_dsp_D0()
    nvmet-rdma: Fix NULL deref when setting pi_enable and traddr INADDR_ANY
    nvme: don't intialize hwmon for discovery controllers
    nvme-tcp: fix possible data corruption with bio merges
    nvme-tcp: Fix warning with CONFIG_DEBUG_PREEMPT
    NFS4: Fix use-after-free in trace_event_raw_event_nfs4_set_lock
    pNFS: We want return-on-close to complete when evicting the inode
    pNFS: Mark layout for return if return-on-close was not sent
    pNFS: Stricter ordering of layoutget and layoutreturn
    NFS: Adjust fs_context error logging
    NFS/pNFS: Don't call pnfs_free_bucket_lseg() before removing the request
    NFS/pNFS: Don't leak DS commits in pnfs_generic_retry_commit()
    NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter
    NFS: nfs_delegation_find_inode_server must first reference the superblock
    NFS: nfs_igrab_and_active must first reference the superblock
    scsi: ufs: Fix possible power drain during system suspend
    ext4: fix superblock checksum failure when setting password salt
    RDMA/restrack: Don't treat as an error allocation ID wrapping
    RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp
    bnxt_en: Improve stats context resource accounting with RDMA driver loaded.
    RDMA/mlx5: Fix wrong free of blue flame register on error
    IB/mlx5: Fix error unwinding when set_has_smi_cap fails
    umount(2): move the flag validity checks first
    dm zoned: select CONFIG_CRC32
    drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there is no reset-deassert MIPI-sequence
    drm/i915/icl: Fix initing the DSI DSC power refcount during HW readout
    drm/i915/gt: Restore clear-residual mitigations for Ivybridge, Baytrail
    mm, slub: consider rest of partial list if acquire_slab() fails
    riscv: Trace irq on only interrupt is enabled
    iommu/vt-d: Fix unaligned addresses for intel_flush_svm_range_dev()
    net: sunrpc: interpret the return value of kstrtou32 correctly
    selftests: netfilter: Pass family parameter "-f" to conntrack tool
    dm: eliminate potential source of excessive kernel log noise
    ALSA: fireface: Fix integer overflow in transmit_midi_msg()
    ALSA: firewire-tascam: Fix integer overflow in midi_port_work()
    netfilter: conntrack: fix reading nf_conntrack_buckets
    netfilter: nf_nat: Fix memleak in nf_nat_init
    Linux 5.10.9

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: I609e501511889081e03d2d18ee7e1be95406f396

    Greg Kroah-Hartman
     
  • commit 869f4fdaf4ca7bb6e0d05caf6fa1108dddc346a7 upstream.

    When register_pernet_subsys() fails, nf_nat_bysource
    should be freed just like when nf_ct_extend_register()
    fails.

    Fixes: 1cd472bf036ca ("netfilter: nf_nat: add nat hook register functions to nf_nat")
    Signed-off-by: Dinghao Liu
    Acked-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Greg Kroah-Hartman

    Dinghao Liu
     
  • commit f6351c3f1c27c80535d76cac2299aec44c36291e upstream.

    The old way of changing the conntrack hashsize runtime was through changing
    the module param via file /sys/module/nf_conntrack/parameters/hashsize. This
    was extended to sysctl change in commit 3183ab8997a4 ("netfilter: conntrack:
    allow increasing bucket size via sysctl too").

    The commit introduced second "user" variable nf_conntrack_htable_size_user
    which shadow actual variable nf_conntrack_htable_size. When hashsize is
    changed via module param this "user" variable isn't updated. This results in
    sysctl net/netfilter/nf_conntrack_buckets shows the wrong value when users
    update via the old way.

    This patch fix the issue by always updating "user" variable when reading the
    proc file. This will take care of changes to the actual variable without
    sysctl need to be aware.

    Fixes: 3183ab8997a4 ("netfilter: conntrack: allow increasing bucket size via sysctl too")
    Reported-by: Yoel Caspersen
    Signed-off-by: Jesper Dangaard Brouer
    Acked-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Greg Kroah-Hartman

    Jesper Dangaard Brouer
     
  • commit 86b53fbf08f48d353a86a06aef537e78e82ba721 upstream.

    A return value of 0 means success. This is documented in lib/kstrtox.c.

    This was found by trying to mount an NFS share from a link-local IPv6
    address with the interface specified by its index:

    mount("[fe80::1%1]:/srv/nfs", "/mnt", "nfs", 0, "nolock,addr=fe80::1%1")

    Before this commit this failed with EINVAL and also caused the following
    message in dmesg:

    [...] NFS: bad IP address specified: addr=fe80::1%1

    The syscall using the same address based on the interface name instead
    of its index succeeds.

    Credits for this patch go to my colleague Christian Speich, who traced
    the origin of this bug to this line of code.

    Signed-off-by: Johannes Nixdorf
    Fixes: 00cfaa943ec3 ("replace strict_strto calls")
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    j.nixdorf@avm.de
     
  • [ Upstream commit 152a8a6c017bfdeda7f6d052fbc6e151891bd9b6 ]

    Without crc32 support, this fails to link:

    arm-linux-gnueabi-ld: net/wireless/scan.o: in function `cfg80211_scan_6ghz':
    scan.c:(.text+0x928): undefined reference to `crc32_le'

    Fixes: c8cb5b854b40 ("nl80211/cfg80211: support 6 GHz scanning")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     
  • [ Upstream commit 2b33d6ffa9e38f344418976b06057e2fc2aa9e2a ]

    currently mtype_resize() can cause oops

    t = ip_set_alloc(htable_size(htable_bits));
    if (!t) {
    ret = -ENOMEM;
    goto out;
    }
    t->hregion = ip_set_alloc(ahash_sizeof_regions(htable_bits));

    Increased htable_bits can force htable_size() to return 0.
    In own turn ip_set_alloc(0) returns not 0 but ZERO_SIZE_PTR,
    so follwoing access to t->hregion should trigger an OOPS.

    Signed-off-by: Vasily Averin
    Acked-by: Jozsef Kadlecsik
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Sasha Levin

    Vasily Averin
     

19 Jan, 2021

1 commit

  • Changes in 5.10.8
    powerpc/32s: Fix RTAS machine check with VMAP stack
    io_uring: synchronise IOPOLL on task_submit fail
    io_uring: limit {io|sq}poll submit locking scope
    io_uring: patch up IOPOLL overflow_flush sync
    RDMA/hns: Avoid filling sl in high 3 bits of vlan_id
    iommu/arm-smmu-qcom: Initialize SCTLR of the bypass context
    drm/panfrost: Don't corrupt the queue mutex on open/close
    io_uring: Fix return value from alloc_fixed_file_ref_node
    scsi: ufs: Fix -Wsometimes-uninitialized warning
    btrfs: skip unnecessary searches for xattrs when logging an inode
    btrfs: fix deadlock when cloning inline extent and low on free metadata space
    btrfs: shrink delalloc pages instead of full inodes
    net: cdc_ncm: correct overhead in delayed_ndp_size
    net: hns3: fix incorrect handling of sctp6 rss tuple
    net: hns3: fix the number of queues actually used by ARQ
    net: hns3: fix a phy loopback fail issue
    net: stmmac: dwmac-sun8i: Fix probe error handling
    net: stmmac: dwmac-sun8i: Balance internal PHY resource references
    net: stmmac: dwmac-sun8i: Balance internal PHY power
    net: stmmac: dwmac-sun8i: Balance syscon (de)initialization
    net: vlan: avoid leaks on register_vlan_dev() failures
    net/sonic: Fix some resource leaks in error handling paths
    net: bareudp: add missing error handling for bareudp_link_config()
    ptp: ptp_ines: prevent build when HAS_IOMEM is not set
    net: ipv6: fib: flush exceptions when purging route
    tools: selftests: add test for changing routes with PTMU exceptions
    net: fix pmtu check in nopmtudisc mode
    net: ip: always refragment ip defragmented packets
    chtls: Fix hardware tid leak
    chtls: Remove invalid set_tcb call
    chtls: Fix panic when route to peer not configured
    chtls: Avoid unnecessary freeing of oreq pointer
    chtls: Replace skb_dequeue with skb_peek
    chtls: Added a check to avoid NULL pointer dereference
    chtls: Fix chtls resources release sequence
    octeontx2-af: fix memory leak of lmac and lmac->name
    nexthop: Fix off-by-one error in error path
    nexthop: Unlink nexthop group entry in error path
    nexthop: Bounce NHA_GATEWAY in FDB nexthop groups
    s390/qeth: fix deadlock during recovery
    s390/qeth: fix locking for discipline setup / removal
    s390/qeth: fix L2 header access in qeth_l3_osa_features_check()
    net: dsa: lantiq_gswip: Exclude RMII from modes that report 1 GbE
    net/mlx5: Use port_num 1 instead of 0 when delete a RoCE address
    net/mlx5e: ethtool, Fix restriction of autoneg with 56G
    net/mlx5e: In skb build skip setting mark in switchdev mode
    net/mlx5: Check if lag is supported before creating one
    scsi: lpfc: Fix variable 'vport' set but not used in lpfc_sli4_abts_err_handler()
    ionic: start queues before announcing link up
    HID: wacom: Fix memory leakage caused by kfifo_alloc
    fanotify: Fix sys_fanotify_mark() on native x86-32
    ARM: OMAP2+: omap_device: fix idling of devices during probe
    i2c: sprd: use a specific timeout to avoid system hang up issue
    dmaengine: dw-edma: Fix use after free in dw_edma_alloc_chunk()
    selftests/bpf: Clarify build error if no vmlinux
    can: tcan4x5x: fix bittiming const, use common bittiming from m_can driver
    can: m_can: m_can_class_unregister(): remove erroneous m_can_clk_stop()
    can: kvaser_pciefd: select CONFIG_CRC32
    spi: spi-geni-qcom: Fail new xfers if xfer/cancel/abort pending
    cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get()
    spi: spi-geni-qcom: Fix geni_spi_isr() NULL dereference in timeout case
    spi: stm32: FIFO threshold level - fix align packet size
    i2c: i801: Fix the i2c-mux gpiod_lookup_table not being properly terminated
    i2c: mediatek: Fix apdma and i2c hand-shake timeout
    bcache: set bcache device into read-only mode for BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET
    interconnect: imx: Add a missing of_node_put after of_device_is_available
    interconnect: qcom: fix rpmh link failures
    dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function
    dmaengine: milbeaut-xdmac: Fix a resource leak in the error handling path of the probe function
    dmaengine: xilinx_dma: check dma_async_device_register return value
    dmaengine: xilinx_dma: fix incompatible param warning in _child_probe()
    dmaengine: xilinx_dma: fix mixed_enum_type coverity warning
    arm64: mm: Fix ARCH_LOW_ADDRESS_LIMIT when !CONFIG_ZONE_DMA
    qed: select CONFIG_CRC32
    phy: dp83640: select CONFIG_CRC32
    wil6210: select CONFIG_CRC32
    block: rsxx: select CONFIG_CRC32
    lightnvm: select CONFIG_CRC32
    zonefs: select CONFIG_CRC32
    iommu/vt-d: Fix misuse of ALIGN in qi_flush_piotlb()
    iommu/intel: Fix memleak in intel_irq_remapping_alloc
    bpftool: Fix compilation failure for net.o with older glibc
    nvme-tcp: Fix possible race of io_work and direct send
    net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups
    net/mlx5e: Fix two double free cases
    regmap: debugfs: Fix a memory leak when calling regmap_attach_dev
    wan: ds26522: select CONFIG_BITREVERSE
    arm64: cpufeature: remove non-exist CONFIG_KVM_ARM_HOST
    regulator: qcom-rpmh-regulator: correct hfsmps515 definition
    net: mvpp2: disable force link UP during port init procedure
    drm/i915/dp: Track pm_qos per connector
    net: mvneta: fix error message when MTU too large for XDP
    selftests: fib_nexthops: Fix wrong mausezahn invocation
    KVM: arm64: Don't access PMCR_EL0 when no PMU is available
    xsk: Fix race in SKB mode transmit with shared cq
    xsk: Rollback reservation at NETDEV_TX_BUSY
    block/rnbd-clt: avoid module unload race with close confirmation
    can: isotp: isotp_getname(): fix kernel information leak
    block: fix use-after-free in disk_part_iter_next
    net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of trimmed packet
    regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init()
    drm/panfrost: Remove unused variables in panfrost_job_close()
    tools headers UAPI: Sync linux/fscrypt.h with the kernel sources
    Linux 5.10.8

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: Ib8272ec9f47a3c3813509bcacece3b16137332e1

    Greg Kroah-Hartman
     

18 Jan, 2021

1 commit


17 Jan, 2021

11 commits

  • commit 54970a2fbb673f090b7f02d7f57b10b2e0707155 upstream.

    syzbot reproduces BUG_ON in skb_checksum_help():
    tun creates (bogus) skb with huge partial-checksummed area and
    small ip packet inside. Then ip_rcv trims the skb based on size
    of internal ip packet, after that csum offset points beyond of
    trimmed skb. Then checksum_tg() called via netfilter hook
    triggers BUG_ON:

    offset = skb_checksum_start_offset(skb);
    BUG_ON(offset >= skb_headlen(skb));

    To work around the problem this patch forces pskb_trim_rcsum_slow()
    to return -EINVAL in described scenario. It allows its callers to
    drop such kind of packets.

    Link: https://syzkaller.appspot.com/bug?id=b419a5ca95062664fe1a60b764621eb4526e2cd0
    Reported-by: syzbot+7010af67ced6105e5ab6@syzkaller.appspotmail.com
    Signed-off-by: Vasily Averin
    Acked-by: Willem de Bruijn
    Link: https://lore.kernel.org/r/1b2494af-2c56-8ee2-7bc0-923fcad1cdf8@virtuozzo.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Vasily Averin
     
  • commit b42b3a2744b3e8f427de79896720c72823af91ad upstream.

    Initialize the sockaddr_can structure to prevent a data leak to user space.

    Suggested-by: Cong Wang
    Reported-by: syzbot+057884e2f453e8afebc8@syzkaller.appspotmail.com
    Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol")
    Signed-off-by: Oliver Hartkopp
    Link: https://lore.kernel.org/r/20210112091643.11789-1-socketcan@hartkopp.net
    Signed-off-by: Marc Kleine-Budde
    Signed-off-by: Greg Kroah-Hartman

    Oliver Hartkopp
     
  • commit b1b95cb5c0a9694d47d5f845ba97e226cfda957d upstream.

    Rollback the reservation in the completion ring when we get a
    NETDEV_TX_BUSY. When this error is received from the driver, we are
    supposed to let the user application retry the transmit again. And in
    order to do this, we need to roll back the failed send so it can be
    retried. Unfortunately, we did not cancel the reservation we had made
    in the completion ring. By not doing this, we actually make the
    completion ring one entry smaller per NETDEV_TX_BUSY error we get, and
    after enough of these errors the completion ring will be of size zero
    and transmit will stop working.

    Fix this by cancelling the reservation when we get a NETDEV_TX_BUSY
    error.

    Fixes: 642e450b6b59 ("xsk: Do not discard packet when NETDEV_TX_BUSY")
    Reported-by: Xuan Zhuo
    Signed-off-by: Magnus Karlsson
    Signed-off-by: Daniel Borkmann
    Acked-by: Björn Töpel
    Link: https://lore.kernel.org/bpf/20201218134525.13119-3-magnus.karlsson@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Magnus Karlsson
     
  • commit f09ced4053bc0a2094a12b60b646114c966ef4c6 upstream.

    Fix a race when multiple sockets are simultaneously calling sendto()
    when the completion ring is shared in the SKB case. This is the case
    when you share the same netdev and queue id through the
    XDP_SHARED_UMEM bind flag. The problem is that multiple processes can
    be in xsk_generic_xmit() and call the backpressure mechanism in
    xskq_prod_reserve(xs->pool->cq). As this is a shared resource in this
    specific scenario, a race might occur since the rings are
    single-producer single-consumer.

    Fix this by moving the tx_completion_lock from the socket to the pool
    as the pool is shared between the sockets that share the completion
    ring. (The pool is not shared when this is not the case.) And then
    protect the accesses to xskq_prod_reserve() with this lock. The
    tx_completion_lock is renamed cq_lock to better reflect that it
    protects accesses to the potentially shared completion ring.

    Fixes: 35fcde7f8deb ("xsk: support for Tx")
    Reported-by: Xuan Zhuo
    Signed-off-by: Magnus Karlsson
    Signed-off-by: Daniel Borkmann
    Acked-by: Björn Töpel
    Link: https://lore.kernel.org/bpf/20201218134525.13119-2-magnus.karlsson@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Magnus Karlsson
     
  • [ Upstream commit b19218b27f3477316d296e8bcf4446aaf017aa69 ]

    The function nh_check_attr_group() is called to validate nexthop groups.
    The intention of that code seems to have been to bounce all attributes
    above NHA_GROUP_TYPE except for NHA_FDB. However instead it bounces all
    these attributes except when NHA_FDB attribute is present--then it accepts
    them.

    NHA_FDB validation that takes place before, in rtm_to_nh_config(), already
    bounces NHA_OIF, NHA_BLACKHOLE, NHA_ENCAP and NHA_ENCAP_TYPE. Yet further
    back, NHA_GROUPS and NHA_MASTER are bounced unconditionally.

    But that still leaves NHA_GATEWAY as an attribute that would be accepted in
    FDB nexthop groups (with no meaning), so long as it keeps the address
    family as unspecified:

    # ip nexthop add id 1 fdb via 127.0.0.1
    # ip nexthop add id 10 fdb via default group 1

    The nexthop code is still relatively new and likely not used very broadly,
    and the FDB bits are newer still. Even though there is a reproducer out
    there, it relies on an improbable gateway arguments "via default", "via
    all" or "via any". Given all this, I believe it is OK to reformulate the
    condition to do the right thing and bounce NHA_GATEWAY.

    Fixes: 38428d68719c ("nexthop: support for fdb ecmp nexthops")
    Signed-off-by: Petr Machata
    Signed-off-by: Ido Schimmel
    Reviewed-by: David Ahern
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Petr Machata
     
  • [ Upstream commit 7b01e53eee6dce7a8a6736e06b99b68cd0cc7a27 ]

    In case of error, remove the nexthop group entry from the list to which
    it was previously added.

    Fixes: 430a049190de ("nexthop: Add support for nexthop groups")
    Signed-off-by: Ido Schimmel
    Reviewed-by: Petr Machata
    Reviewed-by: David Ahern
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Ido Schimmel
     
  • [ Upstream commit 07e61a979ca4dddb3661f59328b3cd109f6b0070 ]

    A reference was not taken for the current nexthop entry, so do not try
    to put it in the error path.

    Fixes: 430a049190de ("nexthop: Add support for nexthop groups")
    Signed-off-by: Ido Schimmel
    Reviewed-by: Petr Machata
    Reviewed-by: David Ahern
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Ido Schimmel
     
  • [ Upstream commit bb4cc1a18856a73f0ff5137df0c2a31f4c50f6cf ]

    Conntrack reassembly records the largest fragment size seen in IPCB.
    However, when this gets forwarded/transmitted, fragmentation will only
    be forced if one of the fragmented packets had the DF bit set.

    In that case, a flag in IPCB will force fragmentation even if the
    MTU is large enough.

    This should work fine, but this breaks with ip tunnels.
    Consider client that sends a UDP datagram of size X to another host.

    The client fragments the datagram, so two packets, of size y and z, are
    sent. DF bit is not set on any of these packets.

    Middlebox netfilter reassembles those packets back to single size-X
    packet, before routing decision.

    packet-size-vs-mtu checks in ip_forward are irrelevant, because DF bit
    isn't set. At output time, ip refragmentation is skipped as well
    because x is still smaller than the mtu of the output device.

    If ttransmit device is an ip tunnel, the packet size increases to
    x+overhead.

    Also, tunnel might be configured to force DF bit on outer header.

    In this case, packet will be dropped (exceeds MTU) and an ICMP error is
    generated back to sender.

    But sender already respects the announced MTU, all the packets that
    it sent did fit the announced mtu.

    Force refragmentation as per original sizes unconditionally so ip tunnel
    will encapsulate the fragments instead.

    The only other solution I see is to place ip refragmentation in
    the ip_tunnel code to handle this case.

    Fixes: d6b915e29f4ad ("ip_fragment: don't forward defragmented DF packet")
    Reported-by: Christian Perle
    Signed-off-by: Florian Westphal
    Acked-by: Pablo Neira Ayuso
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Florian Westphal
     
  • [ Upstream commit 50c661670f6a3908c273503dfa206dfc7aa54c07 ]

    For some reason ip_tunnel insist on setting the DF bit anyway when the
    inner header has the DF bit set, EVEN if the tunnel was configured with
    'nopmtudisc'.

    This means that the script added in the previous commit
    cannot be made to work by adding the 'nopmtudisc' flag to the
    ip tunnel configuration. Doing so breaks connectivity even for the
    without-conntrack/netfilter scenario.

    When nopmtudisc is set, the tunnel will skip the mtu check, so no
    icmp error is sent to client. Then, because inner header has DF set,
    the outer header gets added with DF bit set as well.

    IP stack then sends an error to itself because the packet exceeds
    the device MTU.

    Fixes: 23a3647bc4f93 ("ip_tunnels: Use skb-len to PMTU check.")
    Cc: Stefano Brivio
    Signed-off-by: Florian Westphal
    Acked-by: Pablo Neira Ayuso
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Florian Westphal
     
  • [ Upstream commit d8f5c29653c3f6995e8979be5623d263e92f6b86 ]

    Route removal is handled by two code paths. The main removal path is via
    fib6_del_route() which will handle purging any PMTU exceptions from the
    cache, removing all per-cpu copies of the DST entry used by the route, and
    releasing the fib6_info struct.

    The second removal location is during fib6_add_rt2node() during a route
    replacement operation. This path also calls fib6_purge_rt() to handle
    cleaning up the per-cpu copies of the DST entries and releasing the
    fib6_info associated with the older route, but it does not flush any PMTU
    exceptions that the older route had. Since the older route is removed from
    the tree during the replacement, we lose any way of accessing it again.

    As these lingering DSTs and the fib6_info struct are holding references to
    the underlying netdevice struct as well, unregistering that device from the
    kernel can never complete.

    Fixes: 2b760fcf5cfb3 ("ipv6: hook up exception table to store dst cache")
    Signed-off-by: Sean Tranchetti
    Reviewed-by: David Ahern
    Link: https://lore.kernel.org/r/1609892546-11389-1-git-send-email-stranche@quicinc.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Sean Tranchetti
     
  • [ Upstream commit 55b7ab1178cbf41f979ff83236d3321ad35ed2ad ]

    VLAN checks for NETREG_UNINITIALIZED to distinguish between
    registration failure and unregistration in progress.

    Since commit cb626bf566eb ("net-sysfs: Fix reference count leak")
    registration failure may, however, result in NETREG_UNREGISTERED
    as well as NETREG_UNINITIALIZED.

    This fix is similer to cebb69754f37 ("rtnetlink: Fix
    memory(net_device) leak when ->newlink fails")

    Fixes: cb626bf566eb ("net-sysfs: Fix reference count leak")
    Signed-off-by: Jakub Kicinski
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Jakub Kicinski
     

15 Jan, 2021

1 commit

  • Instead of casting callback functions to type iw_handler, which trips
    indirect call checking with Clang's Control-Flow Integrity (CFI), add
    stub functions with the correct function type for the callbacks.

    Bug: 145210207
    Change-Id: Ief26496449ec985d600dd06b5e190dd21bf8eb4a
    Link: https://lore.kernel.org/lkml/20201117205902.405316-1-samitolvanen@google.com/
    Reported-by: Sedat Dilek
    Signed-off-by: Sami Tolvanen

    Sami Tolvanen
     

13 Jan, 2021

13 commits

  • Changes in 5.10.7
    i40e: Fix Error I40E_AQ_RC_EINVAL when removing VFs
    iavf: fix double-release of rtnl_lock
    net/sched: sch_taprio: ensure to reset/destroy all child qdiscs
    net: mvpp2: Add TCAM entry to drop flow control pause frames
    net: mvpp2: prs: fix PPPoE with ipv6 packet parse
    net: systemport: set dev->max_mtu to UMAC_MAX_MTU_SIZE
    ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()
    ethernet: ucc_geth: set dev->max_mtu to 1518
    ionic: account for vlan tag len in rx buffer len
    atm: idt77252: call pci_disable_device() on error path
    net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
    net: stmmac: dwmac-meson8b: ignore the second clock input
    ibmvnic: fix login buffer memory leak
    ibmvnic: continue fatal error reset after passive init
    net: ethernet: mvneta: Fix error handling in mvneta_probe
    qede: fix offload for IPIP tunnel packets
    virtio_net: Fix recursive call to cpus_read_lock()
    net/ncsi: Use real net-device for response handler
    net: ethernet: Fix memleak in ethoc_probe
    net-sysfs: take the rtnl lock when storing xps_cpus
    net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc
    net-sysfs: take the rtnl lock when storing xps_rxqs
    net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc
    net: ethernet: ti: cpts: fix ethtool output when no ptp_clock registered
    tun: fix return value when the number of iovs exceeds MAX_SKB_FRAGS
    e1000e: Only run S0ix flows if shutdown succeeded
    e1000e: bump up timeout to wait when ME un-configures ULP mode
    Revert "e1000e: disable s0ix entry and exit flows for ME systems"
    e1000e: Export S0ix flags to ethtool
    bnxt_en: Check TQM rings for maximum supported value.
    net: mvpp2: fix pkt coalescing int-threshold configuration
    bnxt_en: Fix AER recovery.
    ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst()
    net: sched: prevent invalid Scell_log shift count
    net: hns: fix return value check in __lb_other_process()
    erspan: fix version 1 check in gre_parse_header()
    net: hdlc_ppp: Fix issues when mod_timer is called while timer is running
    bareudp: set NETIF_F_LLTX flag
    bareudp: Fix use of incorrect min_headroom size
    vhost_net: fix ubuf refcount incorrectly when sendmsg fails
    r8169: work around power-saving bug on some chip versions
    net: dsa: lantiq_gswip: Enable GSWIP_MII_CFG_EN also for internal PHYs
    net: dsa: lantiq_gswip: Fix GSWIP_MII_CFG(p) register access
    CDC-NCM: remove "connected" log message
    ibmvnic: fix: NULL pointer dereference.
    net: usb: qmi_wwan: add Quectel EM160R-GL
    selftests: mlxsw: Set headroom size of correct port
    stmmac: intel: Add PCI IDs for TGL-H platform
    selftests/vm: fix building protection keys test
    block: add debugfs stanza for QUEUE_FLAG_NOWAIT
    workqueue: Kick a worker based on the actual activation of delayed works
    scsi: ufs: Fix wrong print message in dev_err()
    scsi: ufs-pci: Fix restore from S4 for Intel controllers
    scsi: ufs-pci: Ensure UFS device is in PowerDown mode for suspend-to-disk ->poweroff()
    scsi: ufs-pci: Fix recovery from hibernate exit errors for Intel controllers
    scsi: ufs-pci: Enable UFSHCD_CAP_RPM_AUTOSUSPEND for Intel controllers
    scsi: block: Introduce BLK_MQ_REQ_PM
    scsi: ide: Do not set the RQF_PREEMPT flag for sense requests
    scsi: ide: Mark power management requests with RQF_PM instead of RQF_PREEMPT
    scsi: scsi_transport_spi: Set RQF_PM for domain validation commands
    scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE
    local64.h: make mandatory
    lib/genalloc: fix the overflow when size is too big
    depmod: handle the case of /sbin/depmod without /sbin in PATH
    scsi: ufs: Clear UAC for FFU and RPMB LUNs
    kbuild: don't hardcode depmod path
    Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close
    scsi: block: Remove RQF_PREEMPT and BLK_MQ_REQ_PREEMPT
    scsi: block: Do not accept any requests while suspended
    crypto: ecdh - avoid buffer overflow in ecdh_set_secret()
    crypto: asym_tpm: correct zero out potential secrets
    powerpc: Handle .text.{hot,unlikely}.* in linker script
    Staging: comedi: Return -EFAULT if copy_to_user() fails
    staging: mt7621-dma: Fix a resource leak in an error handling path
    usb: gadget: enable super speed plus
    USB: cdc-acm: blacklist another IR Droid device
    USB: cdc-wdm: Fix use after free in service_outstanding_interrupt().
    usb: typec: intel_pmc_mux: Configure HPD first for HPD+IRQ request
    usb: dwc3: meson-g12a: disable clk on error handling path in probe
    usb: dwc3: gadget: Restart DWC3 gadget when enabling pullup
    usb: dwc3: gadget: Clear wait flag on dequeue
    usb: dwc3: ulpi: Use VStsDone to detect PHY regs access completion
    usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one
    usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression
    usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data()
    USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set
    usb: usbip: vhci_hcd: protect shift size
    usb: uas: Add PNY USB Portable SSD to unusual_uas
    USB: serial: iuu_phoenix: fix DMA from stack
    USB: serial: option: add LongSung M5710 module support
    USB: serial: option: add Quectel EM160R-GL
    USB: yurex: fix control-URB timeout handling
    USB: usblp: fix DMA to stack
    ALSA: usb-audio: Fix UBSAN warnings for MIDI jacks
    usb: gadget: select CONFIG_CRC32
    USB: Gadget: dummy-hcd: Fix shift-out-of-bounds bug
    usb: gadget: f_uac2: reset wMaxPacketSize
    usb: gadget: function: printer: Fix a memory leak for interface descriptor
    usb: gadget: u_ether: Fix MTU size mismatch with RX packet size
    USB: gadget: legacy: fix return error code in acm_ms_bind()
    usb: gadget: Fix spinlock lockup on usb_function_deactivate
    usb: gadget: configfs: Preserve function ordering after bind failure
    usb: gadget: configfs: Fix use-after-free issue with udc_name
    USB: serial: keyspan_pda: remove unused variable
    hwmon: (amd_energy) fix allocation of hwmon_channel_info config
    mm: make wait_on_page_writeback() wait for multiple pending writebacks
    x86/mm: Fix leak of pmd ptlock
    KVM: x86/mmu: Use -1 to flag an undefined spte in get_mmio_spte()
    KVM: x86/mmu: Get root level from walkers when retrieving MMIO SPTE
    kvm: check tlbs_dirty directly
    KVM: x86/mmu: Ensure TDP MMU roots are freed after yield
    x86/resctrl: Use an IPI instead of task_work_add() to update PQR_ASSOC MSR
    x86/resctrl: Don't move a task to the same resource group
    blk-iocost: fix NULL iocg deref from racing against initialization
    ALSA: hda/via: Fix runtime PM for Clevo W35xSS
    ALSA: hda/conexant: add a new hda codec CX11970
    ALSA: hda/realtek - Fix speaker volume control on Lenovo C940
    ALSA: hda/realtek: Add mute LED quirk for more HP laptops
    ALSA: hda/realtek: Enable mute and micmute LED on HP EliteBook 850 G7
    ALSA: hda/realtek: Add two "Intel Reference board" SSID in the ALC256.
    iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev
    btrfs: qgroup: don't try to wait flushing if we're already holding a transaction
    btrfs: send: fix wrong file path when there is an inode with a pending rmdir
    Revert "device property: Keep secondary firmware node secondary by type"
    dmabuf: fix use-after-free of dmabuf's file->f_inode
    arm64: link with -z norelro for LLD or aarch64-elf
    drm/i915: clear the shadow batch
    drm/i915: clear the gpu reloc batch
    bcache: fix typo from SUUP to SUPP in features.h
    bcache: check unsupported feature sets for bcache register
    bcache: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for large bucket
    net/mlx5e: Fix SWP offsets when vlan inserted by driver
    ARM: dts: OMAP3: disable AES on N950/N9
    netfilter: x_tables: Update remaining dereference to RCU
    netfilter: ipset: fix shift-out-of-bounds in htable_bits()
    netfilter: xt_RATEEST: reject non-null terminated string from userspace
    netfilter: nft_dynset: report EOPNOTSUPP on missing set feature
    dmaengine: idxd: off by one in cleanup code
    x86/mtrr: Correct the range check before performing MTRR type lookups
    KVM: x86: fix shift out of bounds reported by UBSAN
    xsk: Fix memory leak for failed bind
    rtlwifi: rise completion at the last step of firmware callback
    scsi: target: Fix XCOPY NAA identifier lookup
    Linux 5.10.7

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: I1a7c195af35831fe362b027fe013c0c7e4dc20ea

    Greg Kroah-Hartman
     
  • Changes in 5.10.6
    Revert "drm/amd/display: Fix memory leaks in S3 resume"
    Revert "mtd: spinand: Fix OOB read"
    rtc: pcf2127: move watchdog initialisation to a separate function
    rtc: pcf2127: only use watchdog when explicitly available
    dt-bindings: rtc: add reset-source property
    kdev_t: always inline major/minor helper functions
    Bluetooth: Fix attempting to set RPA timeout when unsupported
    ALSA: hda/realtek - Modify Dell platform name
    ALSA: hda/hdmi: Fix incorrect mutex unlock in silent_stream_disable()
    drm/i915/tgl: Fix Combo PHY DPLL fractional divider for 38.4MHz ref clock
    scsi: ufs: Allow an error return value from ->device_reset()
    scsi: ufs: Re-enable WriteBooster after device reset
    RDMA/core: remove use of dma_virt_ops
    RDMA/siw,rxe: Make emulated devices virtual in the device tree
    fuse: fix bad inode
    perf: Break deadlock involving exec_update_mutex
    rwsem: Implement down_read_killable_nested
    rwsem: Implement down_read_interruptible
    exec: Transform exec_update_mutex into a rw_semaphore
    mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start
    Linux 5.10.6

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: Id4c57a151a1e8f2162163d2337b6055f04edbe9b

    Greg Kroah-Hartman
     
  • commit 8bee683384087a6275c9183a483435225f7bb209 upstream.

    Fix a possible memory leak when a bind of an AF_XDP socket fails. When
    the fill and completion rings are created, they are tied to the
    socket. But when the buffer pool is later created at bind time, the
    ownership of these two rings are transferred to the buffer pool as
    they might be shared between sockets (and the buffer pool cannot be
    created until we know what we are binding to). So, before the buffer
    pool is created, these two rings are cleaned up with the socket, and
    after they have been transferred they are cleaned up together with
    the buffer pool.

    The problem is that ownership was transferred before it was absolutely
    certain that the buffer pool could be created and initialized
    correctly and when one of these errors occurred, the fill and
    completion rings did neither belong to the socket nor the pool and
    where therefore leaked. Solve this by moving the ownership transfer
    to the point where the buffer pool has been completely set up and
    there is no way it can fail.

    Fixes: 7361f9c3d719 ("xsk: Move fill and completion rings to buffer pool")
    Reported-by: syzbot+cfa88ddd0655afa88763@syzkaller.appspotmail.com
    Signed-off-by: Magnus Karlsson
    Signed-off-by: Daniel Borkmann
    Acked-by: Björn Töpel
    Link: https://lore.kernel.org/bpf/20201214085127.3960-1-magnus.karlsson@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Magnus Karlsson
     
  • commit 95cd4bca7b1f4a25810f3ddfc5e767fb46931789 upstream.

    If userspace requests a feature which is not available the original set
    definition, then bail out with EOPNOTSUPP. If userspace sends
    unsupported dynset flags (new feature not supported by this kernel),
    then report EOPNOTSUPP to userspace. EINVAL should be only used to
    report malformed netlink messages from userspace.

    Fixes: 22fe54d5fefc ("netfilter: nf_tables: add support for dynamic set updates")
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Greg Kroah-Hartman

    Pablo Neira Ayuso
     
  • commit 6cb56218ad9e580e519dcd23bfb3db08d8692e5a upstream.

    syzbot reports:
    detected buffer overflow in strlen
    [..]
    Call Trace:
    strlen include/linux/string.h:325 [inline]
    strlcpy include/linux/string.h:348 [inline]
    xt_rateest_tg_checkentry+0x2a5/0x6b0 net/netfilter/xt_RATEEST.c:143

    strlcpy assumes src is a c-string. Check info->name before its used.

    Reported-by: syzbot+e86f7c428c8c50db65b4@syzkaller.appspotmail.com
    Fixes: 5859034d7eb8793 ("[NETFILTER]: x_tables: add RATEEST target")
    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Greg Kroah-Hartman

    Florian Westphal
     
  • commit 5c8193f568ae16f3242abad6518dc2ca6c8eef86 upstream.

    htable_bits() can call jhash_size(32) and trigger shift-out-of-bounds

    UBSAN: shift-out-of-bounds in net/netfilter/ipset/ip_set_hash_gen.h:151:6
    shift exponent 32 is too large for 32-bit type 'unsigned int'
    CPU: 0 PID: 8498 Comm: syz-executor519
    Not tainted 5.10.0-rc7-next-20201208-syzkaller #0
    Call Trace:
    __dump_stack lib/dump_stack.c:79 [inline]
    dump_stack+0x107/0x163 lib/dump_stack.c:120
    ubsan_epilogue+0xb/0x5a lib/ubsan.c:148
    __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:395
    htable_bits net/netfilter/ipset/ip_set_hash_gen.h:151 [inline]
    hash_mac_create.cold+0x58/0x9b net/netfilter/ipset/ip_set_hash_gen.h:1524
    ip_set_create+0x610/0x1380 net/netfilter/ipset/ip_set_core.c:1115
    nfnetlink_rcv_msg+0xecc/0x1180 net/netfilter/nfnetlink.c:252
    netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
    nfnetlink_rcv+0x1ac/0x420 net/netfilter/nfnetlink.c:600
    netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
    netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330
    netlink_sendmsg+0x907/0xe40 net/netlink/af_netlink.c:1919
    sock_sendmsg_nosec net/socket.c:652 [inline]
    sock_sendmsg+0xcf/0x120 net/socket.c:672
    ____sys_sendmsg+0x6e8/0x810 net/socket.c:2345
    ___sys_sendmsg+0xf3/0x170 net/socket.c:2399
    __sys_sendmsg+0xe5/0x1b0 net/socket.c:2432
    do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    This patch replaces htable_bits() by simple fls(hashsize - 1) call:
    it alone returns valid nbits both for round and non-round hashsizes.
    It is normal to set any nbits here because it is validated inside
    following htable_size() call which returns 0 for nbits>31.

    Fixes: 1feab10d7e6d("netfilter: ipset: Unified hash type generation")
    Reported-by: syzbot+d66bfadebca46cf61a2b@syzkaller.appspotmail.com
    Signed-off-by: Vasily Averin
    Acked-by: Jozsef Kadlecsik
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Greg Kroah-Hartman

    Vasily Averin
     
  • commit 443d6e86f821a165fae3fc3fc13086d27ac140b1 upstream.

    This fixes the dereference to fetch the RCU pointer when holding
    the appropriate xtables lock.

    Reported-by: kernel test robot
    Fixes: cc00bcaa5899 ("netfilter: x_tables: Switch synchronization to RCU")
    Signed-off-by: Subash Abhinov Kasiviswanathan
    Reviewed-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Greg Kroah-Hartman

    Subash Abhinov Kasiviswanathan
     
  • [ Upstream commit 085c7c4e1c0e50d90b7d90f61a12e12b317a91e2 ]

    Both version 0 and version 1 use ETH_P_ERSPAN, but version 0 does not
    have an erspan header. So the check in gre_parse_header() is wrong,
    we have to distinguish version 1 from version 0.

    We can just check the gre header length like is_erspan_type1().

    Fixes: cb73ee40b1b3 ("net: ip_gre: use erspan key field for tunnel lookup")
    Reported-by: syzbot+f583ce3d4ddf9836b27a@syzkaller.appspotmail.com
    Cc: William Tu
    Cc: Lorenzo Bianconi
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Cong Wang
     
  • [ Upstream commit bd1248f1ddbc48b0c30565fce897a3b6423313b8 ]

    Check Scell_log shift size in red_check_params() and modify all callers
    of red_check_params() to pass Scell_log.

    This prevents a shift out-of-bounds as detected by UBSAN:
    UBSAN: shift-out-of-bounds in ./include/net/red.h:252:22
    shift exponent 72 is too large for 32-bit type 'int'

    Fixes: 8afa10cbe281 ("net_sched: red: Avoid illegal values")
    Signed-off-by: Randy Dunlap
    Reported-by: syzbot+97c5bd9cc81eca63d36e@syzkaller.appspotmail.com
    Cc: Nogah Frankel
    Cc: Jamal Hadi Salim
    Cc: Cong Wang
    Cc: Jiri Pirko
    Cc: netdev@vger.kernel.org
    Cc: "David S. Miller"
    Cc: Jakub Kicinski
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • [ Upstream commit 21fdca22eb7df2a1e194b8adb812ce370748b733 ]

    RT_TOS() only clears one of the ECN bits. Therefore, when
    fib_compute_spec_dst() resorts to a fib lookup, it can return
    different results depending on the value of the second ECN bit.

    For example, ECT(0) and ECT(1) packets could be treated differently.

    $ ip netns add ns0
    $ ip netns add ns1
    $ ip link add name veth01 netns ns0 type veth peer name veth10 netns ns1
    $ ip -netns ns0 link set dev lo up
    $ ip -netns ns1 link set dev lo up
    $ ip -netns ns0 link set dev veth01 up
    $ ip -netns ns1 link set dev veth10 up

    $ ip -netns ns0 address add 192.0.2.10/24 dev veth01
    $ ip -netns ns1 address add 192.0.2.11/24 dev veth10

    $ ip -netns ns1 address add 192.0.2.21/32 dev lo
    $ ip -netns ns1 route add 192.0.2.10/32 tos 4 dev veth10 src 192.0.2.21
    $ ip netns exec ns1 sysctl -wq net.ipv4.icmp_echo_ignore_broadcasts=0

    With TOS 4 and ECT(1), ns1 replies using source address 192.0.2.21
    (ping uses -Q to set all TOS and ECN bits):

    $ ip netns exec ns0 ping -c 1 -b -Q 5 192.0.2.255
    [...]
    64 bytes from 192.0.2.21: icmp_seq=1 ttl=64 time=0.544 ms

    But with TOS 4 and ECT(0), ns1 replies using source address 192.0.2.11
    because the "tos 4" route isn't matched:

    $ ip netns exec ns0 ping -c 1 -b -Q 6 192.0.2.255
    [...]
    64 bytes from 192.0.2.11: icmp_seq=1 ttl=64 time=0.597 ms

    After this patch the ECN bits don't affect the result anymore:

    $ ip netns exec ns0 ping -c 1 -b -Q 6 192.0.2.255
    [...]
    64 bytes from 192.0.2.21: icmp_seq=1 ttl=64 time=0.591 ms

    Fixes: 35ebf65e851c ("ipv4: Create and use fib_compute_spec_dst() helper.")
    Signed-off-by: Guillaume Nault
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Guillaume Nault
     
  • [ Upstream commit 4ae2bb81649dc03dfc95875f02126b14b773f7ab ]

    Accesses to dev->xps_rxqs_map (when using dev->num_tc) should be
    protected by the rtnl lock, like we do for netif_set_xps_queue. I didn't
    see an actual bug being triggered, but let's be safe here and take the
    rtnl lock while accessing the map in sysfs.

    Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue")
    Signed-off-by: Antoine Tenart
    Reviewed-by: Alexander Duyck
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Antoine Tenart
     
  • [ Upstream commit 2d57b4f142e0b03e854612b8e28978935414bced ]

    Two race conditions can be triggered when storing xps rxqs, resulting in
    various oops and invalid memory accesses:

    1. Calling netdev_set_num_tc while netif_set_xps_queue:

    - netif_set_xps_queue uses dev->tc_num as one of the parameters to
    compute the size of new_dev_maps when allocating it. dev->tc_num is
    also used to access the map, and the compiler may generate code to
    retrieve this field multiple times in the function.

    - netdev_set_num_tc sets dev->tc_num.

    If new_dev_maps is allocated using dev->tc_num and then dev->tc_num
    is set to a higher value through netdev_set_num_tc, later accesses to
    new_dev_maps in netif_set_xps_queue could lead to accessing memory
    outside of new_dev_maps; triggering an oops.

    2. Calling netif_set_xps_queue while netdev_set_num_tc is running:

    2.1. netdev_set_num_tc starts by resetting the xps queues,
    dev->tc_num isn't updated yet.

    2.2. netif_set_xps_queue is called, setting up the map with the
    *old* dev->num_tc.

    2.3. netdev_set_num_tc updates dev->tc_num.

    2.4. Later accesses to the map lead to out of bound accesses and
    oops.

    A similar issue can be found with netdev_reset_tc.

    One way of triggering this is to set an iface up (for which the driver
    uses netdev_set_num_tc in the open path, such as bnx2x) and writing to
    xps_rxqs in a concurrent thread. With the right timing an oops is
    triggered.

    Both issues have the same fix: netif_set_xps_queue, netdev_set_num_tc
    and netdev_reset_tc should be mutually exclusive. We do that by taking
    the rtnl lock in xps_rxqs_store.

    Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue")
    Signed-off-by: Antoine Tenart
    Reviewed-by: Alexander Duyck
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Antoine Tenart
     
  • [ Upstream commit fb25038586d0064123e393cadf1fadd70a9df97a ]

    Accesses to dev->xps_cpus_map (when using dev->num_tc) should be
    protected by the rtnl lock, like we do for netif_set_xps_queue. I didn't
    see an actual bug being triggered, but let's be safe here and take the
    rtnl lock while accessing the map in sysfs.

    Fixes: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes")
    Signed-off-by: Antoine Tenart
    Reviewed-by: Alexander Duyck
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Antoine Tenart