linux-yocto/include
Jakub Kicinski cfa7fa0207 net: make for_each_netdev_dump() a little more bug-proof
commit f22b4b55ed upstream.

I find the behavior of xa_for_each_start() slightly counter-intuitive.
It doesn't end the iteration by making the index point after the last
element. IOW calling xa_for_each_start() again after it "finished"
will run the body of the loop for the last valid element, instead
of doing nothing.

This works fine for netlink dumps if they terminate correctly
(i.e. coalesce or carefully handle NLM_DONE), but as we keep getting
reminded legacy dumps are unlikely to go away.

Fixing this generically at the xa_for_each_start() level seems hard -
there is no index reserved for "end of iteration".
ifindexes are 31b wide, tho, and iterator is ulong so for
for_each_netdev_dump() it's safe to go to the next element.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ The mctp RTM_GETADDR rework backport of acab78ae12 ("net: mctp: Don't
  access ifa_index when missing") pulled 2d45eeb7d5 ("mctp: no longer
  rely on net->dev_index_head[]") as a dependency. However, that change
  relies on this backport for correct behaviour of
  for_each_netdev_dump().

  Jakub mentions[1] that nothing should be relying on the old behaviour
  of for_each_netdev_dump(), hence the backport.

  [1]: https://lore.kernel.org/netdev/20250609083749.741c27f5@kernel.org/ ]
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:09:03 +01:00
..
acpi ACPICA: Avoid sequence overread in call to strncmp() 2025-06-27 11:08:52 +01:00
asm-generic mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() 2025-03-13 12:58:38 +01:00
clocksource x86/hyperv: Fix hv tsc page based sched_clock for hibernation 2025-01-10 14:31:36 +01:00
crypto crypto: ahash - Set default reqsize from ahash_alg 2025-06-04 14:42:06 +02:00
drm drm/gem: Internally test import_attach for imported objects 2025-06-04 14:42:21 +02:00
dt-bindings dt-bindings: clock: sunxi: Export PLL_VIDEO_2X and PLL_MIPI 2025-02-08 09:51:55 +01:00
keys
kunit
kvm
linux net: make for_each_netdev_dump() a little more bug-proof 2025-06-27 11:09:03 +01:00
math-emu
media media: v4l: Memset argument to 0 before calling get_mbus_config pad op 2025-06-04 14:42:09 +02:00
memory
misc
net net: Fix checksum update for ILA adj-transport 2025-06-27 11:09:00 +01:00
pcmcia
ras
rdma RDMA/uverbs: Propagate errors from rdma_lookup_get_uobject() 2025-06-04 14:41:59 +02:00
rv rv: Reset per-task monitors also for idle tasks 2025-02-17 09:40:32 +01:00
scsi
soc net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged 2025-05-09 09:43:58 +02:00
sound ALSA: pcm: Fix race of buffer access at PCM OSS layer 2025-06-04 14:42:19 +02:00
target
trace erofs: remove unused trace event erofs_destroy_inode 2025-06-27 11:09:00 +01:00
uapi bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETE 2025-06-27 11:09:00 +01:00
ufs scsi: ufs: Introduce quirk to extend PA_HIBERN8TIME for UFS devices 2025-06-04 14:41:52 +02:00
vdso
video
xen xen/mcelog: Add __nonstring annotations for unterminated strings 2025-04-25 10:45:11 +02:00