net/mlx5e: Fix use after free in mlx5e_fs_init()
Subsystems (6)
PATCH 1/1 net/mlx5e: Fix use after free in mlx5e_fs_init()
Call mlx5e_fs_vlan_free(fs) before kvfree(fs).
---
This applies to net but I never really understand how mellanox patches work...
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +3 -2
@@ -1395,10 +1395,11 @@ struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile, }return fs; -err_free_fs: -kvfree (fs); + err_free_vlan:mlx5e_fs_vlan_free (fs); +err_free_fs: +kvfree (fs); err:return NULL ; }
Signature · 1 line
2.35.1
Quoted 8 lines · Dan Carpenter
Call
mlx5e_fs_vlan_free(fs)before kvfree(fs).Fixes af8bbf730068 ("net/mlx5e: Convert mlx5e_flow_steering member of mlx5e_priv to pointer")Signed-off-by Dan Carpenter <[email protected]>---
This applies to net but I never really understand how mellanox patches work...
Hi Dan,
This patch belongs to next kernel (6.0).
It seems that net-next (or parts of it) is already merged into net as we're in the merge window.
Quoted 11 lines
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +0
-0@@ -1395,10 +1395,11 @@ struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile, }return fs;
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile, · line 1405
Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +3
-2-err_free_fs: -kvfree (fs); + err_free_vlan:mlx5e_fs_vlan_free (fs); +err_free_fs: +kvfree (fs); err:return NULL ; }
Thanks for your patch!
Quoted 12 lines · Tariq Toukan
Quoted 8 lines · Dan Carpenter
Call
mlx5e_fs_vlan_free(fs)before kvfree(fs).Fixes af8bbf730068 ("net/mlx5e: Convert mlx5e_flow_steering member of mlx5e_priv to pointer")Signed-off-by Dan Carpenter <[email protected]>---
This applies to net but I never really understand how mellanox patches work...
Quoted 4 lines
Hi Dan,
This patch belongs to next kernel (6.0).
It seems that net-next (or parts of it) is already merged into net as we're in the merge window.
Right. But commit af8bbf730068 was merged by Saeed. I think that went through his tree and then pulled into one of the networking trees. But sometimes these patches are pulled directly into a networking tree.
I can't remember how it works, but it's somehow my job to remember this stuff for 200+ *hundred* different friggin git trees and put the tree name in the subject. :P (small rant).
Quoted 2 lines
Reviewed-by Tariq Toukan <[email protected]>
Thanks!
regards,
dan carpenter
Quoted 4 lines · Dan Carpenter
I can't remember how it works, but it's somehow my job to remember this stuff for 200+ *hundred* different friggin git trees and put the tree name in the subject. :P (small rant).
Huh. It's actuall 360 trees now. Wow.
Anyway, it needs to go into net and not net-next. I've told everyone else besides networking who asks for something like that in the subject that they can pound dirt.
regards,
dan carpenter
Jakub Kicinski
maintainerQuoted 3 lines · On Fri, 5 Aug 2022 09:26:06 +0300 Dan Carpenter wrote:
Anyway, it needs to go into net and not net-next. I've told everyone else besides networking who asks for something like that in the subject that they can pound dirt.
We appreciate the special treatment! :]