<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/ldt.c, branch linux-4.20.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.20.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.20.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-11-06T20:35:11Z</updated>
<entry>
<title>x86/ldt: Remove unused variable in map_ldt_struct()</title>
<updated>2018-11-06T20:35:11Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2018-10-26T12:28:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b082f2dd80612015cd6d9d84e52099734ec9a0e1'/>
<id>urn:sha1:b082f2dd80612015cd6d9d84e52099734ec9a0e1</id>
<content type='text'>
Splitting out the sanity check in map_ldt_struct() moved page table syncing
into a separate function, which made the pgd variable unused. Remove it.

[ tglx: Massaged changelog ]

Fixes: 9bae3197e15d ("x86/ldt: Split out sanity check in map_ldt_struct()")
Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: peterz@infradead.org
Cc: boris.ostrovsky@oracle.com
Cc: jgross@suse.com
Cc: bhe@redhat.com
Cc: willy@infradead.org
Cc: linux-mm@kvack.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181026122856.66224-4-kirill.shutemov@linux.intel.com

</content>
</entry>
<entry>
<title>x86/ldt: Unmap PTEs for the slot before freeing LDT pages</title>
<updated>2018-11-06T20:35:11Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2018-10-26T12:28:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a0e6e0831c516860fc7f9be1db6c081fe902ebcf'/>
<id>urn:sha1:a0e6e0831c516860fc7f9be1db6c081fe902ebcf</id>
<content type='text'>
modify_ldt(2) leaves the old LDT mapped after switching over to the new
one. The old LDT gets freed and the pages can be re-used.

Leaving the mapping in place can have security implications. The mapping is
present in the userspace page tables and Meltdown-like attacks can read
these freed and possibly reused pages.

It's relatively simple to fix: unmap the old LDT and flush TLB before
freeing the old LDT memory.

This further allows to avoid flushing the TLB in map_ldt_struct() as the
slot is unmapped and flushed by unmap_ldt_struct() or has never been mapped
at all.

[ tglx: Massaged changelog and removed the needless line breaks ]

Fixes: f55f0501cbf6 ("x86/pti: Put the LDT in its own PGD if PTI is on")
Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: luto@kernel.org
Cc: peterz@infradead.org
Cc: boris.ostrovsky@oracle.com
Cc: jgross@suse.com
Cc: bhe@redhat.com
Cc: willy@infradead.org
Cc: linux-mm@kvack.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181026122856.66224-3-kirill.shutemov@linux.intel.com

</content>
</entry>
<entry>
<title>x86/mm/tlb: Add freed_tables argument to flush_tlb_mm_range</title>
<updated>2018-10-09T14:51:12Z</updated>
<author>
<name>Rik van Riel</name>
</author>
<published>2018-09-26T03:58:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=016c4d92cd16f569c6485ae62b076c1a4b779536'/>
<id>urn:sha1:016c4d92cd16f569c6485ae62b076c1a4b779536</id>
<content type='text'>
Add an argument to flush_tlb_mm_range to indicate whether page tables
are about to be freed after this TLB flush. This allows for an
optimization of flush_tlb_mm_range to skip CPUs in lazy TLB mode.

No functional changes.

Cc: npiggin@gmail.com
Cc: mingo@kernel.org
Cc: will.deacon@arm.com
Cc: songliubraving@fb.com
Cc: kernel-team@fb.com
Cc: luto@kernel.org
Cc: hpa@zytor.com
Signed-off-by: Rik van Riel &lt;riel@surriel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20180926035844.1420-6-riel@surriel.com
</content>
</entry>
<entry>
<title>x86/mm: Page size aware flush_tlb_mm_range()</title>
<updated>2018-10-09T14:51:11Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2018-08-26T10:56:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a31acd3ee8f7dbc0370bdf4a4bfef7a8c13c7542'/>
<id>urn:sha1:a31acd3ee8f7dbc0370bdf4a4bfef7a8c13c7542</id>
<content type='text'>
Use the new tlb_get_unmap_shift() to determine the stride of the
INVLPG loop.

Cc: Nick Piggin &lt;npiggin@gmail.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: "Aneesh Kumar K.V" &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>x86/ldt: Enable LDT user-mapping for PAE</title>
<updated>2018-07-19T23:11:48Z</updated>
<author>
<name>Joerg Roedel</name>
</author>
<published>2018-07-18T09:41:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6df934b92a549cb3badb6d576f71aeb133e2f110'/>
<id>urn:sha1:6df934b92a549cb3badb6d576f71aeb133e2f110</id>
<content type='text'>
This adds the needed special case for PAE to get the LDT mapped into the
user page-table when PTI is enabled. The big difference to the other paging
modes is that on PAE there is no full top-level PGD entry available for the
LDT, but only a PMD entry.

Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: "H . Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: linux-mm@kvack.org
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: David Laight &lt;David.Laight@aculab.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: Eduardo Valentin &lt;eduval@amazon.com&gt;
Cc: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: aliguori@amazon.com
Cc: daniel.gruss@iaik.tugraz.at
Cc: hughd@google.com
Cc: keescook@google.com
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Waiman Long &lt;llong@redhat.com&gt;
Cc: "David H . Gutteridge" &lt;dhgutteridge@sympatico.ca&gt;
Cc: joro@8bytes.org
Link: https://lkml.kernel.org/r/1531906876-13451-37-git-send-email-joro@8bytes.org

</content>
</entry>
<entry>
<title>x86/ldt: Split out sanity check in map_ldt_struct()</title>
<updated>2018-07-19T23:11:47Z</updated>
<author>
<name>Joerg Roedel</name>
</author>
<published>2018-07-18T09:41:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9bae3197e15dd5e03ce8e237db6fe4486b08a775'/>
<id>urn:sha1:9bae3197e15dd5e03ce8e237db6fe4486b08a775</id>
<content type='text'>
This splits out the mapping sanity check and the actual mapping of the LDT
to user-space from the map_ldt_struct() function in a way so that it is
re-usable for PAE paging.

Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: "H . Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: linux-mm@kvack.org
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: David Laight &lt;David.Laight@aculab.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: Eduardo Valentin &lt;eduval@amazon.com&gt;
Cc: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: aliguori@amazon.com
Cc: daniel.gruss@iaik.tugraz.at
Cc: hughd@google.com
Cc: keescook@google.com
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Waiman Long &lt;llong@redhat.com&gt;
Cc: "David H . Gutteridge" &lt;dhgutteridge@sympatico.ca&gt;
Cc: joro@8bytes.org
Link: https://lkml.kernel.org/r/1531906876-13451-36-git-send-email-joro@8bytes.org

</content>
</entry>
<entry>
<title>x86/ldt: Define LDT_END_ADDR</title>
<updated>2018-07-19T23:11:47Z</updated>
<author>
<name>Joerg Roedel</name>
</author>
<published>2018-07-18T09:41:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8195d869d118bc30bf0be8d0c5d8849d6f58529b'/>
<id>urn:sha1:8195d869d118bc30bf0be8d0c5d8849d6f58529b</id>
<content type='text'>
It marks the end of the address-space range reserved for the LDT. The
LDT-code will use it when unmapping the LDT for user-space.

Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: "H . Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: linux-mm@kvack.org
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: David Laight &lt;David.Laight@aculab.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: Eduardo Valentin &lt;eduval@amazon.com&gt;
Cc: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: aliguori@amazon.com
Cc: daniel.gruss@iaik.tugraz.at
Cc: hughd@google.com
Cc: keescook@google.com
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Waiman Long &lt;llong@redhat.com&gt;
Cc: "David H . Gutteridge" &lt;dhgutteridge@sympatico.ca&gt;
Cc: joro@8bytes.org
Link: https://lkml.kernel.org/r/1531906876-13451-35-git-send-email-joro@8bytes.org

</content>
</entry>
<entry>
<title>x86/ldt: Fix support_pte_mask filtering in map_ldt_struct()</title>
<updated>2018-04-16T18:20:34Z</updated>
<author>
<name>Joerg Roedel</name>
</author>
<published>2018-04-16T09:43:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e6f39e87b6439939a14cb7fdd94086a082b63b87'/>
<id>urn:sha1:e6f39e87b6439939a14cb7fdd94086a082b63b87</id>
<content type='text'>
The |= operator will let us end up with an invalid PTE. Use
the correct &amp;= instead.

[ The bug was also independently reported by Shuah Khan ]

Fixes: fb43d6cb91ef ('x86/mm: Do not auto-massage page protections')
Acked-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Acked-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86/mm: Do not auto-massage page protections</title>
<updated>2018-04-12T07:04:22Z</updated>
<author>
<name>Dave Hansen</name>
</author>
<published>2018-04-06T20:55:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fb43d6cb91ef57d9e58d5f69b423784ff4a4c374'/>
<id>urn:sha1:fb43d6cb91ef57d9e58d5f69b423784ff4a4c374</id>
<content type='text'>
A PTE is constructed from a physical address and a pgprotval_t.
__PAGE_KERNEL, for instance, is a pgprot_t and must be converted
into a pgprotval_t before it can be used to create a PTE.  This is
done implicitly within functions like pfn_pte() by massage_pgprot().

However, this makes it very challenging to set bits (and keep them
set) if your bit is being filtered out by massage_pgprot().

This moves the bit filtering out of pfn_pte() and friends.  For
users of PAGE_KERNEL*, filtering will be done automatically inside
those macros but for users of __PAGE_KERNEL*, they need to do their
own filtering now.

Note that we also just move pfn_pte/pmd/pud() over to check_pgprot()
instead of massage_pgprot().  This way, we still *look* for
unsupported bits and properly warn about them if we find them.  This
might happen if an unfiltered __PAGE_KERNEL* value was passed in,
for instance.

- printk format warning fix from: Arnd Bergmann &lt;arnd@arndb.de&gt;
- boot crash fix from:            Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
- crash bisected by:              Mike Galbraith &lt;efault@gmx.de&gt;

Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reported-and-fixed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Bisected-by: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Kees Cook &lt;keescook@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Nadav Amit &lt;namit@vmware.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20180406205509.77E1D7F6@viggo.jf.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/ldt: Make LDT pgtable free conditional</title>
<updated>2017-12-31T15:55:09Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-12-31T15:52:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7f414195b0c3612acd12b4611a5fe75995cf10c7'/>
<id>urn:sha1:7f414195b0c3612acd12b4611a5fe75995cf10c7</id>
<content type='text'>
Andy prefers to be paranoid about the pagetable free in the error path of
write_ldt(). Make it conditional and warn whenever the installment of a
secondary LDT fails.

Requested-by: Andy Lutomirski &lt;luto@amacapital.net&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
</feed>
