Messages in this thread | | | Date | Thu, 11 Nov 2021 10:59:50 +0100 | Subject | Re: [PATCH 2/7] fs/exec: make __get_task_comm always get a nul terminated string | From | David Hildenbrand <> |
| |
On 08.11.21 09:38, Yafang Shao wrote: > If the dest buffer size is smaller than sizeof(tsk->comm), the buffer > will be without null ternimator, that may cause problem. Using > strscpy_pad() instead of strncpy() in __get_task_comm() can make the string > always nul ternimated. > > Suggested-by: Kees Cook <keescook@chromium.org> > Suggested-by: Steven Rostedt <rostedt@goodmis.org> > Signed-off-by: Yafang Shao <laoar.shao@gmail.com> > Reviewed-by: Kees Cook <keescook@chromium.org> > Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com> > Cc: Alexei Starovoitov <alexei.starovoitov@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> > ---
Reviewed-by: David Hildenbrand <david@redhat.com>
-- Thanks,
David / dhildenb
| |