lkml.org 
[lkml]   [2022]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] umh: fix UAF when the process is being killed
Date

Luis Chamberlain <mcgrof@kernel.org> writes:

> On Mon, Dec 12, 2022 at 09:38:31PM +0800, Schspa Shi wrote:
>> I'd like to upload a V2 patch with the new solution if you prefer the
>> following way.
>>
>> diff --git a/kernel/umh.c b/kernel/umh.c
>> index 850631518665..8023f11fcfc0 100644
>> --- a/kernel/umh.c
>> +++ b/kernel/umh.c
>> @@ -452,6 +452,11 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
>> /* umh_complete() will see NULL and free sub_info */
>> if (xchg(&sub_info->complete, NULL))
>> goto unlock;
>> + /*
>> + * kthreadd (or new kernel thread) will call complete()
>> + * shortly.
>> + */
>> + wait_for_completion(&done);
>> }
>
> Yes much better. Did you verify it fixes the splat found by the bots?
>

Yes, it will fix it.

> Luis


--
BRs
Schspa Shi

\
 
 \ /
  Last update: 2022-12-14 04:18    [W:1.204 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site