linux/fs/proc
Vlastimil Babka e70cc2bd57 fs/proc/task_mmu.c: fix Locked field in /proc/pid/smaps*
Thomas reports:
 "While looking around in /proc on my v4.14.52 system I noticed that all
  processes got a lot of "Locked" memory in /proc/*/smaps. A lot more
  memory than a regular user can usually lock with mlock().

  Commit 493b0e9d94 (in v4.14-rc1) seems to have changed the behavior
  of "Locked".

  Before that commit the code was like this. Notice the VM_LOCKED check.

           (vma->vm_flags & VM_LOCKED) ?
                (unsigned long)(mss.pss >> (10 + PSS_SHIFT)) : 0);

  After that commit Locked is now the same as Pss:

	  (unsigned long)(mss->pss >> (10 + PSS_SHIFT)));

  This looks like a mistake."

Indeed, the commit has added mss->pss_locked with the correct value that
depends on VM_LOCKED, but forgot to actually use it.  Fix it.

Link: http://lkml.kernel.org/r/ebf6c7fb-fec3-6a26-544f-710ed193c154@suse.cz
Fixes: 493b0e9d94 ("mm: add /proc/pid/smaps_rollup")
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Daniel Colascione <dancol@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-07-14 11:11:09 -07:00
..
Kconfig
Makefile
array.c proc: use "unsigned int" for sigqueue length 2018-06-07 17:34:38 -07:00
base.c proc: fix missing final NUL in get_mm_cmdline() rewrite 2018-06-20 15:38:28 +09:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c proc: use "unsigned int" in proc_fill_cache() 2018-06-07 17:34:38 -07:00
fd.h
generic.c proc: add proc_seq_release 2018-06-27 20:44:38 -04:00
inode.c proc: Make inline name size calculation automatic 2018-06-15 00:48:57 -04:00
internal.h Merge branch 'afs-proc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-16 16:32:04 +09:00
interrupts.c
kcore.c
kmsg.c
loadavg.c
meminfo.c
namespaces.c procfs: switch instantiate_t to d_splice_alias() 2018-05-26 14:20:50 -04:00
nommu.c
page.c mm: mark pages in use for page tables 2018-06-07 17:34:37 -07:00
proc_net.c
proc_sysctl.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
proc_tty.c
root.c proc: Make inline name size calculation automatic 2018-06-15 00:48:57 -04:00
self.c
softirqs.c
stat.c
task_mmu.c fs/proc/task_mmu.c: fix Locked field in /proc/pid/smaps* 2018-07-14 11:11:09 -07:00
task_nommu.c
thread_self.c
uptime.c vfs/y2038: inode timestamps conversion to timespec64 2018-06-15 07:31:07 +09:00
util.c
version.c
vmcore.c