]> git.baikalelectronics.ru Git - kernel.git/commit
/proc/<pid>/cmdline: remove all the special cases
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Jul 2019 20:40:13 +0000 (13:40 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Jul 2019 16:57:52 +0000 (09:57 -0700)
commite84833a8c8b24e12a6c2a354b52b62597946d435
treed391efbe325a7ec74c2766a7cb3e04d555f674c5
parentf01ead29895ffadc21e68cc10ab8a440d84ec7e8
/proc/<pid>/cmdline: remove all the special cases

Start off with a clean slate that only reads exactly from arg_start to
arg_end, without any oddities.  This simplifies the code and in the
process removes the case that caused us to potentially leak an
uninitialized byte from the temporary kernel buffer.

Note that in order to start from scratch with an understandable base,
this simplifies things _too_ much, and removes all the legacy logic to
handle setproctitle() having changed the argument strings.

We'll add back those special cases very differently in the next commit.

Link: https://lore.kernel.org/lkml/20190712160913.17727-1-izbyshev@ispras.ru/
Fixes: a4048c03d738 ("proc: fix missing final NUL in get_mm_cmdline() rewrite")
Cc: Alexey Izbyshev <izbyshev@ispras.ru>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/base.c