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]
Date:	Wed, 09 Jan 2008 09:37:57 +0000
From:	"Jan Beulich" <jbeulich@...ell.com>
To:	"Jeremy Fitzhardinge" <jeremy@...p.org>, "Andi Kleen" <ak@...e.de>
Cc:	"Ingo Molnar" <mingo@...e.hu>,
	"Glauber de Oliveira Costa" <glommer@...il.com>,
	"LKML" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 00 of 10] x86: unify asm/pgtable.h

>The "problem" is a BUG() in pageattr_64.c:change_page_attr(), which to 
>me looks spurious.  It arises because __PAGE_KERNEL_* doesn't contain 
>_PAGE_GLOBAL, but PAGE_KERNEL_* does.  When ioremap() 
>change_page_attr(), it does so in a way that guarentees that the test
>
>	if (pgprot_val(prot) != pgprot_val(ref_prot)) {
>
>in __change_page_attr() always succeeds.  When I folded _PAGE_GLOBAL 
>into the __PAGE_KERNEL_* definitions, it mostly works except it causes 
>this if() to fail, falling into the otherwise dead else clause and 
>triggers a BUG().

Indeed, and my patch version for fixing the ref-counting problem does
away with that (I don't recall whether Andi's version did, too):

	if (!pgprot_match(prot, ref_prot)) {
		if (!pte_huge(*kpte)) {
			set_pte(kpte, pfn_pte(pfn, prot));
		} else {
			BUG_ON(!pgprot_match(old_prot, ref_prot));
			kpte_page = split_large_page(address, prot, ref_prot);
			if (!kpte_page)
				return -ENOMEM;
			set_pte(kpte, mk_pte(kpte_page, PAGE_KERNEL_EXEC));
		}
		if (pgprot_match(old_prot, ref_prot))
			page_private(kpte_page)++;
	} else if (!pgprot_match(ref_prot, old_prot)) {
		BUG_ON(pte_huge(*kpte));
		set_pte(kpte, pfn_pte(pfn, ref_prot));
		BUG_ON(page_private(kpte_page) == 0);
		page_private(kpte_page)--;
	} else
		return 0;

Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ