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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210104190240.GF6029@char.us.oracle.com>
Date:   Mon, 4 Jan 2021 14:02:40 -0500
From:   Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:     Zhenzhong Duan <zhenzhong.duan@...il.com>
Cc:     linux-kernel@...r.kernel.org, zhongjiang@...wei.com,
        joe@...ches.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, iommu@...ts.linux-foundation.org,
        dwmw2@...radead.org, baolu.lu@...ux.intel.com, joro@...tes.org,
        will@...nel.org
Subject: Re: [PATCH] x86/iommu: Fix two minimal issues in
 check_iommu_entries()

On Wed, Dec 23, 2020 at 02:24:12PM +0800, Zhenzhong Duan wrote:
> check_iommu_entries() checks for cyclic dependency in iommu entries
> and fixes the cyclic dependency by setting x->depend to NULL. But
> this repairing isn't correct if q is in front of p, there will be
> "EXECUTION ORDER INVALID!" report following. Fix it by NULLing
> whichever in the front.
> 
> The second issue is about the report of exectuion order reverse,
> the order is reversed incorrectly in the report, fix it.

Heya!

When you debugged this, did you by any chance save the
serial logs and the debug logs to double-check it?

Thanks!
> 
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@...il.com>
> ---
>  arch/x86/kernel/pci-iommu_table.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/pci-iommu_table.c b/arch/x86/kernel/pci-iommu_table.c
> index 2e9006c..40c8249 100644
> --- a/arch/x86/kernel/pci-iommu_table.c
> +++ b/arch/x86/kernel/pci-iommu_table.c
> @@ -60,7 +60,10 @@ void __init check_iommu_entries(struct iommu_table_entry *start,
>  			printk(KERN_ERR "CYCLIC DEPENDENCY FOUND! %pS depends on %pS and vice-versa. BREAKING IT.\n",
>  			       p->detect, q->detect);
>  			/* Heavy handed way..*/
> -			x->depend = NULL;
> +			if (p > q)
> +				q->depend = NULL;
> +			else
> +				p->depend = NULL;
>  		}
>  	}
>  
> @@ -68,7 +71,7 @@ void __init check_iommu_entries(struct iommu_table_entry *start,
>  		q = find_dependents_of(p, finish, p);
>  		if (q && q > p) {
>  			printk(KERN_ERR "EXECUTION ORDER INVALID! %pS should be called before %pS!\n",
> -			       p->detect, q->detect);
> +			       q->detect, p->detect);
>  		}
>  	}
>  }
> -- 
> 1.8.3.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ