Skip to contentSkip to conversation

mm/migrate: Avoid possible unnecessary ptrace_may_access() call in kernel_move_pages()

PATCH linmiaohe 2 participants 2 messages Aug 20, 2020

Subsystems (2)
lore
Share & tools
lore

linmiaohe

author
#0 lore raw
Quoted 9 lines · Kees Cook
Quoted 5 lines · Miaohe Lin

There is no need to check if this process has the right to modify the specified process when they are same.

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.

Quoted 2 lines

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.

Quoted 2 lines

--
Kees Cook

Thanks again.

#1 lore raw
Quoted 11 lines · linmiaohe
Quoted 9 lines · Kees Cook
Quoted 5 lines · Miaohe Lin

There is no need to check if this process has the right to modify the specified process when they are same.

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.

Quoted 7 lines

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.

Quoted 2 lines

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!

Signature · 1 line
Kees Cook