Skip to contentSkip to conversation

Patch "net/mlx5: Avoid dereferencing uninitialized pointer" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Apr 29, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

net/mlx5: Avoid dereferencing uninitialized pointer

to the 4.9-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-mlx5-avoid-dereferencing-uninitialized-pointer.patch
and it can be found in the queue-4.9 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 Sat Apr 29 08:22:13 CEST 2017

From: Talat Batheesh <[email protected]>
Date: Tue, 28 Mar 2017 16:13:41 +0300
Subject: net/mlx5: Avoid dereferencing uninitialized pointer

From: Talat Batheesh <[email protected]>

[ Upstream commit e497ec680c4cd51e76bfcdd49363d9ab8d32a757 ]

In NETDEV_CHANGEUPPER event the upper_info field is valid only when linking is true. Otherwise it should be ignored.

---
 drivers/net/ethernet/mellanox/mlx5/core/lag.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/lag.c +3 -2
@@ -294,7 +294,7 @@ static int mlx5_handle_changeupper_event
 					 struct netdev_notifier_changeupper_info *info)
 {
 	struct net_device *upper = info->upper_dev, *ndev_tmp;
-	struct netdev_lag_upper_info *lag_upper_info;
+	struct netdev_lag_upper_info *lag_upper_info = NULL;
 	bool is_bonded;
 	int bond_status = 0;
 	int num_slaves = 0;
@@ -303,7 +303,8 @@ static int mlx5_handle_changeupper_event
 	if (!netif_is_lag_master(upper))
 		return 0;
 
-	lag_upper_info = info->upper_info;
+	if (info->linking)
+		lag_upper_info = info->upper_info;
 
 	/* The event may still be of interest if the slave does not belong to
 	 * us, but is enslaved to a master which has one or more of our netdevs

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/net-mlx5-avoid-dereferencing-uninitialized-pointer.patch