Re: + kthread-unify-kernel_thread-and-user_mode_thread.patch added to mm-nonmm-unstable branch

From: Thomas Gleixner
Date: Mon Jun 12 2023 - 03:49:25 EST


On Sun, Jun 11 2023 at 14:59, Eric W. Biederman wrote:
> Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> writes:
>
>> The patch titled
>> Subject: kthread: Unify kernel_thread() and user_mode_thread()
>> has been added to the -mm mm-nonmm-unstable branch. Its filename is
>> kthread-unify-kernel_thread-and-user_mode_thread.patch
>
> Andrew.
>
> My fuzzy memory thinks Linus asked for the current split.

Correct. It was in a discussion about a nasty security hole due to a
race in the original code which did _not_ have the distinction.

> Plus this change just obfuscates the code making the most important
> detail the argument to a boolean parameter. Meaning you have to have
> an interface that has only 3 callers memorized to even begin to make
> sense of it.

Right. Losing the clear distinction of the function names is a horrible
idea.

If at all this should at least keep user_mode_thread() and
kernel_thread() as inline wrappers around a common function.

Just blindly unifying code is a patently bad idea.

Thanks,

tglx