Re: kmemleak splat on copy_process()

From: Andy Lutomirski
Date: Fri Feb 17 2017 - 12:08:21 EST


On Wed, Feb 8, 2017 at 5:37 PM, Luis R. Rodriguez <mcgrof@xxxxxxxxxx> wrote:
> On Tue, Feb 07, 2017 at 09:03:43AM +0100, Michal Hocko wrote:
>> On Tue 07-02-17 02:37:02, Luis R. Rodriguez wrote:
>> > > From a quick check I do not see any leak there either.
>> >
>> > Then in that case what about:
>>
>> This just disables the kmemleak altogether which doesn't sound like a
>> good idea to me.
>
> Only for this case, but if that is also not desirable let us debug further.
> That or I think we could perhaps massage code to make it clearer to kmemleak
> things are good.
>

I'm not seeing the issue. There should be a live pointer to stack at
all times, either in a local variable or in task->stack. There's a
weird window in dup_task_struct in which we're stashing away
stack_vm_area, but stack itself should be okay, I think. But maybe
there really is a race in which a kmemleak check right in the middle
of duplicating the task struct really can't see the stack pointer.