lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <80e637d3-482d-4f3a-9a86-948d3837b24d@kernel.dk>
Date: Wed, 25 Jun 2025 10:23:28 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Steven Rostedt <rostedt@...dmis.org>, Jiazi Li <jqqlijiazi@...il.com>
Cc: linux-kernel@...r.kernel.org, "peixuan.qiu" <peixuan.qiu@...nssion.com>,
 io-uring@...r.kernel.org
Subject: Re: [PATCH] stacktrace: do not trace user stack for user_worker tasks

On 6/24/25 11:07 AM, Steven Rostedt wrote:
> On Mon, 23 Jun 2025 19:59:11 +0800
> Jiazi Li <jqqlijiazi@...il.com> wrote:
> 
>> Tasks with PF_USER_WORKER flag also only run in kernel space,
>> so do not trace user stack for these tasks.
> 
> What exactly is the difference between PF_KTHREAD and PF_USER_WORKER?

One is a kernel thread (eg no mm, etc), the other is basically a user
thread. None of them exit to userspace, that's basically the only
thing they have in common.

> Has all the locations that test for PF_KTHREAD been audited to make
> sure that PF_USER_WORKER isn't also needed?

I did when adding it, to the best of my knowledge. But there certainly
could still be gaps. Sometimes not easy to see why code checks for
PF_KTHREAD in the first place.

> I'm working on other code that needs to differentiate between user
> tasks and kernel tasks, and having to have multiple flags to test is
> becoming quite a burden.

None of them are user tasks, but PF_USER_WORKER does look like a
user thread and acts like one, except it wasn't created by eg
pthread_create() and it never returns to userspace. When it's done,
it's simply reaped.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ