On Fri, Jun 14, 2024 at 6:18 AM Linus Torvalds
wrote:
>
> On Thu, 13 Jun 2024 at 14:14, Andrew Morton wrote:
> >
> > The concept sounds a little strange. If some code takes a copy of a
> > string while some other code is altering it, yes, the result will be a
> > mess. This is why get_task_comm
On Fri, Jun 14, 2024 at 5:14 AM Andrew Morton wrote:
>
> On Thu, 13 Jun 2024 10:30:39 +0800 Yafang Shao wrote:
>
> > In kstrdup(), it is critical to ensure that the dest string is always
> > NUL-terminated. However, potential race condidtion can occur between a
> > writer and a reader.
> >
> > Co
On Thu, 13 Jun 2024 at 14:14, Andrew Morton wrote:
>
> The concept sounds a little strange. If some code takes a copy of a
> string while some other code is altering it, yes, the result will be a
> mess. This is why get_task_comm() exists, and why it uses locking.
The thing is, get_task_comm()
On Thu, 13 Jun 2024 10:30:39 +0800 Yafang Shao wrote:
> In kstrdup(), it is critical to ensure that the dest string is always
> NUL-terminated. However, potential race condidtion can occur between a
> writer and a reader.
>
> Consider the following scenario involving task->comm:
>
> reader
In kstrdup(), it is critical to ensure that the dest string is always
NUL-terminated. However, potential race condidtion can occur between a
writer and a reader.
Consider the following scenario involving task->comm:
readerwriter
len = strlen(s) + 1;