]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
proc: don't use FOLL_FORCE for reading cmdline and environment
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 25 Oct 2016 02:00:44 +0000 (19:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Dec 2018 20:55:17 +0000 (21:55 +0100)
commit56941bb6400ca6ed0fdcaaa1f8c8183234bf199c
tree2e513a05c0605533e0daf36e25b570d73fcc261a
parent079d9ea86202777cd57c69879a5ba8db6a2c1b1e
proc: don't use FOLL_FORCE for reading cmdline and environment

commit 272ddc8b37354c3fe111ab26d25e792629148eee upstream.

Now that Lorenzo cleaned things up and made the FOLL_FORCE users
explicit, it becomes obvious how some of them don't really need
FOLL_FORCE at all.

So remove FOLL_FORCE from the proc code that reads the command line and
arguments from user space.

The mem_rw() function actually does want FOLL_FORCE, because gdd (and
possibly many other debuggers) use it as a much more convenient version
of PTRACE_PEEKDATA, but we should consider making the FOLL_FORCE part
conditional on actually being a ptracer.  This does not actually do
that, just moves adds a comment to that effect and moves the gup_flags
settings next to each other.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/proc/base.c