Skip to contentSkip to conversation

Patch "i40e: avoid null pointer dereference" has been added to the 4.7-stable tree

PATCH [email protected] 1 participant 1 message Oct 4, 2016

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

i40e: avoid null pointer dereference

to the 4.7-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:
i40e-avoid-null-pointer-dereference.patch
and it can be found in the queue-4.7 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 cd956722167ba4fdba9c1ce3eed251b04ea2e10f Mon Sep 17 00:00:00 2001

From: Heinrich Schuchardt <[email protected]>
Date: Tue, 17 May 2016 22:41:33 +0200
Subject: i40e: avoid null pointer dereference

From: Heinrich Schuchardt <[email protected]>

commit cd956722167ba4fdba9c1ce3eed251b04ea2e10f upstream.

In function i40e_debug_aq parameter desc is assumed to be possibly NULL. Do not dereference it before checking the value.

Fixes f905dd62be88 ("i40e/i40evf: add max buf len to aq debug print helper")
---
 drivers/net/ethernet/intel/i40e/i40e_common.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +3 -1
@@ -297,13 +297,15 @@ void i40e_debug_aq(struct i40e_hw *hw, e
 		   void *buffer, u16 buf_len)
 {
 	struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc;
-	u16 len = le16_to_cpu(aq_desc->datalen);
+	u16 len;
 	u8 *buf = (u8 *)buffer;
 	u16 i = 0;
 
 	if ((!(mask & hw->debug_mask)) || (desc == NULL))
 		return;
 
+	len = le16_to_cpu(aq_desc->datalen);
+
 	i40e_debug(hw, mask,
 		   "AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",
 		   le16_to_cpu(aq_desc->opcode),

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

queue-4.7/i40e-avoid-null-pointer-dereference.patch queue-4.7/mwifiex-illegal-assignment.patch