1. Jun 28, 2023
    • Vladimir Oltean's avatar
      net: phy: mscc: fix packet loss due to RGMII delays · 528a08bc
      Vladimir Oltean authored
      Two deadly typos break RX and TX traffic on the VSC8502 PHY using RGMII
      if phy-mode = "rgmii-id" or "rgmii-txid", and no "tx-internal-delay-ps"
      override exists. The negative error code from phy_get_internal_delay()
      does not get overridden with the delay deduced from the phy-mode, and
      later gets committed to hardware. Also, the rx_delay gets overridden by
      what should have been the tx_delay.
      
      Fixes: dbb050d2
      
       ("phy: mscc: Add support for RGMII delay configuration")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarHarini Katakam <harini.katakam@amd.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Link: https://lore.kernel.org/r/20230627134235.3453358-1-vladimir.oltean@nxp.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      528a08bc
    • Jakub Kicinski's avatar
      Merge branch 'use-vmalloc_array-and-vcalloc' · d9b1a5a6
      Jakub Kicinski authored
      Julia Lawall says:
      
      ====================
      use vmalloc_array and vcalloc
      
      The functions vmalloc_array and vcalloc were introduced in
      
      commit a8749a35 ("mm: vmalloc: introduce array allocation functions")
      
      but are not used much yet.  This series introduces uses of
      these functions, to protect against multiplication overflows.
      
      The changes were done using the following Coccinelle semantic
      patch.
      
      @initialize:ocaml@
      @@
      
      let rename alloc =
        match alloc with
          "vmalloc" -> "vmalloc_array"
        | "vzalloc" -> "vcalloc"
        | _ -> failwith "unknown"
      
      @@
          size_t e1,e2;
          constant C1, C2;
          expression E1, E2, COUNT, x1, x2, x3;
          typedef u8;
          typedef __u8;
          type t = {u8,__u8,char,unsigned char};
          identifier alloc = {vmalloc,vzalloc};
          fresh identifier realloc = script:ocaml(alloc) { rename alloc };
      @@
      
      (
            alloc(x1*x2*x3)
      |
            alloc(C1 * C2)
      |
            alloc((sizeof(t)) * (COUNT), ...)
      |
      -     alloc((e1) * (e2))
      +     realloc(e1, e2)
      |
      -     alloc((e1) * (COUNT))
      +     realloc(COUNT, e1)
      |
      -     alloc((E1) * (E2))
      +     realloc(E1, E2)
      )
      
      v2: This series uses vmalloc_array and vcalloc instead of
      array_size.  It also leaves a multiplication of a constant by a
      sizeof as is.  Two patches are thus dropped from the series.
      ====================
      
      Link: https://lore.kernel.org/r/20230627144339.144478-1-Julia.Lawall@inria.fr
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d9b1a5a6
    • Julia Lawall's avatar
      net: mana: use vmalloc_array and vcalloc · e9c74f8b
      Julia Lawall authored
      
      
      Use vmalloc_array and vcalloc to protect against
      multiplication overflows.
      
      The changes were done using the following Coccinelle
      semantic patch:
      
      // <smpl>
      @initialize:ocaml@
      @@
      
      let rename alloc =
        match alloc with
          "vmalloc" -> "vmalloc_array"
        | "vzalloc" -> "vcalloc"
        | _ -> failwith "unknown"
      
      @@
          size_t e1,e2;
          constant C1, C2;
          expression E1, E2, COUNT, x1, x2, x3;
          typedef u8;
          typedef __u8;
          type t = {u8,__u8,char,unsigned char};
          identifier alloc = {vmalloc,vzalloc};
          fresh identifier realloc = script:ocaml(alloc) { rename alloc };
      @@
      
      (
            alloc(x1*x2*x3)
      |
            alloc(C1 * C2)
      |
            alloc((sizeof(t)) * (COUNT), ...)
      |
      -     alloc((e1) * (e2))
      +     realloc(e1, e2)
      |
      -     alloc((e1) * (COUNT))
      +     realloc(COUNT, e1)
      |
      -     alloc((E1) * (E2))
      +     realloc(E1, E2)
      )
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Link: https://lore.kernel.org/r/20230627144339.144478-23-Julia.Lawall@inria.fr
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e9c74f8b
    • Julia Lawall's avatar
      net: enetc: use vmalloc_array and vcalloc · fa87c546
      Julia Lawall authored
      
      
      Use vmalloc_array and vcalloc to protect against
      multiplication overflows.
      
      The changes were done using the following Coccinelle
      semantic patch:
      
      // <smpl>
      @initialize:ocaml@
      @@
      
      let rename alloc =
        match alloc with
          "vmalloc" -> "vmalloc_array"
        | "vzalloc" -> "vcalloc"
        | _ -> failwith "unknown"
      
      @@
          size_t e1,e2;
          constant C1, C2;
          expression E1, E2, COUNT, x1, x2, x3;
          typedef u8;
          typedef __u8;
          type t = {u8,__u8,char,unsigned char};
          identifier alloc = {vmalloc,vzalloc};
          fresh identifier realloc = script:ocaml(alloc) { rename alloc };
      @@
      
      (
            alloc(x1*x2*x3)
      |
            alloc(C1 * C2)
      |
            alloc((sizeof(t)) * (COUNT), ...)
      |
      -     alloc((e1) * (e2))
      +     realloc(e1, e2)
      |
      -     alloc((e1) * (COUNT))
      +     realloc(COUNT, e1)
      |
      -     alloc((E1) * (E2))
      +     realloc(E1, E2)
      )
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Link: https://lore.kernel.org/r/20230627144339.144478-19-Julia.Lawall@inria.fr
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fa87c546
    • Julia Lawall's avatar
      ionic: use vmalloc_array and vcalloc · f712c829
      Julia Lawall authored
      
      
      Use vmalloc_array and vcalloc to protect against
      multiplication overflows.
      
      The changes were done using the following Coccinelle
      semantic patch:
      
      // <smpl>
      @initialize:ocaml@
      @@
      
      let rename alloc =
        match alloc with
          "vmalloc" -> "vmalloc_array"
        | "vzalloc" -> "vcalloc"
        | _ -> failwith "unknown"
      
      @@
          size_t e1,e2;
          constant C1, C2;
          expression E1, E2, COUNT, x1, x2, x3;
          typedef u8;
          typedef __u8;
          type t = {u8,__u8,char,unsigned char};
          identifier alloc = {vmalloc,vzalloc};
          fresh identifier realloc = script:ocaml(alloc) { rename alloc };
      @@
      
      (
            alloc(x1*x2*x3)
      |
            alloc(C1 * C2)
      |
            alloc((sizeof(t)) * (COUNT), ...)
      |
      -     alloc((e1) * (e2))
      +     realloc(e1, e2)
      |
      -     alloc((e1) * (COUNT))
      +     realloc(COUNT, e1)
      |
      -     alloc((E1) * (E2))
      +     realloc(E1, E2)
      )
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Link: https://lore.kernel.org/r/20230627144339.144478-12-Julia.Lawall@inria.fr
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f712c829
    • Julia Lawall's avatar
      pds_core: use vmalloc_array and vcalloc · 906a76cc
      Julia Lawall authored
      
      
      Use vmalloc_array and vcalloc to protect against
      multiplication overflows.
      
      The changes were done using the following Coccinelle
      semantic patch:
      
      // <smpl>
      @initialize:ocaml@
      @@
      
      let rename alloc =
        match alloc with
          "vmalloc" -> "vmalloc_array"
        | "vzalloc" -> "vcalloc"
        | _ -> failwith "unknown"
      
      @@
          size_t e1,e2;
          constant C1, C2;
          expression E1, E2, COUNT, x1, x2, x3;
          typedef u8;
          typedef __u8;
          type t = {u8,__u8,char,unsigned char};
          identifier alloc = {vmalloc,vzalloc};
          fresh identifier realloc = script:ocaml(alloc) { rename alloc };
      @@
      
      (
            alloc(x1*x2*x3)
      |
            alloc(C1 * C2)
      |
            alloc((sizeof(t)) * (COUNT), ...)
      |
      -     alloc((e1) * (e2))
      +     realloc(e1, e2)
      |
      -     alloc((e1) * (COUNT))
      +     realloc(COUNT, e1)
      |
      -     alloc((E1) * (E2))
      +     realloc(E1, E2)
      )
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Link: https://lore.kernel.org/r/20230627144339.144478-10-Julia.Lawall@inria.fr
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      906a76cc
    • Julia Lawall's avatar
      gve: use vmalloc_array and vcalloc · a13de901
      Julia Lawall authored
      
      
      Use vmalloc_array and vcalloc to protect against
      multiplication overflows.
      
      The changes were done using the following Coccinelle
      semantic patch:
      
      // <smpl>
      @initialize:ocaml@
      @@
      
      let rename alloc =
        match alloc with
          "vmalloc" -> "vmalloc_array"
        | "vzalloc" -> "vcalloc"
        | _ -> failwith "unknown"
      
      @@
          size_t e1,e2;
          constant C1, C2;
          expression E1, E2, COUNT, x1, x2, x3;
          typedef u8;
          typedef __u8;
          type t = {u8,__u8,char,unsigned char};
          identifier alloc = {vmalloc,vzalloc};
          fresh identifier realloc = script:ocaml(alloc) { rename alloc };
      @@
      
      (
            alloc(x1*x2*x3)
      |
            alloc(C1 * C2)
      |
            alloc((sizeof(t)) * (COUNT), ...)
      |
      -     alloc((e1) * (e2))
      +     realloc(e1, e2)
      |
      -     alloc((e1) * (COUNT))
      +     realloc(COUNT, e1)
      |
      -     alloc((E1) * (E2))
      +     realloc(E1, E2)
      )
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Link: https://lore.kernel.org/r/20230627144339.144478-5-Julia.Lawall@inria.fr
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a13de901
    • Julia Lawall's avatar
      octeon_ep: use vmalloc_array and vcalloc · 32d462a5
      Julia Lawall authored
      
      
      Use vmalloc_array and vcalloc to protect against
      multiplication overflows.
      
      The changes were done using the following Coccinelle
      semantic patch:
      
      // <smpl>
      @initialize:ocaml@
      @@
      
      let rename alloc =
        match alloc with
          "vmalloc" -> "vmalloc_array"
        | "vzalloc" -> "vcalloc"
        | _ -> failwith "unknown"
      
      @@
          size_t e1,e2;
          constant C1, C2;
          expression E1, E2, COUNT, x1, x2, x3;
          typedef u8;
          typedef __u8;
          type t = {u8,__u8,char,unsigned char};
          identifier alloc = {vmalloc,vzalloc};
          fresh identifier realloc = script:ocaml(alloc) { rename alloc };
      @@
      
      (
            alloc(x1*x2*x3)
      |
            alloc(C1 * C2)
      |
            alloc((sizeof(t)) * (COUNT), ...)
      |
      -     alloc((e1) * (e2))
      +     realloc(e1, e2)
      |
      -     alloc((e1) * (COUNT))
      +     realloc(COUNT, e1)
      |
      -     alloc((E1) * (E2))
      +     realloc(E1, E2)
      )
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Link: https://lore.kernel.org/r/20230627144339.144478-3-Julia.Lawall@inria.fr
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      32d462a5
  2. Jun 27, 2023
    • Matthieu Baerts's avatar
      perf trace: fix MSG_SPLICE_PAGES build error · 2553a527
      Matthieu Baerts authored
      Our MPTCP CI and Stephen got this error:
      
          In file included from builtin-trace.c:907:
          trace/beauty/msg_flags.c: In function 'syscall_arg__scnprintf_msg_flags':
          trace/beauty/msg_flags.c:28:21: error: 'MSG_SPLICE_PAGES' undeclared (first use in this function)
             28 |         if (flags & MSG_##n) {           |                     ^~~~
          trace/beauty/msg_flags.c:50:9: note: in expansion of macro 'P_MSG_FLAG'
             50 |         P_MSG_FLAG(SPLICE_PAGES);
                |         ^~~~~~~~~~
          trace/beauty/msg_flags.c:28:21: note: each undeclared identifier is reported only once for each function it appears in
             28 |         if (flags & MSG_##n) {           |                     ^~~~
          trace/beauty/msg_flags.c:50:9: note: in expansion of macro 'P_MSG_FLAG'
             50 |         P_MSG_FLAG(SPLICE_PAGES);
                |         ^~~~~~~~~~
      
      The fix is similar to what was done with MSG_FASTOPEN: the new macro is
      defined if it is not defined in the system headers.
      
      Fixes: b848b26c
      
       ("net: Kill MSG_SENDPAGE_NOTLAST")
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Closes: https://lore.kernel.org/r/20230626112847.2ef3d422@canb.auug.org.au/
      
      
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Link: https://lore.kernel.org/r/20230626090239.899672-1-matthieu.baerts@tessares.net
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      2553a527
    • Jakub Kicinski's avatar
      Merge tag 'nf-next-23-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next · 61dc651c
      Jakub Kicinski authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter/IPVS updates for net-next
      
      1) Allow slightly larger IPVS connection table size from Kconfig for
         64-bit arch, from Abhijeet Rastogi.
      
      2) Since IPVS connection table might be larger than 2^20 after previous
         patch, allow to limit it depending on the available memory.
         Moreover, use kvmalloc. From Julian Anastasov.
      
      3) Do not rebuild VLAN header in nft_payload when matching source and
         destination MAC address.
      
      4) Remove nested rcu read lock side in ip_set_test(), from Florian Westphal.
      
      5) Allow to update set size, also from Florian.
      
      6) Improve NAT tuple selection when connection is closing,
         from Florian Westphal.
      
      7) Support for resetting set element stateful expression, from Phil Sutter.
      
      8) Use NLA_POLICY_MAX to narrow down maximum attribute value in nf_tables,
         from Florian Westphal.
      
      * tag 'nf-next-23-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next:
        netfilter: nf_tables: limit allowed range via nla_policy
        netfilter: nf_tables: Introduce NFT_MSG_GETSETELEM_RESET
        netfilter: snat: evict closing tcp entries on reply tuple collision
        netfilter: nf_tables: permit update of set size
        netfilter: ipset: remove rcu_read_lock_bh pair from ip_set_test
        netfilter: nft_payload: rebuild vlan header when needed
        ipvs: dynamically limit the connection hash table
        ipvs: increase ip_vs_conn_tab_bits range for 64BIT
      ====================
      
      Link: https://lore.kernel.org/r/20230626064749.75525-1-pablo@netfilter.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      61dc651c
  3. Jun 26, 2023
  4. Jun 25, 2023