Re: mips qemu test failures in -next due to "kthread: Fix use-after-free if kthread fork fails"

From: Guenter Roeck
Date: Sun May 28 2017 - 10:44:37 EST


+cc Linus, as mainline is now affected.

On 05/28/2017 04:45 AM, Vegard Nossum wrote:
On 05/27/17 19:56, Guenter Roeck wrote:
Hi,

my qemu testis of mips images are failing in -next. Symptom is a hang during
boot; see http://kerneltests.org/builders/qemu-mips-next for some examples.

I bisected the problem in next-20170526. It points to commit 4d6501dce079c
("kthread: Fix use-after-free if kthread fork fails"). Reverting that patch
fixes the problem.

Bisect log is attached.

Hi,

Thanks for the report and sorry for the breakage :-/

I can't immediately spot what's going wrong, but I am able to reproduce
it on mips so I will try to debug.

Are you sure it's this commit, though? I checked out linus/master and
I get a boot hang even after reverting it.


Reverting the patch fixed the problem for me in -next. The last mainline build
on my test system was with v4.12-rc2-228-gc86daad, which was fine except for
the known build breakages (frv, hexagon) and the known tracebacks
in crisv32
WARNING: CPU: 0 PID: 1 at drivers/mtd/mtdcore.c:734 mtd_device_parse_register+0x17a/0x1aa
and ppc
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 1 at lib/refcount.c:184 refcount_sub_and_test+0x84/0xe0

It may well be that something else is broken in mainline. The build of
v4.12-rc2-284-g249f1ef on my builders isn't complete yet. We'll see in
a couple of hours if there is other damage. I'll bisect later today if
necessary.

Guenter