1. 04 Mar, 2021 2 commits
  2. 02 Mar, 2021 1 commit
  3. 27 Feb, 2021 6 commits
    • Vasily Averin's avatar
      netfilter: x_tables: gpf inside xt_find_revision() · 8e24eddd
      Vasily Averin authored
      nested target/match_revfn() calls work with xt[NFPROTO_UNSPEC] lists
      without taking xt[NFPROTO_UNSPEC].mutex. This can race with module unload
      and cause host to crash:
      
      general protection fault: 0000 [#1]
      Modules linked in: ... [last unloaded: xt_cluster]
      CPU: 0 PID: 542455 Comm: iptables
      RIP: 0010:[<ffffffff8ffbd518>]  [<ffffffff8ffbd518>] strcmp+0x18/0x40
      RDX: 0000000000000003 RSI: ffff9a5a5d9abe10 RDI: dead000000000111
      R13: ffff9a5a5d9abe10 R14: ffff9a5a5d9abd8c R15: dead000000000100
      (VvS: %R15 -- &xt_match,  %RDI -- &xt_match.name,
      xt_cluster unregister match in xt[NFPROTO_UNSPEC].match list)
      Call Trace:
       [<ffffffff902ccf44>] match_revfn+0x54/0xc0
       [<ffffffff902ccf9f>] match_revfn+0xaf/0xc0
       [<ffffffff902cd01e>] xt_find_revision+0x6e/0xf0
       [<ffffffffc05a5be0>] do_ipt_get_ctl+0x100/0x420 [ip_tables]
       [<ffffffff902cc6bf>] nf_getsockopt+0x4f/0x70
       [<ffffffff902dd99e>] ip_getsockopt+0xde/0x100
       [<ffffffff903039b5>] raw_getsockopt+0x25/0x50
       [<ffffffff9026c5da>] sock_common_getsockopt+0x1a/0x20
       [<ffffffff9026b89d>] SyS_getsockopt+0x7d/0xf0
       [<ffffffff903cbf92>] system_call_fastpath+0x25/0x2a
      
      Fixes: 656caff2 ("netfilter 04/09: x_tables: fix match/target revision lookup")
      Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      8e24eddd
    • Florian Westphal's avatar
      selftests: netfilter: test nat port clash resolution interaction with tcp early demux · c2c16ccb
      Florian Westphal authored
      Convert Antonio Ojeas bug reproducer to a kselftest.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c2c16ccb
    • Florian Westphal's avatar
      netfilter: conntrack: avoid misleading 'invalid' in log message · 07b5a76e
      Florian Westphal authored
      The packet is not flagged as invalid: conntrack will accept it and
      its associated with the conntrack entry.
      
      This happens e.g. when receiving a retransmitted SYN in SYN_RECV state.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      07b5a76e
    • Florian Westphal's avatar
      netfilter: nf_nat: undo erroneous tcp edemux lookup · 03a3ca37
      Florian Westphal authored
      Under extremely rare conditions TCP early demux will retrieve the wrong
      socket.
      
      1. local machine establishes a connection to a remote server, S, on port
         p.
      
         This gives:
         laddr:lport -> S:p
         ... both in tcp and conntrack.
      
      2. local machine establishes a connection to host H, on port p2.
         2a. TCP stack choses same laddr:lport, so we have
         laddr:lport -> H:p2 from TCP point of view.
         2b). There is a destination NAT rewrite in place, translating
              H:p2 to S:p.  This results in following conntrack entries:
      
         I)  laddr:lport -> S:p  (origin)  S:p -> laddr:lport (reply)
         II) laddr:lport -> H:p2 (origin)  S:p -> laddr:lport2 (reply)
      
         NAT engine has rewritten laddr:lport to laddr:lport2 to map
         the reply packet to the correct origin.
      
         When server sends SYN/ACK to laddr:lport2, the PREROUTING hook
         will undo-the SNAT transformation, rewriting IP header to
         S:p -> laddr:lport
      
         This causes TCP early demux to associate the skb with the TCP socket
         of the first connection.
      
         The INPUT hook will then reverse the DNAT transformation, rewriting
         the IP header to H:p2 -> laddr:lport.
      
      Because packet ends up with the wrong socket, the new connection
      never completes: originator stays in SYN_SENT and conntrack entry
      remains in SYN_RECV until timeout, and responder retransmits SYN/ACK
      until it gives up.
      
      To resolve this, orphan the skb after the input rewrite:
      Because the source IP address changed, the socket must be incorrect.
      We can't move the DNAT undo to prerouting due to backwards
      compatibility, doing so will make iptables/nftables rules to no longer
      match the way they did.
      
      After orphan, the packet will be handed to the next protocol layer
      (tcp, udp, ...) and that will repeat the socket lookup just like as if
      early demux was disabled.
      
      Fixes: 41063e9d ("ipv4: Early TCP socket demux.")
      Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1427Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      03a3ca37
    • Klemen Košir's avatar
      netfilter: conntrack: Remove a double space in a log message · c57ea2d7
      Klemen Košir authored
      Removed an extra space in a log message and an extra blank line in code.
      Signed-off-by: default avatarKlemen Košir <klemen.kosir@kream.io>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c57ea2d7
    • Dmitry V. Levin's avatar
      uapi: nfnetlink_cthelper.h: fix userspace compilation error · c33cb002
      Dmitry V. Levin authored
      Apparently, <linux/netfilter/nfnetlink_cthelper.h> and
      <linux/netfilter/nfnetlink_acct.h> could not be included into the same
      compilation unit because of a cut-and-paste typo in the former header.
      
      Fixes: 12f7a505 ("netfilter: add user-space connection tracking helper infrastructure")
      Cc: <stable@vger.kernel.org> # v3.6
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c33cb002
  4. 26 Feb, 2021 25 commits
  5. 25 Feb, 2021 6 commits
    • Linus Torvalds's avatar
      Merge tag 'pwm/for-5.12-rc1' of... · 2c87f7a3
      Linus Torvalds authored
      Merge tag 'pwm/for-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
      
      Pull pwm updates from Thierry Reding:
       "The ZTE ZX platform is being removed, so the PWM driver is no longer
        needed and removed as well.
      
        Other than that this contains a small set of fixes and cleanups across
        a couple of drivers"
      
      * tag 'pwm/for-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
        pwm: lpc18xx-sct: remove unneeded semicolon
        pwm: iqs620a: Correct a stale state variable
        pwm: iqs620a: Fix overflow and optimize calculations
        pwm: rockchip: Enable clock before calling clk_get_rate()
        pwm: rockchip: Eliminate potential race condition when probing
        pwm: rockchip: Replace "bus clk" with "PWM clk"
        pwm: rockchip: rockchip_pwm_probe(): Remove superfluous clk_unprepare()
        pwm: rockchip: Enable APB clock during register access while probing
        pwm: Remove ZTE ZX driver
      2c87f7a3
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · ffc17596
      Linus Torvalds authored
      Pull virtio updates from Michael Tsirkin:
      
       - new vdpa features to allow creation and deletion of new devices
      
       - virtio-blk support per-device queue depth
      
       - fixes, cleanups all over the place
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (31 commits)
        virtio-input: add multi-touch support
        virtio_mmio: fix one typo
        vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()
        virtio_net: Fix fall-through warnings for Clang
        virtio_input: Prevent EV_MSC/MSC_TIMESTAMP loop storm for MT.
        virtio-blk: support per-device queue depth
        virtio_vdpa: don't warn when fail to disable vq
        virtio-pci: introduce modern device module
        virito-pci-modern: rename map_capability() to vp_modern_map_capability()
        virtio-pci-modern: introduce helper to get notification offset
        virtio-pci-modern: introduce helper for getting queue nums
        virtio-pci-modern: introduce helper for setting/geting queue size
        virtio-pci-modern: introduce helper to set/get queue_enable
        virtio-pci-modern: introduce vp_modern_queue_address()
        virtio-pci-modern: introduce vp_modern_set_queue_vector()
        virtio-pci-modern: introduce vp_modern_generation()
        virtio-pci-modern: introduce helpers for setting and getting features
        virtio-pci-modern: introduce helpers for setting and getting status
        virtio-pci-modern: introduce helper to set config vector
        virtio-pci-modern: introduce vp_modern_remove()
        ...
      ffc17596
    • Linus Torvalds's avatar
      Merge tag 'mips_5.12_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · a6525b99
      Linus Torvalds authored
      Pull more MIPS updates from Thomas Bogendoerfer:
      
       - added n64 block driver
      
       - fix for ubsan warnings
      
       - fix for bcm63xx platform
      
       - update of linux-mips mailinglist
      
      * tag 'mips_5.12_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        arch: mips: update references to current linux-mips list
        mips: bmips: init clocks earlier
        vmlinux.lds.h: catch even more instrumentation symbols into .data
        n64: store dev instance into disk private data
        n64: cleanup n64cart_probe()
        n64: cosmetics changes
        n64: remove curly brackets
        n64: use sector SECTOR_SHIFT instead 512
        n64: use enums for reg
        n64: move module param at the top
        n64: move module info at the end
        n64: use pr_fmt to avoid duplicate string
        block: Add n64 cart driver
      a6525b99
    • Linus Torvalds's avatar
      Merge tag 'drm-next-2021-02-26' of git://anongit.freedesktop.org/drm/drm · fdce2960
      Linus Torvalds authored
      Pull more drm updates from Dave Airlie:
       "This is mostly fixes but I missed msm-next pull last week. It's been
        in drm-next.
      
        Otherwise it's a selection of i915, amdgpu and misc fixes, one TTM
        memory leak, nothing really major stands out otherwise.
      
        core:
         - vblank fence timing improvements
      
        dma-buf:
         - improve error handling
      
        ttm:
         - memory leak fix
      
        msm:
         - a6xx speedbin support
         - a508, a509, a512 support
         - various a5xx fixes
         - various dpu fixes
         - qseed3lite support for sm8250
         - dsi fix for msm8994
         - mdp5 fix for framerate bug with cmd mode panels
         - a6xx GMU OOB race fixes that were showing up in CI
         - various addition and removal of semicolons
         - gem submit fix for legacy userspace relocs path
      
        amdgpu:
         - clang warning fix
         - S0ix platform shutdown/poweroff fix
         - misc display fixes
      
        i915:
         - color format fix
         - -Wuninitialised reenabled
         - GVT ww locking, cmd parser fixes
      
        atyfb:
         - fix build
      
        rockchip:
         - AFBC modifier fix"
      
      * tag 'drm-next-2021-02-26' of git://anongit.freedesktop.org/drm/drm: (60 commits)
        drm/panel: kd35t133: allow using non-continuous dsi clock
        drm/rockchip: Require the YTR modifier for AFBC
        drm/ttm: Fix a memory leak
        drm/drm_vblank: set the dma-fence timestamp during send_vblank_event
        dma-fence: allow signaling drivers to set fence timestamp
        dma-buf: heaps: Rework heap allocation hooks to return struct dma_buf instead of fd
        dma-buf: system_heap: Make sure to return an error if we abort
        drm/amd/display: Fix system hang after multiple hotplugs (v3)
        drm/amdgpu: fix shutdown and poweroff process failed with s0ix
        drm/i915: Nuke INTEL_OUTPUT_FORMAT_INVALID
        drm/i915: Enable -Wuninitialized
        drm/amd/display: Remove Assert from dcn10_get_dig_frontend
        drm/amd/display: Add vupdate_no_lock interrupts for DCN2.1
        Revert "drm/amd/display: reuse current context instead of recreating one"
        drm/amd/pm/swsmu: Avoid using structure_size uninitialized in smu_cmn_init_soft_gpu_metrics
        fbdev: atyfb: add stubs for aty_{ld,st}_lcd()
        drm/i915/gvt: Introduce per object locking in GVT scheduler.
        drm/i915/gvt: Purge dev_priv->gt
        drm/i915/gvt: Parse default state to update reg whitelist
        dt-bindings: dp-connector: Drop maxItems from -supply
        ...
      fdce2960
    • Linus Torvalds's avatar
      Merge tag 'net-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 5ad3dbab
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Rather small batch this time.
      
        Current release - regressions:
      
         - bcm63xx_enet: fix sporadic kernel panic due to queue length
           mis-accounting
      
        Current release - new code bugs:
      
         - bcm4908_enet: fix RX path possible mem leak
      
         - bcm4908_enet: fix NAPI poll returned value
      
         - stmmac: fix missing spin_lock_init in visconti_eth_dwmac_probe()
      
         - sched: cls_flower: validate ct_state for invalid and reply flags
      
        Previous releases - regressions:
      
         - net: introduce CAN specific pointer in the struct net_device to
           prevent mis-interpreting memory
      
         - phy: micrel: set soft_reset callback to genphy_soft_reset for
           KSZ8081
      
         - psample: fix netlink skb length with tunnel info
      
        Previous releases - always broken:
      
         - icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending
      
         - wireguard: device: do not generate ICMP for non-IP packets
      
         - mptcp: provide subflow aware release function to avoid a mem leak
      
         - hsr: add support for EntryForgetTime
      
         - r8169: fix jumbo packet handling on RTL8168e
      
         - octeontx2-af: fix an off by one in rvu_dbg_qsize_write()
      
         - i40e: fix flow for IPv6 next header (extension header)
      
         - phy: icplus: call phy_restore_page() when phy_select_page() fails
      
         - dpaa_eth: fix the access method for the dpaa_napi_portal"
      
      * tag 'net-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (55 commits)
        r8169: fix jumbo packet handling on RTL8168e
        net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ8081
        net: psample: Fix netlink skb length with tunnel info
        net: broadcom: bcm4908_enet: fix NAPI poll returned value
        net: broadcom: bcm4908_enet: fix RX path possible mem leak
        net: hsr: add support for EntryForgetTime
        net: dsa: sja1105: Remove unneeded cast in sja1105_crc32()
        ibmvnic: fix a race between open and reset
        net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()
        net: introduce CAN specific pointer in the struct net_device
        net: usb: qmi_wwan: support ZTE P685M modem
        wireguard: kconfig: use arm chacha even with no neon
        wireguard: queueing: get rid of per-peer ring buffers
        wireguard: device: do not generate ICMP for non-IP packets
        wireguard: peer: put frequently used members above cache lines
        wireguard: selftests: test multiple parallel streams
        wireguard: socket: remove bogus __be32 annotation
        wireguard: avoid double unlikely() notation when using IS_ERR()
        net: qrtr: Fix memory leak in qrtr_tun_open
        vxlan: move debug check after netdev unregister
        ...
      5ad3dbab
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.12-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 268f77b5
      Linus Torvalds authored
      Pull more ACPI updates from Rafael Wysocki:
       "These make additional changes to the platform profile interface merged
        recently and add support for the FPDT ACPI table.
      
        Specifics:
      
         - Rearrange Kconfig handling of ACPI_PLATFORM_PROFILE, add
           "balanced-performance" to the list of supported platform profiles
           and fix up some file references in a comment (Maximilian Luz).
      
         - Add support for parsing the ACPI Firmware Performance Data Table
           (FPDT) and exposing the data from there via sysfs (Zhang Rui)"
      
      * tag 'acpi-5.12-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: platform: Add balanced-performance platform profile
        ACPI: platform: Fix file references in comment
        ACPI: platform: Hide ACPI_PLATFORM_PROFILE option
        ACPI: tables: introduce support for FPDT table
      268f77b5