Patch "mlxsw: spectrum: Fix memory leak at skb reallocation" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
mlxsw: spectrum: Fix memory leak at skb reallocation
to the 4.4-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:
mlxsw-spectrum-fix-memory-leak-at-skb-reallocation.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Wed Feb 1 08:49:51 CET 2017
From: Arkadi Sharshevsky <[email protected]>
Date: Thu, 12 Jan 2017 09:10:37 +0100
Subject: mlxsw: spectrum: Fix memory leak at skb reallocation
From: Arkadi Sharshevsky <[email protected]>
[ Upstream commit 36bf38d158d3482119b3e159c0619b3c1539b508 ]
During transmission the skb is checked for headroom in order to add vendor specific header. In case the skb needs to be re-allocated, skb_realloc_headroom() is called to make a private copy of the original, but doesn't release it. Current code assumes that the original skb is released during reallocation and only releases it at the error path which causes a memory leak.
Fix this by adding the original skb release to the main path.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +1 -0
@@ -390,6 +390,7 @@ static netdev_tx_t mlxsw_sp_port_xmit(stdev_kfree_skb_any (skb_orig);return NETDEV_TX_OK ; } +dev_consume_skb_any (skb_orig); }if (eth_skb_pad (skb)) {
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/mlxsw-spectrum-fix-memory-leak-at-skb-reallocation.patch queue-4.4/mlxsw-switchx2-fix-memory-leak-at-skb-reallocation.patch