lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEg-Je8b-gJZDs5Q6n=XgU5xyPWiJ3utX9yf0DPN5bfLqUx4PA@mail.gmail.com>
Date:   Fri, 22 Sep 2023 12:40:12 -0400
From:   Neal Gompa <neal@...pa.dev>
To:     Hector Martin <marcan@...can.st>
Cc:     Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Jerry Snitselaar <jsnitsel@...hat.com>,
        Joerg Roedel <jroedel@...e.de>,
        "Justin M. Forbes" <jforbes@...oraproject.org>,
        iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
        asahi@...ts.linux.dev, stable@...r.kernel.org,
        regressions@...ts.linux.dev
Subject: Re: [PATCH REGRESSION v2] iommu/apple-dart: Handle DMA_FQ domains in attach_dev()

On Fri, Sep 22, 2023 at 10:55 AM Hector Martin <marcan@...can.st> wrote:
>
> Commit a4fdd9762272 ("iommu: Use flush queue capability") hid the
> IOMMU_DOMAIN_DMA_FQ domain type from domain allocation. A check was
> introduced in iommu_dma_init_domain() to fall back if not supported, but
> this check runs too late: by that point, devices have been attached to
> the IOMMU, and apple-dart's attach_dev() callback does not expect
> IOMMU_DOMAIN_DMA_FQ domains.
>
> Change the logic so the IOMMU_DOMAIN_DMA codepath is the default,
> instead of explicitly enumerating all types.
>
> Fixes an apple-dart regression in v6.5.
>
> Cc: regressions@...ts.linux.dev
> Cc: stable@...r.kernel.org
> Suggested-by: Robin Murphy <robin.murphy@....com>
> Fixes: a4fdd9762272 ("iommu: Use flush queue capability")
> Signed-off-by: Hector Martin <marcan@...can.st>
> ---
> Changes in v2:
> - Fixed the issue in apple-dart instead of the iommu core, per Robin's
>   suggestion.
> - Link to v1: https://lore.kernel.org/r/20230922-iommu-type-regression-v1-1-1ed3825b2c38@marcan.st
> ---
>  drivers/iommu/apple-dart.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
> index 2082081402d3..0b8927508427 100644
> --- a/drivers/iommu/apple-dart.c
> +++ b/drivers/iommu/apple-dart.c
> @@ -671,8 +671,7 @@ static int apple_dart_attach_dev(struct iommu_domain *domain,
>                 return ret;
>
>         switch (domain->type) {
> -       case IOMMU_DOMAIN_DMA:
> -       case IOMMU_DOMAIN_UNMANAGED:
> +       default:
>                 ret = apple_dart_domain_add_streams(dart_domain, cfg);
>                 if (ret)
>                         return ret;
>
> ---
> base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70
> change-id: 20230922-iommu-type-regression-25b4f43df770
>
> Best regards,
> --
> Hector Martin <marcan@...can.st>
>

Looks good to me.

Reviewed-by: Neal Gompa <neal@...pa.dev>


-- 
真実はいつも一つ!/ Always, there's only one truth!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ