Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-coresight-backports
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-coresight-backports
  • Repository
  • linux-coresight-backports
  • fs
  • binfmt_elf.c
Find file BlameHistoryPermalink
  • Alexey Dobriyan's avatar
    coredump: fix spam with zero VMA process · 86a2bb5a
    Alexey Dobriyan authored Jun 14, 2018
    Nobody ever tried to self destruct by unmapping whole address space at
    once:
    
    	munmap((void *)0, (1ULL << 47) - 4096);
    
    Doing this produces 2 warnings for zero-length vmalloc allocations:
    
      a.out[1353]: segfault at 7f80bcc4b757 ip 00007f80bcc4b757 sp 00007fff683939b8 error 14
      a.out: vmalloc: allocation failure: 0 bytes, mode:0xcc0(GFP_KERNEL), nodemask=(null)
    	...
      a.out: vmalloc: allocation failure: 0 bytes, mode:0xcc0(GFP_KERNEL), nodemask=(null)
    	...
    
    Fix is to switch to kvmalloc().
    
    Steps to reproduce:
    
    	// vsyscall=none
    	#include <sys/mman.h>
    	#include <sys/resource.h>
    	int main(void)
    	{
    		setrlimit(RLIMIT_CORE, &(struct rlimit){RLIM_INFINITY, RLIM_INFINITY});
    		munmap((void *)0, (1ULL << 47) - 4096);
    		return 0;
    	}
    
    Link: http://lkml.kernel.org/r/20180410180353.GA2515@avx2
    
    
    Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
    Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    86a2bb5a