Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1318331
| From | tip-bot for Jan Beulich <tipbot@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [tip:x86/urgent] x86/mm: Fix types used in pgprot cacheability flags translations |
| Date | 2016-01-26 21:20 +0100 |
| Message-ID | <qVifL-QQ-1@gated-at.bofh.it> (permalink) |
| References | <qV9Pd-3ib-37@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Commit-ID: 3625c2c234ef66acf21a72d47a5ffa94f6c5ebf2
Gitweb: http://git.kernel.org/tip/3625c2c234ef66acf21a72d47a5ffa94f6c5ebf2
Author: Jan Beulich <JBeulich@suse.com>
AuthorDate: Tue, 26 Jan 2016 04:15:18 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 26 Jan 2016 21:05:36 +0100
x86/mm: Fix types used in pgprot cacheability flags translations
For PAE kernels "unsigned long" is not suitable to hold page protection
flags, since _PAGE_NX doesn't fit there. This is the reason for quite a
few W+X pages getting reported as insecure during boot (observed namely
for the entire initrd range).
Fixes: 281d4078be ("x86: Make page cache mode a real type")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <JGross@suse.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/56A7635602000078000CAFF1@prv-mh.provo.novell.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/include/asm/pgtable_types.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index a471cad..79c9185 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -363,20 +363,18 @@ static inline enum page_cache_mode pgprot2cachemode(pgprot_t pgprot)
}
static inline pgprot_t pgprot_4k_2_large(pgprot_t pgprot)
{
+ pgprotval_t val = pgprot_val(pgprot);
pgprot_t new;
- unsigned long val;
- val = pgprot_val(pgprot);
pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
((val & _PAGE_PAT) << (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
return new;
}
static inline pgprot_t pgprot_large_2_4k(pgprot_t pgprot)
{
+ pgprotval_t val = pgprot_val(pgprot);
pgprot_t new;
- unsigned long val;
- val = pgprot_val(pgprot);
pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
((val & _PAGE_PAT_LARGE) >>
(_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] ix86: fix types used in pgprot cachability flags translations "Jan Beulich" <JBeulich@suse.com> - 2016-01-25 17:50 +0100
Re: [PATCH] ix86: fix types used in pgprot cachability flags translations Thomas Gleixner <tglx@linutronix.de> - 2016-01-25 18:10 +0100
[PATCH v2] ix86: fix types used in pgprot cachability flags translations "Jan Beulich" <JBeulich@suse.com> - 2016-01-26 12:20 +0100
Re: [PATCH v2] ix86: fix types used in pgprot cachability flags translations Juergen Gross <jgross@suse.com> - 2016-01-26 12:30 +0100
[tip:x86/urgent] x86/mm: Fix types used in pgprot cacheability flags translations tip-bot for Jan Beulich <tipbot@zytor.com> - 2016-01-26 21:20 +0100
csiph-web