Patch "net: ethtool: pse-pd: Fix possible null-deref" has been added to the 6.10-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

    net: ethtool: pse-pd: Fix possible null-deref

to the 6.10-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-ethtool-pse-pd-fix-possible-null-deref.patch
and it can be found in the queue-6.10 subdirectory.

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



commit 6e5e487f0ea1aba682eec8a0c1f316b1f572c03d
Author: Kory Maincent <kory.maincent@xxxxxxxxxxx>
Date:   Thu Jul 11 15:55:19 2024 +0200

    net: ethtool: pse-pd: Fix possible null-deref
    
    [ Upstream commit 4cddb0f15ea9c62f81b4889ea69a99368cc63a86 ]
    
    Fix a possible null dereference when a PSE supports both c33 and PoDL, but
    only one of the netlink attributes is specified. The c33 or PoDL PSE
    capabilities are already validated in the ethnl_set_pse_validate() call.
    
    Signed-off-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>
    Reported-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Closes: https://lore.kernel.org/netdev/20240705184116.13d8235a@xxxxxxxxxx/
    Fixes: 4d18e3ddf427 ("net: ethtool: pse-pd: Expand pse commands with the PSE PoE interface")
    Link: https://patch.msgid.link/20240711-fix_pse_pd_deref-v3-2-edd78fc4fe42@xxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ethtool/pse-pd.c b/net/ethtool/pse-pd.c
index 982995ff16280..776ac96cdadc9 100644
--- a/net/ethtool/pse-pd.c
+++ b/net/ethtool/pse-pd.c
@@ -178,9 +178,9 @@ ethnl_set_pse(struct ethnl_req_info *req_info, struct genl_info *info)
 
 	phydev = dev->phydev;
 	/* These values are already validated by the ethnl_pse_set_policy */
-	if (pse_has_podl(phydev->psec))
+	if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL])
 		config.podl_admin_control = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]);
-	if (pse_has_c33(phydev->psec))
+	if (tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL])
 		config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]);
 
 	/* Return errno directly - PSE has no notification




[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