[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADEbmW0yx1_JL1mExOp0Kwdy7sUDQdG3CU_bHON1nJ-ikQur5w@mail.gmail.com>
Date: Tue, 5 Aug 2025 14:52:02 +0200
From: Michal Schmidt <mschmidt@...hat.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Ajit Khaparde <ajit.khaparde@...adcom.com>,
Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>,
Somnath Kotur <somnath.kotur@...adcom.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Nikolay Aleksandrov <razor@...ckwall.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] benet: fix BUG when creating VFs
On Tue, Aug 5, 2025 at 2:21 AM Jakub Kicinski <kuba@...nel.org> wrote:
> On Fri, 1 Aug 2025 12:13:37 +0200 Michal Schmidt wrote:
> > benet crashes as soon as SRIOV VFs are created:
>
> > err:
> > - dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma);
> > spin_unlock_bh(&adapter->mcc_lock);
> > + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma);
> > return status;
> > }
> >
>
> Quick grep reveals an identical problem in be_cmd_get_phy_info() ?
> Or is this bug size-sensitive ? I don't see the vunmap call..
The call chain to the vunmap is:
dma_free_coherent -> dma_free_attrs -> iommu_dma_free ->
__iommu_dma_free -> dma_common_free_remap -> vunmap
I think the reason be_cmd_get_phy_info() does not cause a problem is
it uses dma_alloc_coherent(..., GFP_ATOMIC).
Then iommu_dma_alloc() does not go into the iommu_dma_alloc_remap() path.
The corresponding dma_free_coherent() then does not go into the
is_vmalloc_addr() branch in __iommu_dma_free().
Michal
Powered by blists - more mailing lists