Re: [PATCH] delayacct: Fix crash in delayacct_blkio_end() after delayacct init failure
From: Andrew Morton
Date: Tue Jul 24 2018 - 15:29:17 EST
On Tue, 24 Jul 2018 10:55:42 -0700 Tejun Heo <tj@xxxxxxxxxx> wrote:
> While forking, if delayacct init fails due to memory shortage, it
> continues expecting all delayacct users to check task->delays pointer
> against NULL before dereferencing it, which all of them used to do.
>
> c96f5471ce7d ("delayacct: Account blkio completion on the correct
> task"), while updating delayacct_blkio_end() to take the target task
> instead of always using %current, made the function test NULL on
> %current->delays and then continue to operated on @p->delays. If
> %current succeeded init while @p didn't, it leads to the following
> crash.
>
lgtm.
How did you make this happen, btw? Fault injection, or did a small
GFP_KERNEL allocation fail?