Revision b18cb64ead400c01bf1580eeba330ace51f8087d authored by Andy Lutomirski on 30 September 2016, 17:58:57 UTC, committed by Ingo Molnar on 20 October 2016, 07:21:41 UTC
This reverts more of: b76437579d13 ("procfs: mark thread stack correctly in proc/<pid>/maps") ... which was partially reverted by: 65376df58217 ("proc: revert /proc/<pid>/maps [stack:TID] annotation") Originally, /proc/PID/task/TID/maps was the same as /proc/TID/maps. In current kernels, /proc/PID/maps (or /proc/TID/maps even for threads) shows "[stack]" for VMAs in the mm's stack address range. In contrast, /proc/PID/task/TID/maps uses KSTK_ESP to guess the target thread's stack's VMA. This is racy, probably returns garbage and, on arches with CONFIG_TASK_INFO_IN_THREAD=y, is also crash-prone: KSTK_ESP is not safe to use on tasks that aren't known to be running ordinary process-context kernel code. This patch removes the difference and just shows "[stack]" for VMAs in the mm's stack range. This is IMO much more sensible -- the actual "stack" address really is treated specially by the VM code, and the current thread stack isn't even well-defined for programs that frequently switch stacks on their own. Reported-by: Jann Horn <jann@thejh.net> Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Linux API <linux-api@vger.kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tycho Andersen <tycho.andersen@canonical.com> Link: http://lkml.kernel.org/r/3e678474ec14e0a0ec34c611016753eea2e1b8ba.1475257877.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 0a1eb2d
File | Mode | Size |
---|---|---|
kasan | ||
Kconfig | -rw-r--r-- | 24.0 KB |
Kconfig.debug | -rw-r--r-- | 3.6 KB |
Makefile | -rw-r--r-- | 3.4 KB |
backing-dev.c | -rw-r--r-- | 26.3 KB |
balloon_compaction.c | -rw-r--r-- | 4.7 KB |
bootmem.c | -rw-r--r-- | 20.8 KB |
cleancache.c | -rw-r--r-- | 9.9 KB |
cma.c | -rw-r--r-- | 12.2 KB |
cma.h | -rw-r--r-- | 515 bytes |
cma_debug.c | -rw-r--r-- | 4.4 KB |
compaction.c | -rw-r--r-- | 56.7 KB |
debug.c | -rw-r--r-- | 4.2 KB |
debug_page_ref.c | -rw-r--r-- | 1.3 KB |
dmapool.c | -rw-r--r-- | 13.8 KB |
early_ioremap.c | -rw-r--r-- | 6.2 KB |
fadvise.c | -rw-r--r-- | 4.0 KB |
failslab.c | -rw-r--r-- | 1.4 KB |
filemap.c | -rw-r--r-- | 77.5 KB |
frame_vector.c | -rw-r--r-- | 6.2 KB |
frontswap.c | -rw-r--r-- | 14.3 KB |
gup.c | -rw-r--r-- | 42.5 KB |
highmem.c | -rw-r--r-- | 11.7 KB |
huge_memory.c | -rw-r--r-- | 63.0 KB |
hugetlb.c | -rw-r--r-- | 120.2 KB |
hugetlb_cgroup.c | -rw-r--r-- | 10.9 KB |
hwpoison-inject.c | -rw-r--r-- | 3.2 KB |
init-mm.c | -rw-r--r-- | 619 bytes |
internal.h | -rw-r--r-- | 15.3 KB |
interval_tree.c | -rw-r--r-- | 3.1 KB |
khugepaged.c | -rw-r--r-- | 48.0 KB |
kmemcheck.c | -rw-r--r-- | 2.9 KB |
kmemleak-test.c | -rw-r--r-- | 3.2 KB |
kmemleak.c | -rw-r--r-- | 56.0 KB |
ksm.c | -rw-r--r-- | 63.5 KB |
list_lru.c | -rw-r--r-- | 12.6 KB |
maccess.c | -rw-r--r-- | 3.0 KB |
madvise.c | -rw-r--r-- | 19.4 KB |
memblock.c | -rw-r--r-- | 49.5 KB |
memcontrol.c | -rw-r--r-- | 153.9 KB |
memory-failure.c | -rw-r--r-- | 49.1 KB |
memory.c | -rw-r--r-- | 110.3 KB |
memory_hotplug.c | -rw-r--r-- | 56.1 KB |
mempolicy.c | -rw-r--r-- | 71.3 KB |
mempool.c | -rw-r--r-- | 13.9 KB |
memtest.c | -rw-r--r-- | 2.7 KB |
migrate.c | -rw-r--r-- | 52.1 KB |
mincore.c | -rw-r--r-- | 6.7 KB |
mlock.c | -rw-r--r-- | 22.5 KB |
mm_init.c | -rw-r--r-- | 4.8 KB |
mmap.c | -rw-r--r-- | 94.7 KB |
mmu_context.c | -rw-r--r-- | 1.3 KB |
mmu_notifier.c | -rw-r--r-- | 11.7 KB |
mmzone.c | -rw-r--r-- | 2.4 KB |
mprotect.c | -rw-r--r-- | 13.0 KB |
mremap.c | -rw-r--r-- | 15.1 KB |
msync.c | -rw-r--r-- | 2.6 KB |
nobootmem.c | -rw-r--r-- | 11.1 KB |
nommu.c | -rw-r--r-- | 48.5 KB |
oom_kill.c | -rw-r--r-- | 28.6 KB |
page-writeback.c | -rw-r--r-- | 84.3 KB |
page_alloc.c | -rw-r--r-- | 204.9 KB |
page_counter.c | -rw-r--r-- | 4.8 KB |
page_ext.c | -rw-r--r-- | 11.4 KB |
page_idle.c | -rw-r--r-- | 5.4 KB |
page_io.c | -rw-r--r-- | 9.5 KB |
page_isolation.c | -rw-r--r-- | 8.4 KB |
page_owner.c | -rw-r--r-- | 14.7 KB |
page_poison.c | -rw-r--r-- | 3.5 KB |
pagewalk.c | -rw-r--r-- | 7.5 KB |
percpu-km.c | -rw-r--r-- | 2.8 KB |
percpu-vm.c | -rw-r--r-- | 10.0 KB |
percpu.c | -rw-r--r-- | 66.2 KB |
pgtable-generic.c | -rw-r--r-- | 4.8 KB |
process_vm_access.c | -rw-r--r-- | 9.9 KB |
quicklist.c | -rw-r--r-- | 2.4 KB |
readahead.c | -rw-r--r-- | 15.5 KB |
rmap.c | -rw-r--r-- | 51.2 KB |
shmem.c | -rw-r--r-- | 105.7 KB |
slab.c | -rw-r--r-- | 111.0 KB |
slab.h | -rw-r--r-- | 13.3 KB |
slab_common.c | -rw-r--r-- | 31.2 KB |
slob.c | -rw-r--r-- | 16.0 KB |
slub.c | -rw-r--r-- | 138.3 KB |
sparse-vmemmap.c | -rw-r--r-- | 7.8 KB |
sparse.c | -rw-r--r-- | 20.8 KB |
swap.c | -rw-r--r-- | 27.0 KB |
swap_cgroup.c | -rw-r--r-- | 4.6 KB |
swap_state.c | -rw-r--r-- | 13.2 KB |
swapfile.c | -rw-r--r-- | 77.0 KB |
truncate.c | -rw-r--r-- | 24.0 KB |
usercopy.c | -rw-r--r-- | 7.7 KB |
userfaultfd.c | -rw-r--r-- | 7.2 KB |
util.c | -rw-r--r-- | 15.8 KB |
vmacache.c | -rw-r--r-- | 3.1 KB |
vmalloc.c | -rw-r--r-- | 68.6 KB |
vmpressure.c | -rw-r--r-- | 12.5 KB |
vmscan.c | -rw-r--r-- | 110.8 KB |
vmstat.c | -rw-r--r-- | 47.4 KB |
workingset.c | -rw-r--r-- | 16.8 KB |
z3fold.c | -rw-r--r-- | 21.3 KB |
zbud.c | -rw-r--r-- | 18.2 KB |
zpool.c | -rw-r--r-- | 10.0 KB |
zsmalloc.c | -rw-r--r-- | 60.3 KB |
zswap.c | -rw-r--r-- | 32.3 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...