]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Oct 2023 13:24:49 +0000 (15:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Oct 2023 13:24:49 +0000 (15:24 +0200)
added patches:
net-make-sure-we-never-create-ifindex-0.patch

queue-6.1/net-make-sure-we-never-create-ifindex-0.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/net-make-sure-we-never-create-ifindex-0.patch b/queue-6.1/net-make-sure-we-never-create-ifindex-0.patch
new file mode 100644 (file)
index 0000000..a6e550b
--- /dev/null
@@ -0,0 +1,35 @@
+From ceaac91dcd065db781d1ed5dfaef0686b8ec44dc Mon Sep 17 00:00:00 2001
+From: Jakub Kicinski <kuba@kernel.org>
+Date: Mon, 31 Jul 2023 10:11:58 -0700
+Subject: net: make sure we never create ifindex = 0
+
+From: Jakub Kicinski <kuba@kernel.org>
+
+commit ceaac91dcd065db781d1ed5dfaef0686b8ec44dc upstream.
+
+Instead of allocating from 1 use proper xa_init flag,
+to protect ourselves from IDs wrapping back to 0.
+
+Fixes: 759ab1edb56c ("net: store netdevs in an xarray")
+Reported-by: Stephen Hemminger <stephen@networkplumber.org>
+Link: https://lore.kernel.org/all/20230728162350.2a6d4979@hermes.local/
+Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
+Link: https://lore.kernel.org/r/20230731171159.988962-1-kuba@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/core/dev.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -11238,8 +11238,7 @@ static int __net_init netdev_init(struct
+       if (net->dev_index_head == NULL)
+               goto err_idx;
+-      net->ifindex = 1;
+-      xa_init_flags(&net->dev_by_index, XA_FLAGS_ALLOC);
++      xa_init_flags(&net->dev_by_index, XA_FLAGS_ALLOC1);
+       RAW_INIT_NOTIFIER_HEAD(&net->netdev_chain);
index 74681fdd4dc886f97973f5cff4e4bb8407f08e38..a6247e928dcc9c5c724b3d8a64fb077dc32de97c 100644 (file)
@@ -196,3 +196,4 @@ gpio-vf610-set-value-before-the-direction-to-avoid-a-glitch.patch
 asoc-pxa-fix-a-memory-leak-in-probe.patch
 drm-bridge-ti-sn65dsi86-associate-dsi-device-lifetim.patch
 drm-panel-move-aux-b116xw03-out-of-panel-edp-back-to.patch
+net-make-sure-we-never-create-ifindex-0.patch