1. Aug 05, 2023
    • Paolo Abeni's avatar
      mptcp: avoid bogus reset on fallback close · ff18f9ef
      Paolo Abeni authored
      Since the blamed commit, the MPTCP protocol unconditionally sends
      TCP resets on all the subflows on disconnect().
      
      That fits full-blown MPTCP sockets - to implement the fastclose
      mechanism - but causes unexpected corruption of the data stream,
      caught as sporadic self-tests failures.
      
      Fixes: d21f8348
      
       ("mptcp: use fastclose on more edge scenarios")
      Cc: stable@vger.kernel.org
      Tested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/419
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Link: https://lore.kernel.org/r/20230803-upstream-net-20230803-misc-fixes-6-5-v1-3-6671b1ab11cc@tessares.net
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ff18f9ef
    • Andrea Claudi's avatar
      selftests: mptcp: join: fix 'implicit EP' test · c8c101ae
      Andrea Claudi authored
      mptcp_join 'implicit EP' test currently fails when using ip mptcp:
      
        $ ./mptcp_join.sh -iI
        <snip>
        001 implicit EP    creation[fail] expected '10.0.2.2 10.0.2.2 id 1 implicit' found '10.0.2.2 id 1 rawflags 10 '
        Error: too many addresses or duplicate one: -22.
                           ID change is prevented[fail] expected '10.0.2.2 10.0.2.2 id 1 implicit' found '10.0.2.2 id 1 rawflags 10 '
                           modif is allowed[fail] expected '10.0.2.2 10.0.2.2 id 1 signal' found '10.0.2.2 id 1 signal '
      
      This happens because of two reasons:
      - iproute v6.3.0 does not support the implicit flag, fixed with
        iproute2-next commit 3a2535a41854 ("mptcp: add support for implicit
        flag")
      - pm_nl_check_endpoint wrongly expects the ip address to be repeated two
        times in iproute output, and does not account for a final whitespace
        in it.
      
      This fixes the issue trimming the whitespace in the output string and
      removing the double address in the expected string.
      
      Fixes: 69c6ce7b
      
       ("selftests: mptcp: add implicit endpoint test case")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAndrea Claudi <aclaudi@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Link: https://lore.kernel.org/r/20230803-upstream-net-20230803-misc-fixes-6-5-v1-2-6671b1ab11cc@tessares.net
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c8c101ae
    • Andrea Claudi's avatar
      selftests: mptcp: join: fix 'delete and re-add' test · aaf2123a
      Andrea Claudi authored
      mptcp_join 'delete and re-add' test fails when using ip mptcp:
      
        $ ./mptcp_join.sh -iI
        <snip>
        002 delete and re-add                    before delete[ ok ]
                                                 mptcp_info subflows=1         [ ok ]
        Error: argument "ADDRESS" is wrong: invalid for non-zero id address
                                                 after delete[fail] got 2:2 subflows expected 1
      
      This happens because endpoint delete includes an ip address while id is
      not 0, contrary to what is indicated in the ip mptcp man page:
      
      "When used with the delete id operation, an IFADDR is only included when
      the ID is 0."
      
      This fixes the issue using the $addr variable in pm_nl_del_endpoint()
      only when id is 0.
      
      Fixes: 34aa6e3b
      
       ("selftests: mptcp: add ip mptcp wrappers")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAndrea Claudi <aclaudi@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Link: https://lore.kernel.org/r/20230803-upstream-net-20230803-misc-fixes-6-5-v1-1-6671b1ab11cc@tessares.net
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      aaf2123a
    • Jakub Kicinski's avatar
      Merge branch 'tunnels-fix-ipv4-pmtu-icmp-checksum' · ec935188
      Jakub Kicinski authored
      Florian Westphal says:
      
      ====================
      tunnels: fix ipv4 pmtu icmp checksum
      
      The checksum of the generated ipv4 icmp pmtud message is
      only correct if the skb that causes the icmp error generation
      is linear.
      
      Fix this and add a selftest for this.
      ====================
      
      Link: https://lore.kernel.org/r/20230803152653.29535-1-fw@strlen.de
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ec935188
    • Florian Westphal's avatar
      selftests: net: test vxlan pmtu exceptions with tcp · 136a1b43
      Florian Westphal authored
      
      
      TCP might get stuck if a nonlinear skb exceeds the path MTU,
      icmp error contains an incorrect icmp checksum in that case.
      
      Extend the existing test for vxlan to also send at least 1MB worth of
      data via TCP in addition to the existing 'large icmp packet adds
      route exception'.
      
      On my test VM this fails due to 0-size output file without
      "tunnels: fix kasan splat when generating ipv4 pmtu error".
      
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Link: https://lore.kernel.org/r/20230803152653.29535-3-fw@strlen.de
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      136a1b43
    • Florian Westphal's avatar
      tunnels: fix kasan splat when generating ipv4 pmtu error · 6a7ac3d2
      Florian Westphal authored
      If we try to emit an icmp error in response to a nonliner skb, we get
      
      BUG: KASAN: slab-out-of-bounds in ip_compute_csum+0x134/0x220
      Read of size 4 at addr ffff88811c50db00 by task iperf3/1691
      CPU: 2 PID: 1691 Comm: iperf3 Not tainted 6.5.0-rc3+ #309
      [..]
       kasan_report+0x105/0x140
       ip_compute_csum+0x134/0x220
       iptunnel_pmtud_build_icmp+0x554/0x1020
       skb_tunnel_check_pmtu+0x513/0xb80
       vxlan_xmit_one+0x139e/0x2ef0
       vxlan_xmit+0x1867/0x2760
       dev_hard_start_xmit+0x1ee/0x4f0
       br_dev_queue_push_xmit+0x4d1/0x660
       [..]
      
      ip_compute_csum() cannot deal with nonlinear skbs, so avoid it.
      After this change, splat is gone and iperf3 is no longer stuck.
      
      Fixes: 4cb47a86
      
       ("tunnels: PMTU discovery support for directly bridged IP packets")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Link: https://lore.kernel.org/r/20230803152653.29535-2-fw@strlen.de
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6a7ac3d2
    • Eric Dumazet's avatar
      net/packet: annotate data-races around tp->status · 8a989617
      Eric Dumazet authored
      Another syzbot report [1] is about tp->status lockless reads
      from __packet_get_status()
      
      [1]
      BUG: KCSAN: data-race in __packet_rcv_has_room / __packet_set_status
      
      write to 0xffff888117d7c080 of 8 bytes by interrupt on cpu 0:
      __packet_set_status+0x78/0xa0 net/packet/af_packet.c:407
      tpacket_rcv+0x18bb/0x1a60 net/packet/af_packet.c:2483
      deliver_skb net/core/dev.c:2173 [inline]
      __netif_receive_skb_core+0x408/0x1e80 net/core/dev.c:5337
      __netif_receive_skb_one_core net/core/dev.c:5491 [inline]
      __netif_receive_skb+0x57/0x1b0 net/core/dev.c:5607
      process_backlog+0x21f/0x380 net/core/dev.c:5935
      __napi_poll+0x60/0x3b0 net/core/dev.c:6498
      napi_poll net/core/dev.c:6565 [inline]
      net_rx_action+0x32b/0x750 net/core/dev.c:6698
      __do_softirq+0xc1/0x265 kernel/softirq.c:571
      invoke_softirq kernel/softirq.c:445 [inline]
      __irq_exit_rcu+0x57/0xa0 kernel/softirq.c:650
      sysvec_apic_timer_interrupt+0x6d/0x80 arch/x86/kernel/apic/apic.c:1106
      asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
      smpboot_thread_fn+0x33c/0x4a0 kernel/smpboot.c:112
      kthread+0x1d7/0x210 kernel/kthread.c:379
      ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
      
      read to 0xffff888117d7c080 of 8 bytes by interrupt on cpu 1:
      __packet_get_status net/packet/af_packet.c:436 [inline]
      packet_lookup_frame net/packet/af_packet.c:524 [inline]
      __tpacket_has_room net/packet/af_packet.c:1255 [inline]
      __packet_rcv_has_room+0x3f9/0x450 net/packet/af_packet.c:1298
      tpacket_rcv+0x275/0x1a60 net/packet/af_packet.c:2285
      deliver_skb net/core/dev.c:2173 [inline]
      dev_queue_xmit_nit+0x38a/0x5e0 net/core/dev.c:2243
      xmit_one net/core/dev.c:3574 [inline]
      dev_hard_start_xmit+0xcf/0x3f0 net/core/dev.c:3594
      __dev_queue_xmit+0xefb/0x1d10 net/core/dev.c:4244
      dev_queue_xmit include/linux/netdevice.h:3088 [inline]
      can_send+0x4eb/0x5d0 net/can/af_can.c:276
      bcm_can_tx+0x314/0x410 net/can/bcm.c:302
      bcm_tx_timeout_handler+0xdb/0x260
      __run_hrtimer kernel/time/hrtimer.c:1685 [inline]
      __hrtimer_run_queues+0x217/0x700 kernel/time/hrtimer.c:1749
      hrtimer_run_softirq+0xd6/0x120 kernel/time/hrtimer.c:1766
      __do_softirq+0xc1/0x265 kernel/softirq.c:571
      run_ksoftirqd+0x17/0x20 kernel/softirq.c:939
      smpboot_thread_fn+0x30a/0x4a0 kernel/smpboot.c:164
      kthread+0x1d7/0x210 kernel/kthread.c:379
      ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
      
      value changed: 0x0000000000000000 -> 0x0000000020000081
      
      Reported by Kernel Concurrency Sanitizer on:
      CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 6.4.0-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
      
      Fixes: 69e3c75f
      
       ("net: TX_RING and packet mmap")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20230803145600.2937518-1-edumazet@google.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8a989617
    • Vladimir Oltean's avatar
      net: dsa: ocelot: call dsa_tag_8021q_unregister() under rtnl_lock() on driver remove · a94c16a2
      Vladimir Oltean authored
      When the tagging protocol in current use is "ocelot-8021q" and we unbind
      the driver, we see this splat:
      
      $ echo '0000:00:00.2' > /sys/bus/pci/drivers/fsl_enetc/unbind
      mscc_felix 0000:00:00.5 swp0: left promiscuous mode
      sja1105 spi2.0: Link is Down
      DSA: tree 1 torn down
      mscc_felix 0000:00:00.5 swp2: left promiscuous mode
      sja1105 spi2.2: Link is Down
      DSA: tree 3 torn down
      fsl_enetc 0000:00:00.2 eno2: left promiscuous mode
      mscc_felix 0000:00:00.5: Link is Down
      ------------[ cut here ]------------
      RTNL: assertion failed at net/dsa/tag_8021q.c (409)
      WARNING: CPU: 1 PID: 329 at net/dsa/tag_8021q.c:409 dsa_tag_8021q_unregister+0x12c/0x1a0
      Modules linked in:
      CPU: 1 PID: 329 Comm: bash Not tainted 6.5.0-rc3+ #771
      pc : dsa_tag_8021q_unregister+0x12c/0x1a0
      lr : dsa_tag_8021q_unregister+0x12c/0x1a0
      Call trace:
       dsa_tag_8021q_unregister+0x12c/0x1a0
       felix_tag_8021q_teardown+0x130/0x150
       felix_teardown+0x3c/0xd8
       dsa_tree_teardown_switches+0xbc/0xe0
       dsa_unregister_switch+0x168/0x260
       felix_pci_remove+0x30/0x60
       pci_device_remove+0x4c/0x100
       device_release_driver_internal+0x188/0x288
       device_links_unbind_consumers+0xfc/0x138
       device_release_driver_internal+0xe0/0x288
       device_driver_detach+0x24/0x38
       unbind_store+0xd8/0x108
       drv_attr_store+0x30/0x50
      ---[ end trace 0000000000000000 ]---
      ------------[ cut here ]------------
      RTNL: assertion failed at net/8021q/vlan_core.c (376)
      WARNING: CPU: 1 PID: 329 at net/8021q/vlan_core.c:376 vlan_vid_del+0x1b8/0x1f0
      CPU: 1 PID: 329 Comm: bash Tainted: G        W          6.5.0-rc3+ #771
      pc : vlan_vid_del+0x1b8/0x1f0
      lr : vlan_vid_del+0x1b8/0x1f0
       dsa_tag_8021q_unregister+0x8c/0x1a0
       felix_tag_8021q_teardown+0x130/0x150
       felix_teardown+0x3c/0xd8
       dsa_tree_teardown_switches+0xbc/0xe0
       dsa_unregister_switch+0x168/0x260
       felix_pci_remove+0x30/0x60
       pci_device_remove+0x4c/0x100
       device_release_driver_internal+0x188/0x288
       device_links_unbind_consumers+0xfc/0x138
       device_release_driver_internal+0xe0/0x288
       device_driver_detach+0x24/0x38
       unbind_store+0xd8/0x108
       drv_attr_store+0x30/0x50
      DSA: tree 0 torn down
      
      This was somewhat not so easy to spot, because "ocelot-8021q" is not the
      default tagging protocol, and thus, not everyone who tests the unbinding
      path may have switched to it beforehand. The default
      felix_tag_npi_teardown() does not require rtnl_lock() to be held.
      
      Fixes: 7c83a7c5
      
       ("net: dsa: add a second tagger for Ocelot switches based on tag_8021q")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20230803134253.2711124-1-vladimir.oltean@nxp.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a94c16a2
    • Xiang Yang's avatar
      mptcp: fix the incorrect judgment for msk->cb_flags · 17ebf8a4
      Xiang Yang authored
      Coccicheck reports the error below:
      net/mptcp/protocol.c:3330:15-28: ERROR: test of a variable/field address
      
      Since the address of msk->cb_flags is used in __test_and_clear_bit, the
      address should not be NULL. The judgment for if (unlikely(msk->cb_flags))
      will always be true, we should check the real value of msk->cb_flags here.
      
      Fixes: 65a569b0
      
       ("mptcp: optimize release_cb for the common case")
      Signed-off-by: default avatarXiang Yang <xiangyang3@huawei.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Link: https://lore.kernel.org/r/20230803072438.1847500-1-xiangyang3@huawei.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      17ebf8a4
  2. Aug 04, 2023
  3. Aug 03, 2023
    • David Howells's avatar
      udp: Fix __ip_append_data()'s handling of MSG_SPLICE_PAGES · 0f71c9ca
      David Howells authored
      __ip_append_data() can get into an infinite loop when asked to splice into
      a partially-built UDP message that has more than the frag-limit data and up
      to the MTU limit.  Something like:
      
              pipe(pfd);
              sfd = socket(AF_INET, SOCK_DGRAM, 0);
              connect(sfd, ...);
              send(sfd, buffer, 8161, MSG_CONFIRM|MSG_MORE);
              write(pfd[1], buffer, 8);
              splice(pfd[0], 0, sfd, 0, 0x4ffe0ul, 0);
      
      where the amount of data given to send() is dependent on the MTU size (in
      this instance an interface with an MTU of 8192).
      
      The problem is that the calculation of the amount to copy in
      __ip_append_data() goes negative in two places, and, in the second place,
      this gets subtracted from the length remaining, thereby increasing it.
      
      This happens when pagedlen > 0 (which happens for MSG_ZEROCOPY and
      MSG_SPLICE_PAGES), because the terms in:
      
              copy = datalen - transhdrlen - fraggap - pagedlen;
      
      then mostly cancel when pagedlen is substituted for, leaving just -fraggap.
      This causes:
      
              length -= copy + transhdrlen;
      
      to increase the length to more than the amount of data in msg->msg_iter,
      which causes skb_splice_from_iter() to be unable to fill the request and it
      returns less than 'copied' - which means that length never gets to 0 and we
      never exit the loop.
      
      Fix this by:
      
       (1) Insert a note about the dodgy calculation of 'copy'.
      
       (2) If MSG_SPLICE_PAGES, clear copy if it is negative from the above
           equation, so that 'offset' isn't regressed and 'length' isn't
           increased, which will mean that length and thus copy should match the
           amount left in the iterator.
      
       (3) When handling MSG_SPLICE_PAGES, give a warning and return -EIO if
           we're asked to splice more than is in the iterator.  It might be
           better to not give the warning or even just give a 'short' write.
      
      [!] Note that this ought to also affect MSG_ZEROCOPY, but MSG_ZEROCOPY
      avoids the problem by simply assuming that everything asked for got copied,
      not just the amount that was in the iterator.  This is a potential bug for
      the future.
      
      Fixes: 7ac7c987
      
       ("udp: Convert udp_sendpage() to use MSG_SPLICE_PAGES")
      Reported-by: default avatar <syzbot+f527b971b4bdc8e79f9e@syzkaller.appspotmail.com>
      Link: https://lore.kernel.org/r/000000000000881d0606004541d1@google.com/
      
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: David Ahern <dsahern@kernel.org>
      cc: Jens Axboe <axboe@kernel.dk>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/1420063.1690904933@warthog.procyon.org.uk
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0f71c9ca
    • Jakub Kicinski's avatar
      Merge branch 'mlx5-ipsec-fixes' · a2d9831d
      Jakub Kicinski authored
      Leon Romanovsky says:
      
      ====================
      mlx5 IPsec fixes
      
      The following patches are combination of Jianbo's work on IPsec eswitch mode
      together with our internal review toward addition of TCP protocol selectors
      support to IPSec packet offload.
      
      Despite not-being fix, the first patch helps us to make second one more
      clear, so I'm asking to apply it anyway as part of this series.
      ====================
      
      Link: https://lore.kernel.org/r/cover.1690803944.git.leonro@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a2d9831d
    • Leon Romanovsky's avatar
      net/mlx5e: Set proper IPsec source port in L4 selector · 62da0833
      Leon Romanovsky authored
      Fix typo in setup_fte_upper_proto_match() where destination UDP port
      was used instead of source port.
      
      Fixes: a7385187
      
       ("net/mlx5e: IPsec, support upper protocol selector field offload")
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Link: https://lore.kernel.org/r/ffc024a4d192113103f392b0502688366ca88c1f.1690803944.git.leonro@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      62da0833
    • Jianbo Liu's avatar
      net/mlx5: fs_core: Skip the FTs in the same FS_TYPE_PRIO_CHAINS fs_prio · c635ca45
      Jianbo Liu authored
      In the cited commit, new type of FS_TYPE_PRIO_CHAINS fs_prio was added
      to support multiple parallel namespaces for multi-chains. And we skip
      all the flow tables under the fs_node of this type unconditionally,
      when searching for the next or previous flow table to connect for a
      new table.
      
      As this search function is also used for find new root table when the
      old one is being deleted, it will skip the entire FS_TYPE_PRIO_CHAINS
      fs_node next to the old root. However, new root table should be chosen
      from it if there is any table in it. Fix it by skipping only the flow
      tables in the same FS_TYPE_PRIO_CHAINS fs_node when finding the
      closest FT for a fs_node.
      
      Besides, complete the connecting from FTs of previous priority of prio
      because there should be multiple prevs after this fs_prio type is
      introduced. And also the next FT should be chosen from the first flow
      table next to the prio in the same FS_TYPE_PRIO_CHAINS fs_prio, if
      this prio is the first child.
      
      Fixes: 328edb49
      
       ("net/mlx5: Split FDB fast path prio to multiple namespaces")
      Signed-off-by: default avatarJianbo Liu <jianbol@nvidia.com>
      Reviewed-by: default avatarPaul Blakey <paulb@nvidia.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Link: https://lore.kernel.org/r/7a95754df479e722038996c97c97b062b372591f.1690803944.git.leonro@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c635ca45
    • Jianbo Liu's avatar
      net/mlx5: fs_core: Make find_closest_ft more generic · 618d28a5
      Jianbo Liu authored
      
      
      As find_closest_ft_recursive is called to find the closest FT, the
      first parameter of find_closest_ft can be changed from fs_prio to
      fs_node. Thus this function is extended to find the closest FT for the
      nodes of any type, not only prios, but also the sub namespaces.
      
      Signed-off-by: default avatarJianbo Liu <jianbol@nvidia.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Link: https://lore.kernel.org/r/d3962c2b443ec8dde7a740dc742a1f052d5e256c.1690803944.git.leonro@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      618d28a5
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · ec351c8f
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "A couple of platforms get a lone dts fix each:
      
         - SoCFPGA: Fix incorrect I2C property for SCL signal
      
         - Renesas: Fix interrupt names for MTU3 channels on RZ/G2L and
           RZ/V2L.
      
         - Juno/Vexpress: remove a dangling symlink
      
         - at91: sam9x60 SoC detection compatible strings
      
         - nspire: Fix arm primecell compatible string
      
        On the NXP i.MX platform, there multiple issues that get addressed:
      
         - A couple of ARM DTS fixes for i.MX6SLL usbphy and supported CPU
           frequency of sk-imx53 board
      
         - Add missing pull-up for imx8mn-var-som onboard PHY reset pinmux
      
         - A couple of imx8mm-venice fixes from Tim Harvey to diable
           disp_blk_ctrl
      
         - A couple of phycore-imx8mm fixes from Yashwanth Varakala to correct
           VPU label and gpio-line-names
      
         - Fix imx8mp-blk-ctrl driver to register HSIO PLL clock as
           bus_power_dev child, so that runtime PM can translate into the
           necessary GPC power domain action
      
        On the driver side, there are two fixes for tegra memory controller
        drivers addressing regressions from the merge window, a couple of
        minor correctness fixes for SCMI and SMCCC firmware, as well as a
        build fix for an lcd backlight driver"
      
      * tag 'soc-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (22 commits)
        backlight: corgi_lcd: fix missing prototype
        memory: tegra: make icc_set_bw return zero if BWMGR not supported
        arm64: dts: renesas: rzg2l: Update overfow/underflow IRQ names for MTU3 channels
        dt-bindings: serial: atmel,at91-usart: update compatible for sam9x60
        ARM: dts: at91: sam9x60: fix the SOC detection
        ARM: dts: nspire: Fix arm primecell compatible string
        firmware: arm_scmi: Fix chan_free cleanup on SMC
        firmware: arm_scmi: Drop OF node reference in the transport channel setup
        soc: imx: imx8mp-blk-ctrl: register HSIO PLL clock as bus_power_dev child
        ARM: dts: nxp/imx: limit sk-imx53 supported frequencies
        firmware: arm_scmi: Fix signed error return values handling
        firmware: smccc: Fix use of uninitialised results structure
        arm64: dts: freescale: Fix VPU G2 clock
        arm64: dts: imx8mn-var-som: add missing pull-up for onboard PHY reset pinmux
        arm64: dts: phycore-imx8mm: Correction in gpio-line-names
        arm64: dts: phycore-imx8mm: Label typo-fix of VPU
        ARM: dts: nxp/imx6sll: fix wrong property name in usbphy node
        arm64: dts: imx8mm-venice-gw7904: disable disp_blk_ctrl
        arm64: dts: imx8mm-venice-gw7903: disable disp_blk_ctrl
        arm64: dts: arm: Remove the dangling vexpress-v2m-rs1.dtsi symlink
        ...
      ec351c8f
    • Linus Torvalds's avatar
      Merge tag 'bitmap-6.5-rc5' of https://github.com:/norov/linux · a4e98a30
      Linus Torvalds authored
      Pull bitmap fixes from Yury Norov:
      
       - Fix for bitmap documentation
      
       - Fix for kernel build under certain configurations
      
      * tag 'bitmap-6.5-rc5' of https://github.com:/norov/linux:
        lib/bitmap: workaround const_eval test build failure
        cpumask: eliminate kernel-doc warnings
      a4e98a30
    • Linus Torvalds's avatar
      Merge tag 'exfat-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat · 4b954598
      Linus Torvalds authored
      Pull exfat fixes from Namjae Jeon:
      
       - Fix page allocation failure from allocation bitmap by using
         kvmalloc_array/kvfree
      
       - Add the check to validate if filename entries exceeds max filename
         length
      
       - Fix potential deadlock condition from dir_emit*()
      
      * tag 'exfat-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
        exfat: release s_lock before calling dir_emit()
        exfat: check if filename entries exceeds max filename length
        exfat: use kvmalloc_array/kvfree instead of kmalloc_array/kfree
      4b954598
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 79d65ee5
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Three small fixes, all in drivers"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: pm80xx: Fix error return code in pm8001_pci_probe()
        scsi: zfcp: Defer fc_rport blocking until after ADISC response
        scsi: storvsc: Limit max_sectors for virtual Fibre Channel devices
      79d65ee5
    • ndesaulniers@google.com's avatar
      word-at-a-time: use the same return type for has_zero regardless of endianness · 79e8328e
      ndesaulniers@google.com authored
      Compiling big-endian targets with Clang produces the diagnostic:
      
        fs/namei.c:2173:13: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
      	} while (!(has_zero(a, &adata, &constants) | has_zero(b, &bdata, &constants)));
      	          ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                     ||
        fs/namei.c:2173:13: note: cast one or both operands to int to silence this warning
      
      It appears that when has_zero was introduced, two definitions were
      produced with different signatures (in particular different return
      types).
      
      Looking at the usage in hash_name() in fs/namei.c, I suspect that
      has_zero() is meant to be invoked twice per while loop iteration; using
      logical-or would not update `bdata` when `a` did not have zeros.  So I
      think it's preferred to always return an unsigned long rather than a
      bool than update the while loop in hash_name() to use a logical-or
      rather than bitwise-or.
      
      [ Also changed powerpc version to do the same  - Linus ]
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1832
      Link: https://lore.kernel.org/lkml/20230801-bitwise-v1-1-799bec468dc4@google.com/
      Fixes: 36126f8f
      
       ("word-at-a-time: make the interfaces truly generic")
      Debugged-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      79e8328e
  4. Aug 02, 2023
    • Hans de Goede's avatar
      wifi: brcmfmac: Fix field-spanning write in brcmf_scan_params_v2_to_v1() · 16e455a4
      Hans de Goede authored
      
      
      Using brcmfmac with 6.5-rc3 on a brcmfmac43241b4-sdio triggers
      a backtrace caused by the following field-spanning warning:
      
      memcpy: detected field-spanning write (size 120) of single field
        "&params_le->channel_list[0]" at
        drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1072 (size 2)
      
      The driver still works after this warning. The warning was introduced by the
      new field-spanning write checks which were enabled recently.
      
      Fix this by replacing the channel_list[1] declaration at the end of
      the struct with a flexible array declaration.
      
      Most users of struct brcmf_scan_params_le calculate the size to alloc
      using the size of the non flex-array part of the struct + needed extra
      space, so they do not care about sizeof(struct brcmf_scan_params_le).
      
      brcmf_notify_escan_complete() however uses the struct on the stack,
      expecting there to be room for at least 1 entry in the channel-list
      to store the special -1 abort channel-id.
      
      To make this work use an anonymous union with a padding member
      added + the actual channel_list flexible array.
      
      Cc: Kees Cook <keescook@chromium.org>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarFranky Lin <franky.lin@broadcom.com>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://lore.kernel.org/r/20230729140500.27892-1-hdegoede@redhat.com
      16e455a4