lkml.org 
[lkml]   [2012]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: yama_ptrace_access_check(): possible recursive locking detected
On 08/15, Kees Cook wrote:
>
> It sounds like get_task_comm shouldn't have locking at all then? It
> should just do a length-limited copy

Without task_lock() get_task_comm() can copy incomplete new name.

Honestly, I do not know any user which "strictly" needs the correct
name. may be proc.

> and make sure there is a trailing
> 0-byte?

get_task_comm()->strncpy() should always see (and copy) 0-byte.
comm[TASK_COMM_LEN - 1] == '\0' and this byte is never changed.

set_task_comm()->strlcpy() can write to this byte, but it can
only write 0 again.

Or I am totally confused ;)

Oleg.



\
 
 \ /
  Last update: 2012-08-15 21:03    [W:0.283 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site