]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.19
authorSasha Levin <sashal@kernel.org>
Mon, 19 Aug 2024 14:19:33 +0000 (10:19 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 19 Aug 2024 14:19:33 +0000 (10:19 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.19/atm-idt77252-prevent-use-after-free-in-dequeue_rx.patch [new file with mode: 0644]
queue-4.19/net-dsa-vsc73xx-pass-value-in-phy_write-operation.patch [new file with mode: 0644]
queue-4.19/net-mlx5e-correctly-report-errors-for-ethtool-rx-flo.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/atm-idt77252-prevent-use-after-free-in-dequeue_rx.patch b/queue-4.19/atm-idt77252-prevent-use-after-free-in-dequeue_rx.patch
new file mode 100644 (file)
index 0000000..6f51ed5
--- /dev/null
@@ -0,0 +1,56 @@
+From 6a4615d0db562f3e00b769102c1e5c55023b83cf Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 9 Aug 2024 15:28:19 +0300
+Subject: atm: idt77252: prevent use after free in dequeue_rx()
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+[ Upstream commit a9a18e8f770c9b0703dab93580d0b02e199a4c79 ]
+
+We can't dereference "skb" after calling vcc->push() because the skb
+is released.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/atm/idt77252.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
+index 36629633ae52a..c76792a471354 100644
+--- a/drivers/atm/idt77252.c
++++ b/drivers/atm/idt77252.c
+@@ -1117,8 +1117,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+       rpp->len += skb->len;
+       if (stat & SAR_RSQE_EPDU) {
++              unsigned int len, truesize;
+               unsigned char *l1l2;
+-              unsigned int len;
+               l1l2 = (unsigned char *) ((unsigned long) skb->data + skb->len - 6);
+@@ -1188,14 +1188,15 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+               ATM_SKB(skb)->vcc = vcc;
+               __net_timestamp(skb);
++              truesize = skb->truesize;
+               vcc->push(vcc, skb);
+               atomic_inc(&vcc->stats->rx);
+-              if (skb->truesize > SAR_FB_SIZE_3)
++              if (truesize > SAR_FB_SIZE_3)
+                       add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
+-              else if (skb->truesize > SAR_FB_SIZE_2)
++              else if (truesize > SAR_FB_SIZE_2)
+                       add_rx_skb(card, 2, SAR_FB_SIZE_2, 1);
+-              else if (skb->truesize > SAR_FB_SIZE_1)
++              else if (truesize > SAR_FB_SIZE_1)
+                       add_rx_skb(card, 1, SAR_FB_SIZE_1, 1);
+               else
+                       add_rx_skb(card, 0, SAR_FB_SIZE_0, 1);
+-- 
+2.43.0
+
diff --git a/queue-4.19/net-dsa-vsc73xx-pass-value-in-phy_write-operation.patch b/queue-4.19/net-dsa-vsc73xx-pass-value-in-phy_write-operation.patch
new file mode 100644 (file)
index 0000000..68dedda
--- /dev/null
@@ -0,0 +1,40 @@
+From a7d5bf5bb7a4b7477f70f6929489c2a0606e096c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 9 Aug 2024 21:38:03 +0200
+Subject: net: dsa: vsc73xx: pass value in phy_write operation
+
+From: Pawel Dembicki <paweldembicki@gmail.com>
+
+[ Upstream commit 5b9eebc2c7a5f0cc7950d918c1e8a4ad4bed5010 ]
+
+In the 'vsc73xx_phy_write' function, the register value is missing,
+and the phy write operation always sends zeros.
+
+This commit passes the value variable into the proper register.
+
+Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")
+Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
+Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
+Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/dsa/vitesse-vsc73xx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/dsa/vitesse-vsc73xx.c b/drivers/net/dsa/vitesse-vsc73xx.c
+index 34fefa015fd79..eaafb1c30c91c 100644
+--- a/drivers/net/dsa/vitesse-vsc73xx.c
++++ b/drivers/net/dsa/vitesse-vsc73xx.c
+@@ -649,7 +649,7 @@ static int vsc73xx_phy_write(struct dsa_switch *ds, int phy, int regnum,
+               return 0;
+       }
+-      cmd = (phy << 21) | (regnum << 16);
++      cmd = (phy << 21) | (regnum << 16) | val;
+       ret = vsc73xx_write(vsc, VSC73XX_BLOCK_MII, 0, 1, cmd);
+       if (ret)
+               return ret;
+-- 
+2.43.0
+
diff --git a/queue-4.19/net-mlx5e-correctly-report-errors-for-ethtool-rx-flo.patch b/queue-4.19/net-mlx5e-correctly-report-errors-for-ethtool-rx-flo.patch
new file mode 100644 (file)
index 0000000..6ffce67
--- /dev/null
@@ -0,0 +1,46 @@
+From 6293d367e45158dcbe908acc2800d00bb3f9786c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 8 Aug 2024 17:41:05 +0300
+Subject: net/mlx5e: Correctly report errors for ethtool rx flows
+
+From: Cosmin Ratiu <cratiu@nvidia.com>
+
+[ Upstream commit cbc796be1779c4dbc9a482c7233995e2a8b6bfb3 ]
+
+Previously, an ethtool rx flow with no attrs would not be added to the
+NIC as it has no rules to configure the hw with, but it would be
+reported as successful to the caller (return code 0). This is confusing
+for the user as ethtool then reports "Added rule $num", but no rule was
+actually added.
+
+This change corrects that by instead reporting these wrong rules as
+-EINVAL.
+
+Fixes: b29c61dac3a2 ("net/mlx5e: Ethtool steering flow validation refactoring")
+Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
+Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
+Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
+Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
+Link: https://patch.msgid.link/20240808144107.2095424-5-tariqt@nvidia.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
+index 41cde926cdab6..48ae9c201af46 100644
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
+@@ -689,7 +689,7 @@ mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv,
+       if (num_tuples <= 0) {
+               netdev_warn(priv->netdev, "%s: flow is not valid %d\n",
+                           __func__, num_tuples);
+-              return num_tuples;
++              return num_tuples < 0 ? num_tuples : -EINVAL;
+       }
+       eth_ft = get_flow_table(priv, fs, num_tuples);
+-- 
+2.43.0
+
index 762a4dc9f158e46b9e7c06aa26ac74b039178f08..decab93018c9684c1e3740ae9017b7edc8856e1b 100644 (file)
@@ -11,3 +11,6 @@ drm-amdgpu-actually-check-flags-for-all-context-ops.patch
 memcg_write_event_control-fix-a-user-triggerable-oops.patch
 s390-cio-rename-bitmap_size-idset_bitmap_size.patch
 btrfs-rename-bitmap_set_bits-btrfs_bitmap_set_bits.patch
+net-mlx5e-correctly-report-errors-for-ethtool-rx-flo.patch
+atm-idt77252-prevent-use-after-free-in-dequeue_rx.patch
+net-dsa-vsc73xx-pass-value-in-phy_write-operation.patch