Files
rockchip-kernel/include/linux
Yafang Shao 95af469c4f fs/binfmt_elf: replace open-coded string copy with get_task_comm
It is better to use get_task_comm() instead of the open coded string
copy as we do in other places.

struct elf_prpsinfo is used to dump the task information in userspace
coredump or kernel vmcore.  Below is the verification of vmcore,

  crash> ps
     PID    PPID  CPU       TASK        ST  %MEM     VSZ    RSS  COMM
        0      0   0  ffffffff9d21a940  RU   0.0       0      0  [swapper/0]
  >     0      0   1  ffffa09e40f85e80  RU   0.0       0      0  [swapper/1]
  >     0      0   2  ffffa09e40f81f80  RU   0.0       0      0  [swapper/2]
  >     0      0   3  ffffa09e40f83f00  RU   0.0       0      0  [swapper/3]
  >     0      0   4  ffffa09e40f80000  RU   0.0       0      0  [swapper/4]
  >     0      0   5  ffffa09e40f89f80  RU   0.0       0      0  [swapper/5]
        0      0   6  ffffa09e40f8bf00  RU   0.0       0      0  [swapper/6]
  >     0      0   7  ffffa09e40f88000  RU   0.0       0      0  [swapper/7]
  >     0      0   8  ffffa09e40f8de80  RU   0.0       0      0  [swapper/8]
  >     0      0   9  ffffa09e40f95e80  RU   0.0       0      0  [swapper/9]
  >     0      0  10  ffffa09e40f91f80  RU   0.0       0      0  [swapper/10]
  >     0      0  11  ffffa09e40f93f00  RU   0.0       0      0  [swapper/11]
  >     0      0  12  ffffa09e40f90000  RU   0.0       0      0  [swapper/12]
  >     0      0  13  ffffa09e40f9bf00  RU   0.0       0      0  [swapper/13]
  >     0      0  14  ffffa09e40f98000  RU   0.0       0      0  [swapper/14]
  >     0      0  15  ffffa09e40f9de80  RU   0.0       0      0  [swapper/15]

It works well as expected.

Some comments are added to explain why we use the hard-coded 16.

Link: https://lkml.kernel.org/r/20211120112738.45980-5-laoar.shao@gmail.com
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Michal Miroslaw <mirq-linux@rere.qmqm.pl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Kees Cook <keescook@chromium.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-01-20 08:52:53 +02:00
..
2021-09-20 12:43:34 +01:00
2021-08-29 14:47:42 +03:00
2021-11-23 19:13:00 +01:00
2021-10-07 16:51:57 +02:00
2021-10-18 14:43:23 -06:00
2021-11-17 10:36:15 -05:00
2021-09-08 15:32:35 -07:00
2021-12-10 17:10:55 -08:00
2021-10-25 12:01:14 +05:30
2021-08-26 15:32:28 -04:00
2021-09-06 07:20:56 -04:00
2021-11-17 10:36:35 -05:00
2021-10-18 07:49:38 -04:00
2021-08-05 11:46:42 +01:00
2021-10-05 06:54:16 -05:00
2021-10-18 07:49:39 -04:00
2021-09-30 12:46:44 -06:00
2021-09-27 09:27:29 -04:00
2021-11-06 14:08:17 -07:00
2021-08-23 13:19:12 +02:00
2021-09-21 13:44:55 -07:00
2021-12-17 10:24:07 +00:00
2021-11-10 21:16:56 +00:00
2021-09-17 13:52:17 +01:00
2021-10-18 07:49:39 -04:00
2021-09-27 09:27:29 -04:00
2021-11-17 10:36:35 -05:00
2021-09-27 17:00:21 +02:00
2021-10-14 13:29:18 +02:00
2021-08-18 22:08:24 +02:00
2021-10-07 16:51:57 +02:00
2021-10-18 07:49:39 -04:00
2021-10-18 17:20:50 +02:00
2021-08-17 17:50:51 +02:00
2021-10-30 16:37:28 +02:00
2021-11-06 13:30:43 -07:00
2021-10-26 14:58:45 +01:00
2021-08-06 13:41:48 -07:00
2021-08-19 09:02:55 +09:00
2021-11-03 11:41:25 -07:00
2021-10-07 13:51:11 +02:00
2021-09-22 16:59:13 +02:00
2021-09-08 15:32:35 -07:00
2021-08-11 06:44:24 -04:00
2021-12-09 10:49:56 -08:00
2021-10-19 23:44:30 +08:00