[PATCH] powerpc: don't try to copy ppc for task with NULL pt_regs

Jens Axboe axboe at kernel.dk
Tue Mar 28 23:39:12 AEDT 2023


On 3/28/23 5:32?AM, Michael Ellerman wrote:
> Jens Axboe <axboe at kernel.dk> writes:
>> Powerpc sets up PF_KTHREAD and PF_IO_WORKER with a NULL pt_regs, which
>> from my (arguably very short) checking is not commonly done for other
>> archs. This is fine, except when PF_IO_WORKER's have been created and
>> the task does something that causes a coredump to be generated.
> 
> Do kthread's ever core dump? I didn't think they did, but I can't find
> any logic to prevent it.

kthreads aren't associated with the original task, they just exist by
themselves. They also can't take signals. Eg they cannot core dump, just
oops :-)

This is different than io workers that do show up as threads, but they
still don't exit to userspace. That is why it ended being a problem.

> As Nick said we should probably have a non-NULL regs for PF_IO_WORKERS,
> but I'll still take this as a nice backportable fix for the immediate
> crash.
> 
> I tagged it as Fixes: pointing back at the commit that added ppr_get(),
> even though I don't know for sure the bug was triggerable back then
> (v4.8).

Thanks!

-- 
Jens Axboe



More information about the Linuxppc-dev mailing list