Patch "nfp: add port from netdev validation for EEPROM access" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    nfp: add port from netdev validation for EEPROM access

to the 5.15-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:
     nfp-add-port-from-netdev-validation-for-eeprom-acces.patch
and it can be found in the queue-5.15 subdirectory.

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



commit d8d5691b92ccfecf093adabd64d87681078cb554
Author: Jaco Coetzee <jaco.coetzee@xxxxxxxxxxxx>
Date:   Thu Nov 17 16:37:44 2022 +0100

    nfp: add port from netdev validation for EEPROM access
    
    [ Upstream commit 0873016d46f6dfafd1bdf4d9b935b3331b226f7c ]
    
    Setting of the port flag `NFP_PORT_CHANGED`, introduced
    to ensure the correct reading of EEPROM data, causes a
    fatal kernel NULL pointer dereference in cases where
    the target netdev type cannot be determined.
    
    Add validation of port struct pointer before attempting
    to set the `NFP_PORT_CHANGED` flag. Return that operation
    is not supported if the netdev type cannot be determined.
    
    Fixes: 4ae97cae07e1 ("nfp: ethtool: fix the display error of `ethtool -m DEVNAME`")
    Signed-off-by: Jaco Coetzee <jaco.coetzee@xxxxxxxxxxxx>
    Reviewed-by: Louis Peens <louis.peens@xxxxxxxxxxxx>
    Signed-off-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
index 865865adfefc..d295942968f3 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
@@ -1219,6 +1219,9 @@ nfp_port_get_module_info(struct net_device *netdev,
 	u8 data;
 
 	port = nfp_port_from_netdev(netdev);
+	if (!port)
+		return -EOPNOTSUPP;
+
 	/* update port state to get latest interface */
 	set_bit(NFP_PORT_CHANGED, &port->flags);
 	eth_port = nfp_port_get_eth_port(port);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux