stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "net/mlx5e: Verify inline header size do not exceed SKB linear size" has been added to the 4.14-stable tree
@ 2018-03-07  3:30 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-03-07  3:30 UTC (permalink / raw)
  To: eranbe, gregkh, saeedm; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    net/mlx5e: Verify inline header size do not exceed SKB linear size

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-mlx5e-verify-inline-header-size-do-not-exceed-skb-linear-size.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Tue Mar  6 19:02:12 PST 2018
From: Eran Ben Elisha <eranbe@mellanox.com>
Date: Thu, 25 Jan 2018 11:18:09 +0200
Subject: net/mlx5e: Verify inline header size do not exceed SKB linear size

From: Eran Ben Elisha <eranbe@mellanox.com>


[ Upstream commit f600c6088018d1dbc5777d18daa83660f7ea4a64 ]

Driver tries to copy at least MLX5E_MIN_INLINE bytes into the control
segment of the WQE. It assumes that the linear part contains at least
MLX5E_MIN_INLINE bytes, which can be wrong.

Cited commit verified that driver will not copy more bytes into the
inline header part that the actual size of the packet. Re-factor this
check to make sure we do not exceed the linear part as well.

This fix is aligned with the current driver's assumption that the entire
L2 will be present in the linear part of the SKB.

Fixes: 6aace17e64f4 ("net/mlx5e: Fix inline header size for small packets")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -155,7 +155,7 @@ static inline u16 mlx5e_calc_min_inline(
 	default:
 		hlen = mlx5e_skb_l2_header_offset(skb);
 	}
-	return min_t(u16, hlen, skb->len);
+	return min_t(u16, hlen, skb_headlen(skb));
 }
 
 static inline void mlx5e_tx_skb_pull_inline(unsigned char **skb_data,


Patches currently in stable-queue which might be from eranbe@mellanox.com are

queue-4.14/net-mlx5e-verify-inline-header-size-do-not-exceed-skb-linear-size.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-07  3:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-07  3:30 Patch "net/mlx5e: Verify inline header size do not exceed SKB linear size" has been added to the 4.14-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).