Patch "devlink: remove reload failed checks in params get/set callbacks" has been added to the 5.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

    devlink: remove reload failed checks in params get/set callbacks

to the 5.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:
     devlink-remove-reload-failed-checks-in-params-get-se.patch
and it can be found in the queue-5.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 cfe30703ecfc658afcadda7b26266e334b4b8f4e
Author: Jiri Pirko <jiri@xxxxxxxxxxx>
Date:   Thu Jul 13 11:44:19 2023 +0200

    devlink: remove reload failed checks in params get/set callbacks
    
    [ Upstream commit 633d76ad01ad0321a1ace3e5cc4fed06753d7ac4 ]
    
    The checks in question were introduced by:
    commit 6b4db2e528f6 ("devlink: Fix use-after-free after a failed reload").
    That fixed an issue of reload with mlxsw driver.
    
    Back then, that was a valid fix, because there was a limitation
    in place that prevented drivers from registering/unregistering params
    when devlink instance was registered.
    
    It was possible to do the fix differently by changing drivers to
    register/unregister params in appropriate places making sure the ops
    operate only on memory which is allocated and initialized. But that,
    as a dependency, would require to remove the limitation mentioned above.
    
    Eventually, this limitation was lifted by:
    commit 1d18bb1a4ddd ("devlink: allow registering parameters after the instance")
    
    Also, the alternative fix (which also fixed another issue) was done by:
    commit 74cbc3c03c82 ("mlxsw: spectrum_acl_tcam: Move devlink param to TCAM code").
    
    Therefore, the checks are no longer relevant. Each driver should make
    sure to have the params registered only when the memory the ops
    are working with is allocated and initialized.
    
    So remove the checks.
    
    Signed-off-by: Jiri Pirko <jiri@xxxxxxxxxx>
    Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>
    Reviewed-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/core/devlink.c b/net/core/devlink.c
index 00c6944ed6342..38666dde89340 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -3620,7 +3620,7 @@ static int devlink_param_get(struct devlink *devlink,
 			     const struct devlink_param *param,
 			     struct devlink_param_gset_ctx *ctx)
 {
-	if (!param->get || devlink->reload_failed)
+	if (!param->get)
 		return -EOPNOTSUPP;
 	return param->get(devlink, param->id, ctx);
 }
@@ -3629,7 +3629,7 @@ static int devlink_param_set(struct devlink *devlink,
 			     const struct devlink_param *param,
 			     struct devlink_param_gset_ctx *ctx)
 {
-	if (!param->set || devlink->reload_failed)
+	if (!param->set)
 		return -EOPNOTSUPP;
 	return param->set(devlink, param->id, ctx);
 }



[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