• Linus Torvalds's avatar
    /proc/<pid>/cmdline: remove all the special cases · 3d712546
    Linus Torvalds authored
    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: f5b65348 ("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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3d712546
base.c 86.2 KB