aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-13 14:27:14 -0700
committervantoman <mustafa.vantom@gmail.com>2021-04-18 14:36:02 +0200
commit0538fffe1cd70f25d92f183f9d5a436c90aa9ecf (patch)
tree7f3a8b54989817520c9c938b7149336ae030aa9c /tools/perf/scripts/python/export-to-sqlite.py
parent11c62b004314a5d7a198be0c860ce0dcb9a1907d (diff)
/proc/<pid>/cmdline: add back the setproctitle() special case
This makes the setproctitle() special case very explicit indeed, and handles it with a separate helper function entirely. In the process, it re-instates the original semantics of simply stopping at the first NUL character when the original last NUL character is no longer there. [ The original semantics can still be seen in mm/util.c: get_cmdline() that is limited to a fixed-size buffer ] This makes the logic about when we use the string lengths etc much more obvious, and makes it easier to see what we do and what the two very different cases are. Note that even when we allow walking past the end of the argument array (because the setproctitle() might have overwritten and overflowed the original argv[] strings), we only allow it when it overflows into the environment region if it is immediately adjacent. [ Fixed for missing 'count' checks noted by Alexey Izbyshev ] Link: https://lore.kernel.org/lkml/alpine.LNX.2.21.1904052326230.3249@kich.toxcorp.com/ Fixes: 5ab827189965 ("fs/proc: simplify and clarify get_mm_cmdline() function") Cc: Jakub Jankowski <shasta@toxcorp.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Alexey Izbyshev <izbyshev@ispras.ru> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit d26d0cd97c88eb1a5704b42e41ab443406807810) Bug: 147443331 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ie807ebb4b31d4704ef23a3c05cd7790b496dcc7d
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions