Skip to content

x86/ldt: Use a VMA based read only mapping

Peter Zijlstra linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest17 patches 58 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17mm/gup: Fixup p*_access_permitted()mm/gup.c+24 -127 replies
2/17mm: Exempt special mappings from mlock(), mprotect() and madvise()mm/madvise.c mm/mlock.c mm/mprotect.c+8 -13 replies
3/17arch: Allow arch_dup_mmap() to failarch/powerpc/include/asm/mmu_context.h arch/um/include/asm/mmu_context.h arch/unicore32/include/asm/mmu_context.h +3 more+14 -111 reply
4/17x86/ldt: Rework lockingarch/x86/include/asm/mmu.h arch/x86/include/asm/mmu_context.h arch/x86/kernel/ldt.c+26 -130 replies
5/17x86/ldt: Prevent ldt inheritance on execarch/x86/include/asm/mmu_context.h arch/x86/kernel/ldt.c tools/testing/selftests/x86/ldt_gdt.c+22 -261 reply
6/17x86/ldt: Do not install LDT for kernel threadsarch/x86/include/asm/mmu_context.h+1 -22 replies
7/17mm/softdirty: Move VM_SOFTDIRTY into high bitsarch/powerpc/platforms/Kconfig.cputype arch/s390/Kconfig include/linux/mm.h+13 -60 replies
8/17mm/x86: Allow special mappings with user access clearedarch/x86/include/uapi/asm/mman.h include/linux/mm.h include/linux/mman.h +1 more+20 -20 replies
9/17mm: Provide vm_special_mapping::closeinclude/linux/mm_types.h mm/mmap.c+7 -00 replies
10/17selftest/x86: Implement additional LDT selfteststools/testing/selftests/x86/ldt_gdt.c+70 -10 replies
11/17selftests/x86/ldt_gdt: Prepare for access bit forcedtools/testing/selftests/x86/ldt_gdt.c+1 -214 replies
12/17mm: Make populate_vma_page_range() availableinclude/linux/mm.h mm/internal.h+2 -20 replies
13/17x86/mm: Force LDT desc accessed bitarch/x86/include/asm/desc.h arch/x86/kernel/tls.c+7 -91 reply
14/17x86/ldt: Reshuffle codearch/x86/include/asm/mmu_context.h arch/x86/kernel/ldt.c+58 -635 replies
15/17x86/ldt: Prepare for VMA mappingarch/x86/include/asm/mmu.h arch/x86/include/asm/mmu_context.h arch/x86/kernel/ldt.c+116 -30 replies
16/17x86/ldt: Add VMA management codearch/x86/kernel/ldt.c+102 -10 replies
17/17x86/ldt: Make it read only VMA mappedarch/x86/kernel/ldt.c+149 -1080 replies

Reviews trailers per patch

1 of 17 patches has a Reviewed-by or Acked-by.

PatchAndy Lutomirski
1/17
2/17
3/17R-b
4/17
5/17
6/17
7/17
8/17
9/17
10/17
11/17
12/17
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/17] x86/ldt: Use a VMA based read only mapping

So here's a second posting of the VMA based LDT implementation; now without most of the crazy.

I took out the write fault handler and the magic LAR touching code.

Additionally there are a bunch of patches that address generic vm issue.

- gup() access control; In specific I looked at accessing !_PAGE_USER pages because these patches rely on not being able to do that.

- special mappings; A whole bunch of mmap ops don't make sense on special mappings so disallow them.

Both things make sense independent of the rest of the series. Similarly, the patches that kill that rediculous LDT inherit on exec() are also unquestionably good.

So I think at least the first 6 patches are good, irrespective of the VMA approach.

On the whole VMA approach, Andy I know you hate it with a passion, but I really rather like how it ties the LDT to the process that it belongs to and it reduces the amount of 'special' pages in the whole PTI mapping.

I'm not the one going to make the decision on this; but I figured I at least post a version without the obvious crap parts of the last one.

Note: if we were to also disallow munmap() for special mappings (which I suppose makes perfect sense) then we could further reduce the actual LDT code (we'd no longer need the sm::close callback and related things).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>