<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/net, branch v6.2-rc3</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge tag 'net-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2023-01-05T20:40:50+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-01-05T20:40:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=50011c32f421215f6231996fcc84fd1fe81c4a48'/>
<id>50011c32f421215f6231996fcc84fd1fe81c4a48</id>
<content type='text'>
Pull networking fixes from Jakub Kicinski:
 "Including fixes from bpf, wifi, and netfilter.

  Current release - regressions:

   - bpf: fix nullness propagation for reg to reg comparisons, avoid
     null-deref

   - inet: control sockets should not use current thread task_frag

   - bpf: always use maximal size for copy_array()

   - eth: bnxt_en: don't link netdev to a devlink port for VFs

  Current release - new code bugs:

   - rxrpc: fix a couple of potential use-after-frees

   - netfilter: conntrack: fix IPv6 exthdr error check

   - wifi: iwlwifi: fw: skip PPAG for JF, avoid FW crashes

   - eth: dsa: qca8k: various fixes for the in-band register access

   - eth: nfp: fix schedule in atomic context when sync mc address

   - eth: renesas: rswitch: fix getting mac address from device tree

   - mobile: ipa: use proper endpoint mask for suspend

  Previous releases - regressions:

   - tcp: add TIME_WAIT sockets in bhash2, fix regression caught by
     Jiri / python tests

   - net: tc: don't intepret cls results when asked to drop, fix
     oob-access

   - vrf: determine the dst using the original ifindex for multicast

   - eth: bnxt_en:
      - fix XDP RX path if BPF adjusted packet length
      - fix HDS (header placement) and jumbo thresholds for RX packets

   - eth: ice: xsk: do not use xdp_return_frame() on tx_buf-&gt;raw_buf,
     avoid memory corruptions

  Previous releases - always broken:

   - ulp: prevent ULP without clone op from entering the LISTEN status

   - veth: fix race with AF_XDP exposing old or uninitialized
     descriptors

   - bpf:
      - pull before calling skb_postpull_rcsum() (fix checksum support
        and avoid a WARN())
      - fix panic due to wrong pageattr of im-&gt;image (when livepatch and
        kretfunc coexist)
      - keep a reference to the mm, in case the task is dead

   - mptcp: fix deadlock in fastopen error path

   - netfilter:
      - nf_tables: perform type checking for existing sets
      - nf_tables: honor set timeout and garbage collection updates
      - ipset: fix hash:net,port,net hang with /0 subnet
      - ipset: avoid hung task warning when adding/deleting entries

   - selftests: net:
      - fix cmsg_so_mark.sh test hang on non-x86 systems
      - fix the arp_ndisc_evict_nocarrier test for IPv6

   - usb: rndis_host: secure rndis_query check against int overflow

   - eth: r8169: fix dmar pte write access during suspend/resume with
     WOL

   - eth: lan966x: fix configuration of the PCS

   - eth: sparx5: fix reading of the MAC address

   - eth: qed: allow sleep in qed_mcp_trace_dump()

   - eth: hns3:
      - fix interrupts re-initialization after VF FLR
      - fix handling of promisc when MAC addr table gets full
      - refine the handling for VF heartbeat

   - eth: mlx5:
      - properly handle ingress QinQ-tagged packets on VST
      - fix io_eq_size and event_eq_size params validation on big endian
      - fix RoCE setting at HCA level if not supported at all
      - don't turn CQE compression on by default for IPoIB

   - eth: ena:
      - fix toeplitz initial hash key value
      - account for the number of XDP-processed bytes in interface stats
      - fix rx_copybreak value update

  Misc:

   - ethtool: harden phy stat handling against buggy drivers

   - docs: netdev: convert maintainer's doc from FAQ to a normal
     document"

* tag 'net-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (112 commits)
  caif: fix memory leak in cfctrl_linkup_request()
  inet: control sockets should not use current thread task_frag
  net/ulp: prevent ULP without clone op from entering the LISTEN status
  qed: allow sleep in qed_mcp_trace_dump()
  MAINTAINERS: Update maintainers for ptp_vmw driver
  usb: rndis_host: Secure rndis_query check against int overflow
  net: dpaa: Fix dtsec check for PCS availability
  octeontx2-pf: Fix lmtst ID used in aura free
  drivers/net/bonding/bond_3ad: return when there's no aggregator
  netfilter: ipset: Rework long task execution when adding/deleting entries
  netfilter: ipset: fix hash:net,port,net hang with /0 subnet
  net: sparx5: Fix reading of the MAC address
  vxlan: Fix memory leaks in error path
  net: sched: htb: fix htb_classify() kernel-doc
  net: sched: cbq: dont intepret cls results when asked to drop
  net: sched: atm: dont intepret cls results when asked to drop
  dt-bindings: net: marvell,orion-mdio: Fix examples
  dt-bindings: net: sun8i-emac: Add phy-supply property
  net: ipa: use proper endpoint mask for suspend
  selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull networking fixes from Jakub Kicinski:
 "Including fixes from bpf, wifi, and netfilter.

  Current release - regressions:

   - bpf: fix nullness propagation for reg to reg comparisons, avoid
     null-deref

   - inet: control sockets should not use current thread task_frag

   - bpf: always use maximal size for copy_array()

   - eth: bnxt_en: don't link netdev to a devlink port for VFs

  Current release - new code bugs:

   - rxrpc: fix a couple of potential use-after-frees

   - netfilter: conntrack: fix IPv6 exthdr error check

   - wifi: iwlwifi: fw: skip PPAG for JF, avoid FW crashes

   - eth: dsa: qca8k: various fixes for the in-band register access

   - eth: nfp: fix schedule in atomic context when sync mc address

   - eth: renesas: rswitch: fix getting mac address from device tree

   - mobile: ipa: use proper endpoint mask for suspend

  Previous releases - regressions:

   - tcp: add TIME_WAIT sockets in bhash2, fix regression caught by
     Jiri / python tests

   - net: tc: don't intepret cls results when asked to drop, fix
     oob-access

   - vrf: determine the dst using the original ifindex for multicast

   - eth: bnxt_en:
      - fix XDP RX path if BPF adjusted packet length
      - fix HDS (header placement) and jumbo thresholds for RX packets

   - eth: ice: xsk: do not use xdp_return_frame() on tx_buf-&gt;raw_buf,
     avoid memory corruptions

  Previous releases - always broken:

   - ulp: prevent ULP without clone op from entering the LISTEN status

   - veth: fix race with AF_XDP exposing old or uninitialized
     descriptors

   - bpf:
      - pull before calling skb_postpull_rcsum() (fix checksum support
        and avoid a WARN())
      - fix panic due to wrong pageattr of im-&gt;image (when livepatch and
        kretfunc coexist)
      - keep a reference to the mm, in case the task is dead

   - mptcp: fix deadlock in fastopen error path

   - netfilter:
      - nf_tables: perform type checking for existing sets
      - nf_tables: honor set timeout and garbage collection updates
      - ipset: fix hash:net,port,net hang with /0 subnet
      - ipset: avoid hung task warning when adding/deleting entries

   - selftests: net:
      - fix cmsg_so_mark.sh test hang on non-x86 systems
      - fix the arp_ndisc_evict_nocarrier test for IPv6

   - usb: rndis_host: secure rndis_query check against int overflow

   - eth: r8169: fix dmar pte write access during suspend/resume with
     WOL

   - eth: lan966x: fix configuration of the PCS

   - eth: sparx5: fix reading of the MAC address

   - eth: qed: allow sleep in qed_mcp_trace_dump()

   - eth: hns3:
      - fix interrupts re-initialization after VF FLR
      - fix handling of promisc when MAC addr table gets full
      - refine the handling for VF heartbeat

   - eth: mlx5:
      - properly handle ingress QinQ-tagged packets on VST
      - fix io_eq_size and event_eq_size params validation on big endian
      - fix RoCE setting at HCA level if not supported at all
      - don't turn CQE compression on by default for IPoIB

   - eth: ena:
      - fix toeplitz initial hash key value
      - account for the number of XDP-processed bytes in interface stats
      - fix rx_copybreak value update

  Misc:

   - ethtool: harden phy stat handling against buggy drivers

   - docs: netdev: convert maintainer's doc from FAQ to a normal
     document"

* tag 'net-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (112 commits)
  caif: fix memory leak in cfctrl_linkup_request()
  inet: control sockets should not use current thread task_frag
  net/ulp: prevent ULP without clone op from entering the LISTEN status
  qed: allow sleep in qed_mcp_trace_dump()
  MAINTAINERS: Update maintainers for ptp_vmw driver
  usb: rndis_host: Secure rndis_query check against int overflow
  net: dpaa: Fix dtsec check for PCS availability
  octeontx2-pf: Fix lmtst ID used in aura free
  drivers/net/bonding/bond_3ad: return when there's no aggregator
  netfilter: ipset: Rework long task execution when adding/deleting entries
  netfilter: ipset: fix hash:net,port,net hang with /0 subnet
  net: sparx5: Fix reading of the MAC address
  vxlan: Fix memory leaks in error path
  net: sched: htb: fix htb_classify() kernel-doc
  net: sched: cbq: dont intepret cls results when asked to drop
  net: sched: atm: dont intepret cls results when asked to drop
  dt-bindings: net: marvell,orion-mdio: Fix examples
  dt-bindings: net: sun8i-emac: Add phy-supply property
  net: ipa: use proper endpoint mask for suspend
  selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>qed: allow sleep in qed_mcp_trace_dump()</title>
<updated>2023-01-05T04:32:56+00:00</updated>
<author>
<name>Caleb Sander</name>
<email>csander@purestorage.com</email>
</author>
<published>2023-01-03T23:30:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5401c3e0992860b11fb4b25796e4c4f1921740df'/>
<id>5401c3e0992860b11fb4b25796e4c4f1921740df</id>
<content type='text'>
By default, qed_mcp_cmd_and_union() delays 10us at a time in a loop
that can run 500K times, so calls to qed_mcp_nvm_rd_cmd()
may block the current thread for over 5s.
We observed thread scheduling delays over 700ms in production,
with stacktraces pointing to this code as the culprit.

qed_mcp_trace_dump() is called from ethtool, so sleeping is permitted.
It already can sleep in qed_mcp_halt(), which calls qed_mcp_cmd().
Add a "can sleep" parameter to qed_find_nvram_image() and
qed_nvram_read() so they can sleep during qed_mcp_trace_dump().
qed_mcp_trace_get_meta_info() and qed_mcp_trace_read_meta(),
called only by qed_mcp_trace_dump(), allow these functions to sleep.
I can't tell if the other caller (qed_grc_dump_mcp_hw_dump()) can sleep,
so keep b_can_sleep set to false when it calls these functions.

An example stacktrace from a custom warning we added to the kernel
showing a thread that has not scheduled despite long needing resched:
[ 2745.362925,17] ------------[ cut here ]------------
[ 2745.362941,17] WARNING: CPU: 23 PID: 5640 at arch/x86/kernel/irq.c:233 do_IRQ+0x15e/0x1a0()
[ 2745.362946,17] Thread not rescheduled for 744 ms after irq 99
[ 2745.362956,17] Modules linked in: ...
[ 2745.363339,17] CPU: 23 PID: 5640 Comm: lldpd Tainted: P           O    4.4.182+ #202104120910+6d1da174272d.61x
[ 2745.363343,17] Hardware name: FOXCONN MercuryB/Quicksilver Controller, BIOS H11P1N09 07/08/2020
[ 2745.363346,17]  0000000000000000 ffff885ec07c3ed8 ffffffff8131eb2f ffff885ec07c3f20
[ 2745.363358,17]  ffffffff81d14f64 ffff885ec07c3f10 ffffffff81072ac2 ffff88be98ed0000
[ 2745.363369,17]  0000000000000063 0000000000000174 0000000000000074 0000000000000000
[ 2745.363379,17] Call Trace:
[ 2745.363382,17]  &lt;IRQ&gt;  [&lt;ffffffff8131eb2f&gt;] dump_stack+0x8e/0xcf
[ 2745.363393,17]  [&lt;ffffffff81072ac2&gt;] warn_slowpath_common+0x82/0xc0
[ 2745.363398,17]  [&lt;ffffffff81072b4c&gt;] warn_slowpath_fmt+0x4c/0x50
[ 2745.363404,17]  [&lt;ffffffff810d5a8e&gt;] ? rcu_irq_exit+0xae/0xc0
[ 2745.363408,17]  [&lt;ffffffff817c99fe&gt;] do_IRQ+0x15e/0x1a0
[ 2745.363413,17]  [&lt;ffffffff817c7ac9&gt;] common_interrupt+0x89/0x89
[ 2745.363416,17]  &lt;EOI&gt;  [&lt;ffffffff8132aa74&gt;] ? delay_tsc+0x24/0x50
[ 2745.363425,17]  [&lt;ffffffff8132aa04&gt;] __udelay+0x34/0x40
[ 2745.363457,17]  [&lt;ffffffffa04d45ff&gt;] qed_mcp_cmd_and_union+0x36f/0x7d0 [qed]
[ 2745.363473,17]  [&lt;ffffffffa04d5ced&gt;] qed_mcp_nvm_rd_cmd+0x4d/0x90 [qed]
[ 2745.363490,17]  [&lt;ffffffffa04e1dc7&gt;] qed_mcp_trace_dump+0x4a7/0x630 [qed]
[ 2745.363504,17]  [&lt;ffffffffa04e2556&gt;] ? qed_fw_asserts_dump+0x1d6/0x1f0 [qed]
[ 2745.363520,17]  [&lt;ffffffffa04e4ea7&gt;] qed_dbg_mcp_trace_get_dump_buf_size+0x37/0x80 [qed]
[ 2745.363536,17]  [&lt;ffffffffa04ea881&gt;] qed_dbg_feature_size+0x61/0xa0 [qed]
[ 2745.363551,17]  [&lt;ffffffffa04eb427&gt;] qed_dbg_all_data_size+0x247/0x260 [qed]
[ 2745.363560,17]  [&lt;ffffffffa0482c10&gt;] qede_get_regs_len+0x30/0x40 [qede]
[ 2745.363566,17]  [&lt;ffffffff816c9783&gt;] ethtool_get_drvinfo+0xe3/0x190
[ 2745.363570,17]  [&lt;ffffffff816cc152&gt;] dev_ethtool+0x1362/0x2140
[ 2745.363575,17]  [&lt;ffffffff8109bcc6&gt;] ? finish_task_switch+0x76/0x260
[ 2745.363580,17]  [&lt;ffffffff817c2116&gt;] ? __schedule+0x3c6/0x9d0
[ 2745.363585,17]  [&lt;ffffffff810dbd50&gt;] ? hrtimer_start_range_ns+0x1d0/0x370
[ 2745.363589,17]  [&lt;ffffffff816c1e5b&gt;] ? dev_get_by_name_rcu+0x6b/0x90
[ 2745.363594,17]  [&lt;ffffffff816de6a8&gt;] dev_ioctl+0xe8/0x710
[ 2745.363599,17]  [&lt;ffffffff816a58a8&gt;] sock_do_ioctl+0x48/0x60
[ 2745.363603,17]  [&lt;ffffffff816a5d87&gt;] sock_ioctl+0x1c7/0x280
[ 2745.363608,17]  [&lt;ffffffff8111f393&gt;] ? seccomp_phase1+0x83/0x220
[ 2745.363612,17]  [&lt;ffffffff811e3503&gt;] do_vfs_ioctl+0x2b3/0x4e0
[ 2745.363616,17]  [&lt;ffffffff811e3771&gt;] SyS_ioctl+0x41/0x70
[ 2745.363619,17]  [&lt;ffffffff817c6ffe&gt;] entry_SYSCALL_64_fastpath+0x1e/0x79
[ 2745.363622,17] ---[ end trace f6954aa440266421 ]---

Fixes: c965db4446291 ("qed: Add support for debug data collection")
Signed-off-by: Caleb Sander &lt;csander@purestorage.com&gt;
Acked-by: Alok Prasad &lt;palok@marvell.com&gt;
Link: https://lore.kernel.org/r/20230103233021.1457646-1-csander@purestorage.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default, qed_mcp_cmd_and_union() delays 10us at a time in a loop
that can run 500K times, so calls to qed_mcp_nvm_rd_cmd()
may block the current thread for over 5s.
We observed thread scheduling delays over 700ms in production,
with stacktraces pointing to this code as the culprit.

qed_mcp_trace_dump() is called from ethtool, so sleeping is permitted.
It already can sleep in qed_mcp_halt(), which calls qed_mcp_cmd().
Add a "can sleep" parameter to qed_find_nvram_image() and
qed_nvram_read() so they can sleep during qed_mcp_trace_dump().
qed_mcp_trace_get_meta_info() and qed_mcp_trace_read_meta(),
called only by qed_mcp_trace_dump(), allow these functions to sleep.
I can't tell if the other caller (qed_grc_dump_mcp_hw_dump()) can sleep,
so keep b_can_sleep set to false when it calls these functions.

An example stacktrace from a custom warning we added to the kernel
showing a thread that has not scheduled despite long needing resched:
[ 2745.362925,17] ------------[ cut here ]------------
[ 2745.362941,17] WARNING: CPU: 23 PID: 5640 at arch/x86/kernel/irq.c:233 do_IRQ+0x15e/0x1a0()
[ 2745.362946,17] Thread not rescheduled for 744 ms after irq 99
[ 2745.362956,17] Modules linked in: ...
[ 2745.363339,17] CPU: 23 PID: 5640 Comm: lldpd Tainted: P           O    4.4.182+ #202104120910+6d1da174272d.61x
[ 2745.363343,17] Hardware name: FOXCONN MercuryB/Quicksilver Controller, BIOS H11P1N09 07/08/2020
[ 2745.363346,17]  0000000000000000 ffff885ec07c3ed8 ffffffff8131eb2f ffff885ec07c3f20
[ 2745.363358,17]  ffffffff81d14f64 ffff885ec07c3f10 ffffffff81072ac2 ffff88be98ed0000
[ 2745.363369,17]  0000000000000063 0000000000000174 0000000000000074 0000000000000000
[ 2745.363379,17] Call Trace:
[ 2745.363382,17]  &lt;IRQ&gt;  [&lt;ffffffff8131eb2f&gt;] dump_stack+0x8e/0xcf
[ 2745.363393,17]  [&lt;ffffffff81072ac2&gt;] warn_slowpath_common+0x82/0xc0
[ 2745.363398,17]  [&lt;ffffffff81072b4c&gt;] warn_slowpath_fmt+0x4c/0x50
[ 2745.363404,17]  [&lt;ffffffff810d5a8e&gt;] ? rcu_irq_exit+0xae/0xc0
[ 2745.363408,17]  [&lt;ffffffff817c99fe&gt;] do_IRQ+0x15e/0x1a0
[ 2745.363413,17]  [&lt;ffffffff817c7ac9&gt;] common_interrupt+0x89/0x89
[ 2745.363416,17]  &lt;EOI&gt;  [&lt;ffffffff8132aa74&gt;] ? delay_tsc+0x24/0x50
[ 2745.363425,17]  [&lt;ffffffff8132aa04&gt;] __udelay+0x34/0x40
[ 2745.363457,17]  [&lt;ffffffffa04d45ff&gt;] qed_mcp_cmd_and_union+0x36f/0x7d0 [qed]
[ 2745.363473,17]  [&lt;ffffffffa04d5ced&gt;] qed_mcp_nvm_rd_cmd+0x4d/0x90 [qed]
[ 2745.363490,17]  [&lt;ffffffffa04e1dc7&gt;] qed_mcp_trace_dump+0x4a7/0x630 [qed]
[ 2745.363504,17]  [&lt;ffffffffa04e2556&gt;] ? qed_fw_asserts_dump+0x1d6/0x1f0 [qed]
[ 2745.363520,17]  [&lt;ffffffffa04e4ea7&gt;] qed_dbg_mcp_trace_get_dump_buf_size+0x37/0x80 [qed]
[ 2745.363536,17]  [&lt;ffffffffa04ea881&gt;] qed_dbg_feature_size+0x61/0xa0 [qed]
[ 2745.363551,17]  [&lt;ffffffffa04eb427&gt;] qed_dbg_all_data_size+0x247/0x260 [qed]
[ 2745.363560,17]  [&lt;ffffffffa0482c10&gt;] qede_get_regs_len+0x30/0x40 [qede]
[ 2745.363566,17]  [&lt;ffffffff816c9783&gt;] ethtool_get_drvinfo+0xe3/0x190
[ 2745.363570,17]  [&lt;ffffffff816cc152&gt;] dev_ethtool+0x1362/0x2140
[ 2745.363575,17]  [&lt;ffffffff8109bcc6&gt;] ? finish_task_switch+0x76/0x260
[ 2745.363580,17]  [&lt;ffffffff817c2116&gt;] ? __schedule+0x3c6/0x9d0
[ 2745.363585,17]  [&lt;ffffffff810dbd50&gt;] ? hrtimer_start_range_ns+0x1d0/0x370
[ 2745.363589,17]  [&lt;ffffffff816c1e5b&gt;] ? dev_get_by_name_rcu+0x6b/0x90
[ 2745.363594,17]  [&lt;ffffffff816de6a8&gt;] dev_ioctl+0xe8/0x710
[ 2745.363599,17]  [&lt;ffffffff816a58a8&gt;] sock_do_ioctl+0x48/0x60
[ 2745.363603,17]  [&lt;ffffffff816a5d87&gt;] sock_ioctl+0x1c7/0x280
[ 2745.363608,17]  [&lt;ffffffff8111f393&gt;] ? seccomp_phase1+0x83/0x220
[ 2745.363612,17]  [&lt;ffffffff811e3503&gt;] do_vfs_ioctl+0x2b3/0x4e0
[ 2745.363616,17]  [&lt;ffffffff811e3771&gt;] SyS_ioctl+0x41/0x70
[ 2745.363619,17]  [&lt;ffffffff817c6ffe&gt;] entry_SYSCALL_64_fastpath+0x1e/0x79
[ 2745.363622,17] ---[ end trace f6954aa440266421 ]---

Fixes: c965db4446291 ("qed: Add support for debug data collection")
Signed-off-by: Caleb Sander &lt;csander@purestorage.com&gt;
Acked-by: Alok Prasad &lt;palok@marvell.com&gt;
Link: https://lore.kernel.org/r/20230103233021.1457646-1-csander@purestorage.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: rndis_host: Secure rndis_query check against int overflow</title>
<updated>2023-01-03T09:24:41+00:00</updated>
<author>
<name>Szymon Heidrich</name>
<email>szymon.heidrich@gmail.com</email>
</author>
<published>2023-01-03T09:17:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c7dd13805f8b8fc1ce3b6d40f6aff47e66b72ad2'/>
<id>c7dd13805f8b8fc1ce3b6d40f6aff47e66b72ad2</id>
<content type='text'>
Variables off and len typed as uint32 in rndis_query function
are controlled by incoming RNDIS response message thus their
value may be manipulated. Setting off to a unexpectetly large
value will cause the sum with len and 8 to overflow and pass
the implemented validation step. Consequently the response
pointer will be referring to a location past the expected
buffer boundaries allowing information leakage e.g. via
RNDIS_OID_802_3_PERMANENT_ADDRESS OID.

Fixes: ddda08624013 ("USB: rndis_host, various cleanups")
Signed-off-by: Szymon Heidrich &lt;szymon.heidrich@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Variables off and len typed as uint32 in rndis_query function
are controlled by incoming RNDIS response message thus their
value may be manipulated. Setting off to a unexpectetly large
value will cause the sum with len and 8 to overflow and pass
the implemented validation step. Consequently the response
pointer will be referring to a location past the expected
buffer boundaries allowing information leakage e.g. via
RNDIS_OID_802_3_PERMANENT_ADDRESS OID.

Fixes: ddda08624013 ("USB: rndis_host, various cleanups")
Signed-off-by: Szymon Heidrich &lt;szymon.heidrich@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: dpaa: Fix dtsec check for PCS availability</title>
<updated>2023-01-03T09:23:17+00:00</updated>
<author>
<name>Sean Anderson</name>
<email>seanga2@gmail.com</email>
</author>
<published>2023-01-03T06:50:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7dc61838541928895abae6d2355258e02a251bba'/>
<id>7dc61838541928895abae6d2355258e02a251bba</id>
<content type='text'>
We want to fail if the PCS is not available, not if it is available. Fix
this condition.

Fixes: 5d93cfcf7360 ("net: dpaa: Convert to phylink")
Reported-by: Christian Zigotzky &lt;info@xenosoft.de&gt;
Signed-off-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want to fail if the PCS is not available, not if it is available. Fix
this condition.

Fixes: 5d93cfcf7360 ("net: dpaa: Convert to phylink")
Reported-by: Christian Zigotzky &lt;info@xenosoft.de&gt;
Signed-off-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>octeontx2-pf: Fix lmtst ID used in aura free</title>
<updated>2023-01-03T09:19:03+00:00</updated>
<author>
<name>Geetha sowjanya</name>
<email>gakula@marvell.com</email>
</author>
<published>2023-01-03T03:50:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4af1b64f80fbe1275fb02c5f1c0cef099a4a231f'/>
<id>4af1b64f80fbe1275fb02c5f1c0cef099a4a231f</id>
<content type='text'>
Current code uses per_cpu pointer to get the lmtst_id mapped to
the core on which aura_free() is executed. Using per_cpu pointer
without preemption disable causing mismatch between lmtst_id and
core on which pointer gets freed. This patch fixes the issue by
disabling preemption around aura_free.

Fixes: ef6c8da71eaf ("octeontx2-pf: cn10K: Reserve LMTST lines per core")
Signed-off-by: Sunil Goutham &lt;sgoutham@marvell.com&gt;
Signed-off-by: Geetha sowjanya &lt;gakula@marvell.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current code uses per_cpu pointer to get the lmtst_id mapped to
the core on which aura_free() is executed. Using per_cpu pointer
without preemption disable causing mismatch between lmtst_id and
core on which pointer gets freed. This patch fixes the issue by
disabling preemption around aura_free.

Fixes: ef6c8da71eaf ("octeontx2-pf: cn10K: Reserve LMTST lines per core")
Signed-off-by: Sunil Goutham &lt;sgoutham@marvell.com&gt;
Signed-off-by: Geetha sowjanya &lt;gakula@marvell.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/net/bonding/bond_3ad: return when there's no aggregator</title>
<updated>2023-01-03T09:17:12+00:00</updated>
<author>
<name>Daniil Tatianin</name>
<email>d-tatianin@yandex-team.ru</email>
</author>
<published>2023-01-02T09:53:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9c807965483f42df1d053b7436eedd6cf28ece6f'/>
<id>9c807965483f42df1d053b7436eedd6cf28ece6f</id>
<content type='text'>
Otherwise we would dereference a NULL aggregator pointer when calling
__set_agg_ports_ready on the line below.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Daniil Tatianin &lt;d-tatianin@yandex-team.ru&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise we would dereference a NULL aggregator pointer when calling
__set_agg_ports_ready on the line below.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Daniil Tatianin &lt;d-tatianin@yandex-team.ru&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: sparx5: Fix reading of the MAC address</title>
<updated>2023-01-02T13:39:14+00:00</updated>
<author>
<name>Horatiu Vultur</name>
<email>horatiu.vultur@microchip.com</email>
</author>
<published>2023-01-02T12:12:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=588ab2dc25f60efeb516b4abedb6c551949cc185'/>
<id>588ab2dc25f60efeb516b4abedb6c551949cc185</id>
<content type='text'>
There is an issue with the checking of the return value of
'of_get_mac_address', which returns 0 on success and negative value on
failure. The driver interpretated the result the opposite way. Therefore
if there was a MAC address defined in the DT, then the driver was
generating a random MAC address otherwise it would use address 0.
Fix this by checking correctly the return value of 'of_get_mac_address'

Fixes: b74ef9f9cb91 ("net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe()")
Signed-off-by: Horatiu Vultur &lt;horatiu.vultur@microchip.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is an issue with the checking of the return value of
'of_get_mac_address', which returns 0 on success and negative value on
failure. The driver interpretated the result the opposite way. Therefore
if there was a MAC address defined in the DT, then the driver was
generating a random MAC address otherwise it would use address 0.
Fix this by checking correctly the return value of 'of_get_mac_address'

Fixes: b74ef9f9cb91 ("net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe()")
Signed-off-by: Horatiu Vultur &lt;horatiu.vultur@microchip.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vxlan: Fix memory leaks in error path</title>
<updated>2023-01-02T13:37:33+00:00</updated>
<author>
<name>Ido Schimmel</name>
<email>idosch@nvidia.com</email>
</author>
<published>2023-01-02T06:55:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=06bf62944144a92d83dd14fd1378d2a288259561'/>
<id>06bf62944144a92d83dd14fd1378d2a288259561</id>
<content type='text'>
The memory allocated by vxlan_vnigroup_init() is not freed in the error
path, leading to memory leaks [1]. Fix by calling
vxlan_vnigroup_uninit() in the error path.

The leaks can be reproduced by annotating gro_cells_init() with
ALLOW_ERROR_INJECTION() and then running:

 # echo "100" &gt; /sys/kernel/debug/fail_function/probability
 # echo "1" &gt; /sys/kernel/debug/fail_function/times
 # echo "gro_cells_init" &gt; /sys/kernel/debug/fail_function/inject
 # printf %#x -12 &gt; /sys/kernel/debug/fail_function/gro_cells_init/retval
 # ip link add name vxlan0 type vxlan dstport 4789 external vnifilter
 RTNETLINK answers: Cannot allocate memory

[1]
unreferenced object 0xffff88810db84a00 (size 512):
  comm "ip", pid 330, jiffies 4295010045 (age 66.016s)
  hex dump (first 32 bytes):
    f8 d5 76 0e 81 88 ff ff 01 00 00 00 00 00 00 02  ..v.............
    03 00 04 00 48 00 00 00 00 00 00 01 04 00 01 00  ....H...........
  backtrace:
    [&lt;ffffffff81a3097a&gt;] kmalloc_trace+0x2a/0x60
    [&lt;ffffffff82f049fc&gt;] vxlan_vnigroup_init+0x4c/0x160
    [&lt;ffffffff82ecd69e&gt;] vxlan_init+0x1ae/0x280
    [&lt;ffffffff836858ca&gt;] register_netdevice+0x57a/0x16d0
    [&lt;ffffffff82ef67b7&gt;] __vxlan_dev_create+0x7c7/0xa50
    [&lt;ffffffff82ef6ce6&gt;] vxlan_newlink+0xd6/0x130
    [&lt;ffffffff836d02ab&gt;] __rtnl_newlink+0x112b/0x18a0
    [&lt;ffffffff836d0a8c&gt;] rtnl_newlink+0x6c/0xa0
    [&lt;ffffffff836c0ddf&gt;] rtnetlink_rcv_msg+0x43f/0xd40
    [&lt;ffffffff83908ce0&gt;] netlink_rcv_skb+0x170/0x440
    [&lt;ffffffff839066af&gt;] netlink_unicast+0x53f/0x810
    [&lt;ffffffff839072d8&gt;] netlink_sendmsg+0x958/0xe70
    [&lt;ffffffff835c319f&gt;] ____sys_sendmsg+0x78f/0xa90
    [&lt;ffffffff835cd6da&gt;] ___sys_sendmsg+0x13a/0x1e0
    [&lt;ffffffff835cd94c&gt;] __sys_sendmsg+0x11c/0x1f0
    [&lt;ffffffff8424da78&gt;] do_syscall_64+0x38/0x80
unreferenced object 0xffff88810e76d5f8 (size 192):
  comm "ip", pid 330, jiffies 4295010045 (age 66.016s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 db e1 4f e7 00 00 00 00  ..........O.....
    08 d6 76 0e 81 88 ff ff 08 d6 76 0e 81 88 ff ff  ..v.......v.....
  backtrace:
    [&lt;ffffffff81a3162e&gt;] __kmalloc_node+0x4e/0x90
    [&lt;ffffffff81a0e166&gt;] kvmalloc_node+0xa6/0x1f0
    [&lt;ffffffff8276e1a3&gt;] bucket_table_alloc.isra.0+0x83/0x460
    [&lt;ffffffff8276f18b&gt;] rhashtable_init+0x43b/0x7c0
    [&lt;ffffffff82f04a1c&gt;] vxlan_vnigroup_init+0x6c/0x160
    [&lt;ffffffff82ecd69e&gt;] vxlan_init+0x1ae/0x280
    [&lt;ffffffff836858ca&gt;] register_netdevice+0x57a/0x16d0
    [&lt;ffffffff82ef67b7&gt;] __vxlan_dev_create+0x7c7/0xa50
    [&lt;ffffffff82ef6ce6&gt;] vxlan_newlink+0xd6/0x130
    [&lt;ffffffff836d02ab&gt;] __rtnl_newlink+0x112b/0x18a0
    [&lt;ffffffff836d0a8c&gt;] rtnl_newlink+0x6c/0xa0
    [&lt;ffffffff836c0ddf&gt;] rtnetlink_rcv_msg+0x43f/0xd40
    [&lt;ffffffff83908ce0&gt;] netlink_rcv_skb+0x170/0x440
    [&lt;ffffffff839066af&gt;] netlink_unicast+0x53f/0x810
    [&lt;ffffffff839072d8&gt;] netlink_sendmsg+0x958/0xe70
    [&lt;ffffffff835c319f&gt;] ____sys_sendmsg+0x78f/0xa90

Fixes: f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device")
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Reviewed-by: Nikolay Aleksandrov &lt;razor@blackwall.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The memory allocated by vxlan_vnigroup_init() is not freed in the error
path, leading to memory leaks [1]. Fix by calling
vxlan_vnigroup_uninit() in the error path.

The leaks can be reproduced by annotating gro_cells_init() with
ALLOW_ERROR_INJECTION() and then running:

 # echo "100" &gt; /sys/kernel/debug/fail_function/probability
 # echo "1" &gt; /sys/kernel/debug/fail_function/times
 # echo "gro_cells_init" &gt; /sys/kernel/debug/fail_function/inject
 # printf %#x -12 &gt; /sys/kernel/debug/fail_function/gro_cells_init/retval
 # ip link add name vxlan0 type vxlan dstport 4789 external vnifilter
 RTNETLINK answers: Cannot allocate memory

[1]
unreferenced object 0xffff88810db84a00 (size 512):
  comm "ip", pid 330, jiffies 4295010045 (age 66.016s)
  hex dump (first 32 bytes):
    f8 d5 76 0e 81 88 ff ff 01 00 00 00 00 00 00 02  ..v.............
    03 00 04 00 48 00 00 00 00 00 00 01 04 00 01 00  ....H...........
  backtrace:
    [&lt;ffffffff81a3097a&gt;] kmalloc_trace+0x2a/0x60
    [&lt;ffffffff82f049fc&gt;] vxlan_vnigroup_init+0x4c/0x160
    [&lt;ffffffff82ecd69e&gt;] vxlan_init+0x1ae/0x280
    [&lt;ffffffff836858ca&gt;] register_netdevice+0x57a/0x16d0
    [&lt;ffffffff82ef67b7&gt;] __vxlan_dev_create+0x7c7/0xa50
    [&lt;ffffffff82ef6ce6&gt;] vxlan_newlink+0xd6/0x130
    [&lt;ffffffff836d02ab&gt;] __rtnl_newlink+0x112b/0x18a0
    [&lt;ffffffff836d0a8c&gt;] rtnl_newlink+0x6c/0xa0
    [&lt;ffffffff836c0ddf&gt;] rtnetlink_rcv_msg+0x43f/0xd40
    [&lt;ffffffff83908ce0&gt;] netlink_rcv_skb+0x170/0x440
    [&lt;ffffffff839066af&gt;] netlink_unicast+0x53f/0x810
    [&lt;ffffffff839072d8&gt;] netlink_sendmsg+0x958/0xe70
    [&lt;ffffffff835c319f&gt;] ____sys_sendmsg+0x78f/0xa90
    [&lt;ffffffff835cd6da&gt;] ___sys_sendmsg+0x13a/0x1e0
    [&lt;ffffffff835cd94c&gt;] __sys_sendmsg+0x11c/0x1f0
    [&lt;ffffffff8424da78&gt;] do_syscall_64+0x38/0x80
unreferenced object 0xffff88810e76d5f8 (size 192):
  comm "ip", pid 330, jiffies 4295010045 (age 66.016s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 db e1 4f e7 00 00 00 00  ..........O.....
    08 d6 76 0e 81 88 ff ff 08 d6 76 0e 81 88 ff ff  ..v.......v.....
  backtrace:
    [&lt;ffffffff81a3162e&gt;] __kmalloc_node+0x4e/0x90
    [&lt;ffffffff81a0e166&gt;] kvmalloc_node+0xa6/0x1f0
    [&lt;ffffffff8276e1a3&gt;] bucket_table_alloc.isra.0+0x83/0x460
    [&lt;ffffffff8276f18b&gt;] rhashtable_init+0x43b/0x7c0
    [&lt;ffffffff82f04a1c&gt;] vxlan_vnigroup_init+0x6c/0x160
    [&lt;ffffffff82ecd69e&gt;] vxlan_init+0x1ae/0x280
    [&lt;ffffffff836858ca&gt;] register_netdevice+0x57a/0x16d0
    [&lt;ffffffff82ef67b7&gt;] __vxlan_dev_create+0x7c7/0xa50
    [&lt;ffffffff82ef6ce6&gt;] vxlan_newlink+0xd6/0x130
    [&lt;ffffffff836d02ab&gt;] __rtnl_newlink+0x112b/0x18a0
    [&lt;ffffffff836d0a8c&gt;] rtnl_newlink+0x6c/0xa0
    [&lt;ffffffff836c0ddf&gt;] rtnetlink_rcv_msg+0x43f/0xd40
    [&lt;ffffffff83908ce0&gt;] netlink_rcv_skb+0x170/0x440
    [&lt;ffffffff839066af&gt;] netlink_unicast+0x53f/0x810
    [&lt;ffffffff839072d8&gt;] netlink_sendmsg+0x958/0xe70
    [&lt;ffffffff835c319f&gt;] ____sys_sendmsg+0x78f/0xa90

Fixes: f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device")
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Reviewed-by: Nikolay Aleksandrov &lt;razor@blackwall.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ipa: use proper endpoint mask for suspend</title>
<updated>2023-01-01T12:01:14+00:00</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2022-12-30T22:33:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d9d71a89f28d27ac772c429b37d52668d011df7a'/>
<id>d9d71a89f28d27ac772c429b37d52668d011df7a</id>
<content type='text'>
It is now possible for a system to have more than 32 endpoints.  As
a result, registers related to endpoint suspend are parameterized,
with 32 endpoints represented in one more registers.

In ipa_interrupt_suspend_control(), the IPA_SUSPEND_EN register
offset is determined properly, but the bit mask used still assumes
the number of enpoints won't exceed 32.  This is a bug.  Fix it.

Fixes: f298ba785e2d ("net: ipa: add a parameter to suspend registers")
Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is now possible for a system to have more than 32 endpoints.  As
a result, registers related to endpoint suspend are parameterized,
with 32 endpoints represented in one more registers.

In ipa_interrupt_suspend_control(), the IPA_SUSPEND_EN register
offset is determined properly, but the bit mask used still assumes
the number of enpoints won't exceed 32.  This is a bug.  Fix it.

Fixes: f298ba785e2d ("net: ipa: add a parameter to suspend registers")
Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: dsa: qca8k: improve mdio master read/write by using single lo/hi</title>
<updated>2023-01-01T09:27:12+00:00</updated>
<author>
<name>Christian Marangi</name>
<email>ansuelsmth@gmail.com</email>
</author>
<published>2022-12-29T16:33:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a4165830ca237f2b3318faf62562bce8ce12a389'/>
<id>a4165830ca237f2b3318faf62562bce8ce12a389</id>
<content type='text'>
Improve mdio master read/write by using singe mii read/write lo/hi.

In a read and write we need to poll the mdio master regs in a busy loop
to check for a specific bit present in the upper half of the reg. We can
ignore the other half since it won't contain useful data. This will save
an additional useless read for each read and write operation.

In a read operation the returned data is present in the mdio master reg
lower half. We can ignore the other half since it won't contain useful
data. This will save an additional useless read for each read operation.

In a read operation it's needed to just set the hi half of the mdio
master reg as the lo half will be replaced by the result. This will save
an additional useless write for each read operation.

Tested-by: Ronald Wahl &lt;ronald.wahl@raritan.com&gt;
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improve mdio master read/write by using singe mii read/write lo/hi.

In a read and write we need to poll the mdio master regs in a busy loop
to check for a specific bit present in the upper half of the reg. We can
ignore the other half since it won't contain useful data. This will save
an additional useless read for each read and write operation.

In a read operation the returned data is present in the mdio master reg
lower half. We can ignore the other half since it won't contain useful
data. This will save an additional useless read for each read operation.

In a read operation it's needed to just set the hi half of the mdio
master reg as the lo half will be replaced by the result. This will save
an additional useless write for each read operation.

Tested-by: Ronald Wahl &lt;ronald.wahl@raritan.com&gt;
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
