Re: [PATCH] ocfs2: use get_task_comm

2017-12-05 Thread Peter Zijlstra
On Tue, Dec 05, 2017 at 10:44:17PM +0100, Arnd Bergmann wrote: > On Tue, Dec 5, 2017 at 9:32 PM, Kees Cook wrote: > > On Tue, Dec 5, 2017 at 12:27 PM, Arnd Bergmann wrote: > >> > >> More generally speaking though, how exactly do we guarantee that > >> there is NUL-termination on tsk->comm during

Re: [PATCH] ocfs2: use get_task_comm

2017-12-05 Thread Arnd Bergmann
On Tue, Dec 5, 2017 at 9:32 PM, Kees Cook wrote: > On Tue, Dec 5, 2017 at 12:27 PM, Arnd Bergmann wrote: >> >> More generally speaking though, how exactly do we guarantee that >> there is NUL-termination on tsk->comm during a concurrent update? >> Could we ever get into a situation where overwrit

Re: [PATCH] ocfs2: use get_task_comm

2017-12-05 Thread Kees Cook
On Tue, Dec 5, 2017 at 12:27 PM, Arnd Bergmann wrote: > On Tue, Dec 5, 2017 at 8:19 PM, Kees Cook wrote: >> On Tue, Dec 5, 2017 at 7:20 AM, Arnd Bergmann wrote: >>> While reviewing all callers of get_task_comm(), I stumbled >>> over this one that claimed it was not exported, when in fact >>> it

Re: [PATCH] ocfs2: use get_task_comm

2017-12-05 Thread Arnd Bergmann
On Tue, Dec 5, 2017 at 8:19 PM, Kees Cook wrote: > On Tue, Dec 5, 2017 at 7:20 AM, Arnd Bergmann wrote: >> While reviewing all callers of get_task_comm(), I stumbled >> over this one that claimed it was not exported, when in fact >> it is. Accessing task->comm directly is not safe, so better >> c

Re: [PATCH] ocfs2: use get_task_comm

2017-12-05 Thread Kees Cook
On Tue, Dec 5, 2017 at 7:20 AM, Arnd Bergmann wrote: > While reviewing all callers of get_task_comm(), I stumbled > over this one that claimed it was not exported, when in fact > it is. Accessing task->comm directly is not safe, so better > convert this one to using get_task_comm as well. Using g