--- x/fs/proc/task_mmu.c +++ y/fs/proc/task_mmu.c @@ -2491,8 +2491,9 @@ static long do_pagemap_cmd(struct file * switch (cmd) { case PAGEMAP_SCAN: - return do_pagemap_scan(mm, arg); - + if (mm) + return do_pagemap_scan(mm, arg); + /* fall thru */ default: return -EINVAL; }