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: <20210105102056.GA28649@zn.tnic>
Date:   Tue, 5 Jan 2021 11:20:56 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     David Woodhouse <dwmw2@...radead.org>
Cc:     iommu@...ts.linux-foundation.org, Joerg Roedel <joro@...tes.org>,
        Will Deacon <will@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Subject: Re: [PATCH] iommu/amd: Set iommu->int_enabled consistently when
 interrupts are set up

On Tue, Jan 05, 2021 at 01:32:51AM +0000, David Woodhouse wrote:
> From: David Woodhouse <dwmw@...zon.co.uk>
> 
> When I made the INTCAPXT support stop gratuitously pretending to be MSI,
> I missed the fact that iommu_setup_msi() also sets the ->int_enabled
> flag. I missed this in the iommu_setup_intcapxt() code path, which means
> that a resume from suspend will try to allocate the IRQ domains again,
> accidentally re-enabling interrupts as it does, resulting in much sadness.
> 
> Lift out the bit which sets iommu->int_enabled into the iommu_init_irq()
> function which is also where it gets checked.
> 
> Link: https://lore.kernel.org/r/20210104132250.GE32151@zn.tnic/
> Fixes: d1adcfbb520c ("iommu/amd: Fix IOMMU interrupt generation in X2APIC mode")
> Reported-by: Borislav Petkov <bp@...en8.de>
> Signed-off-by: David Woodhouse <dwmw@...zon.co.uk>
> ---
> There's a possibility we also need to ensure that the actual
> MMIO_INTCAPXT_xxx_OFFSET registers are restored too. Unless you
> actually trigger something to generate faults, you'll never know.
> I don't see offhand how that was working in the pretend-to-be-MSI case
> either.
> 
>  drivers/iommu/amd/init.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
> index f54cd79b43e4..6a1f7048dacc 100644
> --- a/drivers/iommu/amd/init.c
> +++ b/drivers/iommu/amd/init.c
> @@ -1973,8 +1973,6 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
>  		return r;
>  	}
>  
> -	iommu->int_enabled = true;
> -
>  	return 0;
>  }
>  
> @@ -2169,6 +2167,7 @@ static int iommu_init_irq(struct amd_iommu *iommu)
>  	if (ret)
>  		return ret;
>  
> +	iommu->int_enabled = true;
>  enable_faults:
>  	iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
>  
> -- 

Tested-by: Borislav Petkov <bp@...e.de>

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ