]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
proc: change ->nlink under proc_subdir_lock
authorAlexey Dobriyan <adobriyan@gmail.com>
Thu, 5 Dec 2019 00:49:59 +0000 (16:49 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Dec 2019 03:44:11 +0000 (19:44 -0800)
commite06689bf57017ac022ccf0f2a5071f760821ce0f
treeaa9df3db0c69d35019a5436fb78e205d53e8e7e3
parent3cde287bb4769fe9dfc9c532ddc88d90e81bc4c5
proc: change ->nlink under proc_subdir_lock

Currently gluing PDE into global /proc tree is done under lock, but
changing ->nlink is not.  Additionally struct proc_dir_entry::nlink is
not atomic so updates can be lost.

Link: http://lkml.kernel.org/r/20190925202436.GA17388@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/generic.c