1. 31 Aug, 2024 6 commits
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.11-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 0efdc097
      Linus Torvalds authored
      Pull xfs fixes from Chandan Babu:
      
       - Do not call out v1 inodes with non-zero di_nlink field as being
         corrupt
      
       - Change xfs_finobt_count_blocks() to count "free inode btree" blocks
         rather than "inode btree" blocks
      
       - Don't report the number of trimmed bytes via FITRIM because the
         underlying storage isn't required to do anything and failed discard
         IOs aren't reported to the caller anyway
      
       - Fix incorrect setting of rm_owner field in an rmap query
      
       - Report missing disk offset range in an fsmap query
      
       - Obtain m_growlock when extending realtime section of the filesystem
      
       - Reset rootdir extent size hint after extending realtime section of
         the filesystem
      
      * tag 'xfs-6.11-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: reset rootdir extent size hint after growfsrt
        xfs: take m_growlock when running growfsrt
        xfs: Fix missing interval for missing_owner in xfs fsmap
        xfs: use XFS_BUF_DADDR_NULL for daddrs in getfsmap code
        xfs: Fix the owner setting issue for rmap query in xfs fsmap
        xfs: don't bother reporting blocks trimmed via FITRIM
        xfs: xfs_finobt_count_blocks() walks the wrong btree
        xfs: fix folio dirtying for XFILE_ALLOC callers
        xfs: fix di_onlink checking for V1/V2 inodes
      0efdc097
    • Linus Torvalds's avatar
      Merge tag 'arm-fixes-6.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 35667a29
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "There is a fairly large number of bug fixes for Qualcomm platforms,
        most of them addressing issues with the devicetree files for the newly
        added Snapdragon X1 based laptops to make them more reliable.
      
        The Qualcomm driver changes address a few build-time issues as well as
        runtime problems in the tzmem and scm firmware, the USB Type-C driver,
        and the cmd-db and pmic_glink soc drivers.
      
        The NXP i.MX usually gets a bunch of devicetree fixes that is
        proportional to the number of supported machines. This includes both
        warning fixes and correctness for the 64-bit i.MX9, i.MX8 and
        layerscape platforms, as well as a single fix for a 32-bit i.MX6 based
        board.
      
        The other changes are the usual minor changes, including an update to
        the MAINTAINERS file, an omap3 dts file and a SoC driver for mpfs
        (risc-v)"
      
      * tag 'arm-fixes-6.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (50 commits)
        firmware: microchip: fix incorrect error report of programming:timeout on success
        soc: qcom: pd-mapper: Fix singleton refcount
        firmware: qcom: tzmem: disable sdm670 platform
        soc: qcom: pmic_glink: Actually communicate when remote goes down
        usb: typec: ucsi: Move unregister out of atomic section
        soc: qcom: pmic_glink: Fix race during initialization
        firmware: qcom: qseecom: remove unused functions
        firmware: qcom: tzmem: fix virtual-to-physical address conversion
        firmware: qcom: scm: Mark get_wq_ctx() as atomic call
        arm64: dts: qcom: x1e80100: Fix Adreno SMMU global interrupt
        arm64: dts: qcom: disable GPU on x1e80100 by default
        arm64: dts: imx8mm-phygate: fix typo pinctrcl-0
        arm64: dts: imx95: correct L3Cache cache-sets
        arm64: dts: imx95: correct a55 power-domains
        arm64: dts: freescale: imx93-tqma9352-mba93xxla: fix typo
        arm64: dts: freescale: imx93-tqma9352: fix CMA alloc-ranges
        ARM: dts: imx6dl-yapp43: Increase LED current to match the yapp4 HW design
        arm64: dts: imx93: update default value for snps,clk-csr
        arm64: dts: freescale: tqma9352: Fix watchdog reset
        arm64: dts: imx8mp-beacon-kit: Fix Stereo Audio on WM8962
        ...
      35667a29
    • Linus Torvalds's avatar
      Merge tag 'input-for-v6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 1934261d
      Linus Torvalds authored
      Pull input fix from Dmitry Torokhov:
      
       - a fix for Cypress PS/2 touchpad for regression introduced in 6.11
         merge window where a timeout condition is incorrectly reported for
         all extended Cypress commands
      
      * tag 'input-for-v6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: cypress_ps2 - fix waiting for command response
      1934261d
    • Linus Torvalds's avatar
      Merge tag 'pci-v6.11-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci · 8101b276
      Linus Torvalds authored
      Pull pci fixes from Bjorn Helgaas:
      
       - Add Manivannan Sadhasivam as PCI native host bridge and endpoint
         driver reviewer (Manivannan Sadhasivam)
      
       - Disable MHI RAM data parity error interrupt for qcom SA8775P SoC to
         work around hardware erratum that causes a constant stream of
         interrupts (Manivannan Sadhasivam)
      
       - Don't try to fall back to qcom Operating Performance Points (OPP)
         support unless the platform actually supports OPP (Manivannan
         Sadhasivam)
      
       - Add imx@lists.linux.dev mailing list to MAINTAINERS for NXP
         layerscape and imx6 PCI controller drivers (Frank Li)
      
      * tag 'pci-v6.11-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
        MAINTAINERS: PCI: Add NXP PCI controller mailing list imx@lists.linux.dev
        PCI: qcom: Use OPP only if the platform supports it
        PCI: qcom-ep: Disable MHI RAM data parity error interrupt for SA8775P SoC
        MAINTAINERS: Add Manivannan Sadhasivam as Reviewer for PCI native host bridge and endpoint drivers
      8101b276
    • Linus Torvalds's avatar
      Merge tag 'block-6.11-20240830' of git://git.kernel.dk/linux · 216d1631
      Linus Torvalds authored
      Pull block fix from Jens Axboe:
       "Fix for a single regression for WRITE_SAME introduced in the 6.11
        merge window"
      
      * tag 'block-6.11-20240830' of git://git.kernel.dk/linux:
        block: fix detection of unsupported WRITE SAME in blkdev_issue_write_zeroes
      216d1631
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.11-20240830' of git://git.kernel.dk/linux · ad246d9f
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
      
       - A fix for a regression that happened in 6.11 merge window, where the
         copying of iovecs for compat mode applications got broken for certain
         cases.
      
       - Fix for a bug introduced in 6.10, where if using recv/send bundles
         with classic provided buffers, the recv/send would fail to set the
         right iovec count. This caused 0 byte send/recv results. Found via
         code coverage testing and writing a test case to exercise it.
      
      * tag 'io_uring-6.11-20240830' of git://git.kernel.dk/linux:
        io_uring/kbuf: return correct iovec count from classic buffer peek
        io_uring/rsrc: ensure compat iovecs are copied correctly
      ad246d9f
  2. 30 Aug, 2024 15 commits
  3. 29 Aug, 2024 19 commits
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2024-08-29' of... · 9941b5bc
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2024-08-29' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes
      
      - Fix #11195: The external display connect via USB type-C dock stays blank after re-connect the dock
      - Make DSI backlight work for 2G version of Lenovo Yoga Tab 3 X90F
      . Move ARL GuC firmware to correct version
      -
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/ZtAd8WTw1xiSu_TS@jlahtine-mobl.ger.corp.intel.com
      9941b5bc
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v6.11-rc6' of... · 3b9dfd9e
      Linus Torvalds authored
      Merge tag 'hwmon-for-v6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - pt5161l: Fix invalid temperature reading of bad ADC values
      
       - asus-ec-sensors: Remove unsupported VRM temperature from X570-E
         GAMING
      
      * tag 'hwmon-for-v6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (pt5161l) Fix invalid temperature reading
        hwmon: (asus-ec-sensors) remove VRM temp X570-E GAMING
      3b9dfd9e
    • Linus Torvalds's avatar
      Merge tag 'net-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 0dd5dd63
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from bluetooth, wireless and netfilter.
      
        No known outstanding regressions.
      
        Current release - regressions:
      
         - wifi: iwlwifi: fix hibernation
      
         - eth: ionic: prevent tx_timeout due to frequent doorbell ringing
      
        Previous releases - regressions:
      
         - sched: fix sch_fq incorrect behavior for small weights
      
         - wifi:
            - iwlwifi: take the mutex before running link selection
            - wfx: repair open network AP mode
      
         - netfilter: restore IP sanity checks for netdev/egress
      
         - tcp: fix forever orphan socket caused by tcp_abort
      
         - mptcp: close subflow when receiving TCP+FIN
      
         - bluetooth: fix random crash seen while removing btnxpuart driver
      
        Previous releases - always broken:
      
         - mptcp: more fixes for the in-kernel PM
      
         - eth: bonding: change ipsec_lock from spin lock to mutex
      
         - eth: mana: fix race of mana_hwc_post_rx_wqe and new hwc response
      
        Misc:
      
         - documentation: drop special comment style for net code"
      
      * tag 'net-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (57 commits)
        nfc: pn533: Add poll mod list filling check
        mailmap: update entry for Sriram Yagnaraman
        selftests: mptcp: join: check re-re-adding ID 0 signal
        mptcp: pm: ADD_ADDR 0 is not a new address
        selftests: mptcp: join: validate event numbers
        mptcp: avoid duplicated SUB_CLOSED events
        selftests: mptcp: join: check re-re-adding ID 0 endp
        mptcp: pm: fix ID 0 endp usage after multiple re-creations
        mptcp: pm: do not remove already closed subflows
        selftests: mptcp: join: no extra msg if no counter
        selftests: mptcp: join: check re-adding init endp with != id
        mptcp: pm: reset MPC endp ID when re-added
        mptcp: pm: skip connecting to already established sf
        mptcp: pm: send ACK on an active subflow
        selftests: mptcp: join: check removing ID 0 endpoint
        mptcp: pm: fix RM_ADDR ID for the initial subflow
        mptcp: pm: reuse ID 0 after delete and re-add
        net: busy-poll: use ktime_get_ns() instead of local_clock()
        sctp: fix association labeling in the duplicate COOKIE-ECHO case
        mptcp: pr_debug: add missing \n at the end
        ...
      0dd5dd63
    • Dmitry Torokhov's avatar
      Input: cypress_ps2 - fix waiting for command response · c472d33b
      Dmitry Torokhov authored
      Commit 8bccf667 ("Input: cypress_ps2 - report timeouts when reading
      command status") uncovered an existing problem with cypress_ps2 driver:
      it tries waiting on a PS/2 device waitqueue without using the rest of
      libps2. Unfortunately without it nobody signals wakeup for the
      waiting process, and each "extended" command was timing out. But the
      rest of the code simply did not notice it.
      
      Fix this by switching from homegrown way of sending request to get
      command response and reading it to standard ps2_command() which does
      the right thing.
      Reported-by: default avatarWoody Suwalski <terraluna977@gmail.com>
      Tested-by: default avatarWoody Suwalski <terraluna977@gmail.com>
      Fixes: 8bccf667 ("Input: cypress_ps2 - report timeouts when reading command status")
      Link: https://lore.kernel.org/r/a8252e0f-dab4-ef5e-2aa1-407a6f4c7204@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      c472d33b
    • Karthik Poosa's avatar
      drm/xe/hwmon: Fix WRITE_I1 param from u32 to u16 · 59d237c8
      Karthik Poosa authored
      WRITE_I1 sub-command of the POWER_SETUP pcode command accepts a u16
      parameter instead of u32. This change prevents potential illegal
      sub-command errors.
      
      v2: Mask uval instead of changing the prototype. (Badal)
      
      v3: Rephrase commit message. (Badal)
      Signed-off-by: default avatarKarthik Poosa <karthik.poosa@intel.com>
      Fixes: 92d44a42 ("drm/xe/hwmon: Expose card reactive critical power")
      Reviewed-by: default avatarBadal Nilawar <badal.nilawar@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240827155301.183383-1-karthik.poosa@intel.comSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      (cherry picked from commit a7f65709)
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      59d237c8
    • Aleksandr Mishin's avatar
      nfc: pn533: Add poll mod list filling check · febccb39
      Aleksandr Mishin authored
      In case of im_protocols value is 1 and tm_protocols value is 0 this
      combination successfully passes the check
      'if (!im_protocols && !tm_protocols)' in the nfc_start_poll().
      But then after pn533_poll_create_mod_list() call in pn533_start_poll()
      poll mod list will remain empty and dev->poll_mod_count will remain 0
      which lead to division by zero.
      
      Normally no im protocol has value 1 in the mask, so this combination is
      not expected by driver. But these protocol values actually come from
      userspace via Netlink interface (NFC_CMD_START_POLL operation). So a
      broken or malicious program may pass a message containing a "bad"
      combination of protocol parameter values so that dev->poll_mod_count
      is not incremented inside pn533_poll_create_mod_list(), thus leading
      to division by zero.
      Call trace looks like:
      nfc_genl_start_poll()
        nfc_start_poll()
          ->start_poll()
          pn533_start_poll()
      
      Add poll mod list filling check.
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      
      Fixes: dfccd0f5 ("NFC: pn533: Add some polling entropy")
      Signed-off-by: default avatarAleksandr Mishin <amishin@t-argos.ru>
      Acked-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Link: https://patch.msgid.link/20240827084822.18785-1-amishin@t-argos.ruSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      febccb39
    • Paolo Abeni's avatar
      Merge tag 'nf-24-08-28' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf · 0240bceb
      Paolo Abeni authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      Patch #1 sets on NFT_PKTINFO_L4PROTO for UDP packets less than 4 bytes
      payload from netdev/egress by subtracting skb_network_offset() when
      validating IPv4 packet length, otherwise 'meta l4proto udp' never
      matches.
      
      Patch #2 subtracts skb_network_offset() when validating IPv6 packet
      length for netdev/egress.
      
      netfilter pull request 24-08-28
      
      * tag 'nf-24-08-28' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
        netfilter: nf_tables_ipv6: consider network offset in netdev/egress validation
        netfilter: nf_tables: restore IP sanity checks for netdev/egress
      ====================
      
      Link: https://patch.msgid.link/20240828214708.619261-1-pablo@netfilter.orgSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      0240bceb
    • Sriram Yagnaraman's avatar
    • Paolo Abeni's avatar
      Merge branch 'mptcp-more-fixes-for-the-in-kernel-pm' · b666a651
      Paolo Abeni authored
      Matthieu Baerts says:
      
      ====================
      mptcp: more fixes for the in-kernel PM
      
      Here is a new batch of fixes for the MPTCP in-kernel path-manager:
      
      Patch 1 ensures the address ID is set to 0 when the path-manager sends
      an ADD_ADDR for the address of the initial subflow. The same fix is
      applied when a new subflow is created re-using this special address. A
      fix for v6.0.
      
      Patch 2 is similar, but for the case where an endpoint is removed: if
      this endpoint was used for the initial address, it is important to send
      a RM_ADDR with this ID set to 0, and look for existing subflows with the
      ID set to 0. A fix for v6.0 as well.
      
      Patch 3 validates the two previous patches.
      
      Patch 4 makes the PM selecting an "active" path to send an address
      notification in an ACK, instead of taking the first path in the list. A
      fix for v5.11.
      
      Patch 5 fixes skipping the establishment of a new subflow if a previous
      subflow using the same pair of addresses is being closed. A fix for
      v5.13.
      
      Patch 6 resets the ID linked to the initial subflow when the linked
      endpoint is re-added, possibly with a different ID. A fix for v6.0.
      
      Patch 7 validates the three previous patches.
      
      Patch 8 is a small fix for the MPTCP Join selftest, when being used with
      older subflows not supporting all MIB counters. A fix for a commit
      introduced in v6.4, but backported up to v5.10.
      
      Patch 9 avoids the PM to try to close the initial subflow multiple
      times, and increment counters while nothing happened. A fix for v5.10.
      
      Patch 10 stops incrementing local_addr_used and add_addr_accepted
      counters when dealing with the address ID 0, because these counters are
      not taking into account the initial subflow, and are then not
      decremented when the linked addresses are removed. A fix for v6.0.
      
      Patch 11 validates the previous patch.
      
      Patch 12 avoids the PM to send multiple SUB_CLOSED events for the
      initial subflow. A fix for v5.12.
      
      Patch 13 validates the previous patch.
      
      Patch 14 stops treating the ADD_ADDR 0 as a new address, and accepts it
      in order to re-create the initial subflow if it has been closed, even if
      the limit for *new* addresses -- not taking into account the address of
      the initial subflow -- has been reached. A fix for v5.10.
      
      Patch 15 validates the previous patch.
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      ---
      Matthieu Baerts (NGI0) (15):
            mptcp: pm: reuse ID 0 after delete and re-add
            mptcp: pm: fix RM_ADDR ID for the initial subflow
            selftests: mptcp: join: check removing ID 0 endpoint
            mptcp: pm: send ACK on an active subflow
            mptcp: pm: skip connecting to already established sf
            mptcp: pm: reset MPC endp ID when re-added
            selftests: mptcp: join: check re-adding init endp with != id
            selftests: mptcp: join: no extra msg if no counter
            mptcp: pm: do not remove already closed subflows
            mptcp: pm: fix ID 0 endp usage after multiple re-creations
            selftests: mptcp: join: check re-re-adding ID 0 endp
            mptcp: avoid duplicated SUB_CLOSED events
            selftests: mptcp: join: validate event numbers
            mptcp: pm: ADD_ADDR 0 is not a new address
            selftests: mptcp: join: check re-re-adding ID 0 signal
      
       net/mptcp/pm.c                                  |   4 +-
       net/mptcp/pm_netlink.c                          |  87 ++++++++++----
       net/mptcp/protocol.c                            |   6 +
       net/mptcp/protocol.h                            |   5 +-
       tools/testing/selftests/net/mptcp/mptcp_join.sh | 153 ++++++++++++++++++++----
       tools/testing/selftests/net/mptcp/mptcp_lib.sh  |   4 +
       6 files changed, 209 insertions(+), 50 deletions(-)
      ---
      base-commit: 3a0504d5
      change-id: 20240826-net-mptcp-more-pm-fix-ffa61a36f817
      
      Best regards,
      ====================
      
      Link: https://patch.msgid.link/20240828-net-mptcp-more-pm-fix-v2-0-7f11b283fff7@kernel.orgSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      b666a651
    • Matthieu Baerts (NGI0)'s avatar
      selftests: mptcp: join: check re-re-adding ID 0 signal · f18fa2ab
      Matthieu Baerts (NGI0) authored
      This test extends "delete re-add signal" to validate the previous
      commit: when the 'signal' endpoint linked to the initial subflow (ID 0)
      is re-added multiple times, it will re-send the ADD_ADDR with id 0. The
      client should still be able to re-create this subflow, even if the
      add_addr_accepted limit has been reached as this special address is not
      considered as a new address.
      
      The 'Fixes' tag here below is the same as the one from the previous
      commit: this patch here is not fixing anything wrong in the selftests,
      but it validates the previous fix for an issue introduced by this commit
      ID.
      
      Fixes: d0876b22 ("mptcp: add the incoming RM_ADDR support")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f18fa2ab
    • Matthieu Baerts (NGI0)'s avatar
      mptcp: pm: ADD_ADDR 0 is not a new address · 57f86203
      Matthieu Baerts (NGI0) authored
      The ADD_ADDR 0 with the address from the initial subflow should not be
      considered as a new address: this is not something new. If the host
      receives it, it simply means that the address is available again.
      
      When receiving an ADD_ADDR for the ID 0, the PM already doesn't consider
      it as new by not incrementing the 'add_addr_accepted' counter. But the
      'accept_addr' might not be set if the limit has already been reached:
      this can be bypassed in this case. But before, it is important to check
      that this ADD_ADDR for the ID 0 is for the same address as the initial
      subflow. If not, it is not something that should happen, and the
      ADD_ADDR can be ignored.
      
      Note that if an ADD_ADDR is received while there is already a subflow
      opened using the same address, this ADD_ADDR is ignored as well. It
      means that if multiple ADD_ADDR for ID 0 are received, there will not be
      any duplicated subflows created by the client.
      
      Fixes: d0876b22 ("mptcp: add the incoming RM_ADDR support")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      57f86203
    • Matthieu Baerts (NGI0)'s avatar
      selftests: mptcp: join: validate event numbers · 20ccc7c5
      Matthieu Baerts (NGI0) authored
      This test extends "delete and re-add" and "delete re-add signal" to
      validate the previous commit: the number of MPTCP events are checked to
      make sure there are no duplicated or unexpected ones.
      
      A new helper has been introduced to easily check these events. The
      missing events have been added to the lib.
      
      The 'Fixes' tag here below is the same as the one from the previous
      commit: this patch here is not fixing anything wrong in the selftests,
      but it validates the previous fix for an issue introduced by this commit
      ID.
      
      Fixes: b911c97c ("mptcp: add netlink event support")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      20ccc7c5
    • Matthieu Baerts (NGI0)'s avatar
      mptcp: avoid duplicated SUB_CLOSED events · d82809b6
      Matthieu Baerts (NGI0) authored
      The initial subflow might have already been closed, but still in the
      connection list. When the worker is instructed to close the subflows
      that have been marked as closed, it might then try to close the initial
      subflow again.
      
       A consequence of that is that the SUB_CLOSED event can be seen twice:
      
        # ip mptcp endpoint
        1.1.1.1 id 1 subflow dev eth0
        2.2.2.2 id 2 subflow dev eth1
      
        # ip mptcp monitor &
        [         CREATED] remid=0 locid=0 saddr4=1.1.1.1 daddr4=9.9.9.9
        [     ESTABLISHED] remid=0 locid=0 saddr4=1.1.1.1 daddr4=9.9.9.9
        [  SF_ESTABLISHED] remid=0 locid=2 saddr4=2.2.2.2 daddr4=9.9.9.9
      
        # ip mptcp endpoint delete id 1
        [       SF_CLOSED] remid=0 locid=0 saddr4=1.1.1.1 daddr4=9.9.9.9
        [       SF_CLOSED] remid=0 locid=0 saddr4=1.1.1.1 daddr4=9.9.9.9
      
      The first one is coming from mptcp_pm_nl_rm_subflow_received(), and the
      second one from __mptcp_close_subflow().
      
      To avoid doing the post-closed processing twice, the subflow is now
      marked as closed the first time.
      
      Note that it is not enough to check if we are dealing with the first
      subflow and check its sk_state: the subflow might have been reset or
      closed before calling mptcp_close_ssk().
      
      Fixes: b911c97c ("mptcp: add netlink event support")
      Cc: stable@vger.kernel.org
      Tested-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      d82809b6
    • Matthieu Baerts (NGI0)'s avatar
      selftests: mptcp: join: check re-re-adding ID 0 endp · d397d724
      Matthieu Baerts (NGI0) authored
      This test extends "delete and re-add" to validate the previous commit:
      when the endpoint linked to the initial subflow (ID 0) is re-added
      multiple times, it was no longer being used, because the internal linked
      counters are not decremented for this special endpoint: it is not an
      additional endpoint.
      
      Here, the "del/add id 0" steps are done 3 times to unsure this case is
      validated.
      
      The 'Fixes' tag here below is the same as the one from the previous
      commit: this patch here is not fixing anything wrong in the selftests,
      but it validates the previous fix for an issue introduced by this commit
      ID.
      
      Fixes: 3ad14f54 ("mptcp: more accurate MPC endpoint tracking")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      d397d724
    • Matthieu Baerts (NGI0)'s avatar
      mptcp: pm: fix ID 0 endp usage after multiple re-creations · 9366922a
      Matthieu Baerts (NGI0) authored
      'local_addr_used' and 'add_addr_accepted' are decremented for addresses
      not related to the initial subflow (ID0), because the source and
      destination addresses of the initial subflows are known from the
      beginning: they don't count as "additional local address being used" or
      "ADD_ADDR being accepted".
      
      It is then required not to increment them when the entrypoint used by
      the initial subflow is removed and re-added during a connection. Without
      this modification, this entrypoint cannot be removed and re-added more
      than once.
      Reported-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/512
      Fixes: 3ad14f54 ("mptcp: more accurate MPC endpoint tracking")
      Reported-by: syzbot+455d38ecd5f655fc45cf@syzkaller.appspotmail.com
      Closes: https://lore.kernel.org/00000000000049861306209237f4@google.com
      Cc: stable@vger.kernel.org
      Tested-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      9366922a
    • Matthieu Baerts (NGI0)'s avatar
      mptcp: pm: do not remove already closed subflows · 58e1b66b
      Matthieu Baerts (NGI0) authored
      It is possible to have in the list already closed subflows, e.g. the
      initial subflow has been already closed, but still in the list. No need
      to try to close it again, and increments the related counters again.
      
      Fixes: 0ee4261a ("mptcp: implement mptcp_pm_remove_subflow")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      58e1b66b
    • Matthieu Baerts (NGI0)'s avatar
      selftests: mptcp: join: no extra msg if no counter · 76a2d839
      Matthieu Baerts (NGI0) authored
      The checksum and fail counters might not be available. Then no need to
      display an extra message with missing info.
      
      While at it, fix the indentation around, which is wrong since the same
      commit.
      
      Fixes: 47867f0a ("selftests: mptcp: join: skip check if MIB counter not supported")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarGeliang Tang <geliang@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      76a2d839
    • Matthieu Baerts (NGI0)'s avatar
      selftests: mptcp: join: check re-adding init endp with != id · 1c2326fc
      Matthieu Baerts (NGI0) authored
      The initial subflow has a special local ID: 0. It is specific per
      connection.
      
      When a global endpoint is deleted and re-added later, it can have a
      different ID, but the kernel should still use the ID 0 if it corresponds
      to the initial address.
      
      This test validates this behaviour: the endpoint linked to the initial
      subflow is removed, and re-added with a different ID.
      
      Note that removing the initial subflow will not decrement the 'subflows'
      counters, which corresponds to the *additional* subflows. On the other
      hand, when the same endpoint is re-added, it will increment this
      counter, as it will be seen as an additional subflow this time.
      
      The 'Fixes' tag here below is the same as the one from the previous
      commit: this patch here is not fixing anything wrong in the selftests,
      but it validates the previous fix for an issue introduced by this commit
      ID.
      
      Fixes: 3ad14f54 ("mptcp: more accurate MPC endpoint tracking")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      1c2326fc
    • Matthieu Baerts (NGI0)'s avatar
      mptcp: pm: reset MPC endp ID when re-added · dce1c6d1
      Matthieu Baerts (NGI0) authored
      The initial subflow has a special local ID: 0. It is specific per
      connection.
      
      When a global endpoint is deleted and re-added later, it can have a
      different ID -- most services managing the endpoints automatically don't
      force the ID to be the same as before. It is then important to track
      these modifications to be consistent with the ID being used for the
      address used by the initial subflow, not to confuse the other peer or to
      send the ID 0 for the wrong address.
      
      Now when removing an endpoint, msk->mpc_endpoint_id is reset if it
      corresponds to this endpoint. When adding a new endpoint, the same
      variable is updated if the address match the one of the initial subflow.
      
      Fixes: 3ad14f54 ("mptcp: more accurate MPC endpoint tracking")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
      Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      dce1c6d1