* [PATCH net v2] ixgbe: fix crash with empty VF macvlan list
@ 2023-10-06 12:53 Dan Carpenter
2023-10-06 13:25 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2023-10-06 12:53 UTC (permalink / raw)
To: Jesse Brandeburg, Simon Horman
Cc: Tony Nguyen, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Jeff Kirsher, intel-wired-lan, netdev,
kernel-janitors
The adapter->vf_mvs.l list needs to be initialized even if the list is
empty. Otherwise it will lead to crashes.
Fixes: a1cbb15c1397 ("ixgbe: Add macvlan support for VF")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
v2: Use the correct fixes tag. Thanks, Simon.
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index a703ba975205..9cfdfa8a4355 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -28,6 +28,9 @@ static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter,
struct vf_macvlans *mv_list;
int num_vf_macvlans, i;
+ /* Initialize list of VF macvlans */
+ INIT_LIST_HEAD(&adapter->vf_mvs.l);
+
num_vf_macvlans = hw->mac.num_rar_entries -
(IXGBE_MAX_PF_MACVLANS + 1 + num_vfs);
if (!num_vf_macvlans)
@@ -36,8 +39,6 @@ static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter,
mv_list = kcalloc(num_vf_macvlans, sizeof(struct vf_macvlans),
GFP_KERNEL);
if (mv_list) {
- /* Initialize list of VF macvlans */
- INIT_LIST_HEAD(&adapter->vf_mvs.l);
for (i = 0; i < num_vf_macvlans; i++) {
mv_list[i].vf = -1;
mv_list[i].free = true;
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net v2] ixgbe: fix crash with empty VF macvlan list
2023-10-06 12:53 [PATCH net v2] ixgbe: fix crash with empty VF macvlan list Dan Carpenter
@ 2023-10-06 13:25 ` Simon Horman
2023-10-09 15:19 ` Jesse Brandeburg
2023-10-10 9:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-10-06 13:25 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jesse Brandeburg, Tony Nguyen, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Jeff Kirsher, intel-wired-lan,
netdev, kernel-janitors
On Fri, Oct 06, 2023 at 03:53:09PM +0300, Dan Carpenter wrote:
> The adapter->vf_mvs.l list needs to be initialized even if the list is
> empty. Otherwise it will lead to crashes.
>
> Fixes: a1cbb15c1397 ("ixgbe: Add macvlan support for VF")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> v2: Use the correct fixes tag. Thanks, Simon.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net v2] ixgbe: fix crash with empty VF macvlan list
2023-10-06 12:53 [PATCH net v2] ixgbe: fix crash with empty VF macvlan list Dan Carpenter
2023-10-06 13:25 ` Simon Horman
@ 2023-10-09 15:19 ` Jesse Brandeburg
2023-10-10 9:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jesse Brandeburg @ 2023-10-09 15:19 UTC (permalink / raw)
To: Dan Carpenter, Simon Horman
Cc: Tony Nguyen, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Jeff Kirsher, intel-wired-lan, netdev,
kernel-janitors
On 10/6/2023 5:53 AM, Dan Carpenter wrote:
> The adapter->vf_mvs.l list needs to be initialized even if the list is
> empty. Otherwise it will lead to crashes.
>
> Fixes: a1cbb15c1397 ("ixgbe: Add macvlan support for VF")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net v2] ixgbe: fix crash with empty VF macvlan list
2023-10-06 12:53 [PATCH net v2] ixgbe: fix crash with empty VF macvlan list Dan Carpenter
2023-10-06 13:25 ` Simon Horman
2023-10-09 15:19 ` Jesse Brandeburg
@ 2023-10-10 9:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-10 9:40 UTC (permalink / raw)
To: Dan Carpenter
Cc: jesse.brandeburg, horms, anthony.l.nguyen, davem, edumazet, kuba,
pabeni, jeffrey.t.kirsher, intel-wired-lan, netdev,
kernel-janitors
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Fri, 6 Oct 2023 15:53:09 +0300 you wrote:
> The adapter->vf_mvs.l list needs to be initialized even if the list is
> empty. Otherwise it will lead to crashes.
>
> Fixes: a1cbb15c1397 ("ixgbe: Add macvlan support for VF")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> v2: Use the correct fixes tag. Thanks, Simon.
>
> [...]
Here is the summary with links:
- [net,v2] ixgbe: fix crash with empty VF macvlan list
https://git.kernel.org/netdev/net/c/7b5add9af567
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-10 9:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06 12:53 [PATCH net v2] ixgbe: fix crash with empty VF macvlan list Dan Carpenter
2023-10-06 13:25 ` Simon Horman
2023-10-09 15:19 ` Jesse Brandeburg
2023-10-10 9:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).