lkml.org 
[lkml]   [2020]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/migrate: Avoid possible unnecessary ptrace_may_access() call in kernel_move_pages()
On Thu, Aug 20, 2020 at 02:18:21AM +0000, linmiaohe wrote:
> Kees Cook <keescook@chromium.org> wrote:
> >On Mon, Aug 17, 2020 at 07:59:33AM -0400, Miaohe Lin wrote:
> >> There is no need to check if this process has the right to modify the
> >> specified process when they are same.
> >>
> >> Signed-off-by: Hongxiang Lou <louhongxiang@huawei.com>
> >> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> >
> >NAK, please don't do this -- the ptrace and security hooks already do these kinds of self-introspection checks, and I'd like to keep a central place to perform these kinds of checks.
> >
>
> Many thanks for your reply.
> We also avoid get_task_struct/ put_task_struct pair of atomic ops, rcu_lock, task_lock and so on this way.
>
> >Is there a specific problem you've encountered that this fixes?
> >
>
> I'am sorry but there's no specific problem. I do this mainly to skip the unnecessary ptrace and security hooks.

Cool. Let's keep this as-is so we continue to have centralized
instrumentation of these things in the LSM. :)

Thanks for your attention to performance!

--
Kees Cook

\
 
 \ /
  Last update: 2022-09-17 16:08    [W:0.039 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site