diff options
author | Helge Deller | 2022-10-14 10:18:53 +0200 |
---|---|---|
committer | Helge Deller | 2022-10-14 10:45:12 +0200 |
commit | 70be49f2f6223ddd2fcddb0089a40864c37e1494 (patch) | |
tree | b81243ea631703443dac1ebc2763bb1befa79d8f /drivers | |
parent | aca7c13d3bee81a968337a5515411409ae9d095d (diff) |
parisc: Fix userspace graphics card breakage due to pgtable special bit
Commit df24e1783e6e ("parisc: Add vDSO support") introduced the vDSO
support, for which a _PAGE_SPECIAL page table flag was needed. Since we
wanted to keep every page table entry in 32-bits, this patch re-used the
existing - but yet unused - _PAGE_DMB flag (which triggers a hardware break
if a page is accessed) to store the special bit.
But when graphics card memory is mmapped into userspace, the kernel uses
vm_iomap_memory() which sets the the special flag. So, with the DMB bit
set, every access to the graphics memory now triggered a hardware
exception and segfaulted the userspace program.
Fix this breakage by dropping the DMB bit when writing the page
protection bits to the CPU TLB.
In addition this patch adds a small optimization: if huge pages aren't
configured (which is at least the case for 32-bit kernels), then the
special bit is stored in the hpage (HUGE PAGE) bit instead. That way we
can skip to reset the DMB bit.
Fixes: df24e1783e6e ("parisc: Add vDSO support")
Cc: <stable@vger.kernel.org> # 5.18+
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions