lkml.org 
[lkml]   [2016]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] prctl: remove one-shot limitation for changing exe link
From
Date


12.07.2016 18:42, Oleg Nesterov пишет:
> On 07/12, Stanislav Kinsburskiy wrote:
>> --- a/kernel/sys.c
>> +++ b/kernel/sys.c
>> @@ -1696,16 +1696,6 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
>> fput(exe_file);
>> }
>>
>> - /*
>> - * The symlink can be changed only once, just to disallow arbitrary
>> - * transitions malicious software might bring in. This means one
>> - * could make a snapshot over all processes running and monitor
>> - * /proc/pid/exe changes to notice unusual activity if needed.
>> - */
>> - err = -EPERM;
>> - if (test_and_set_bit(MMF_EXE_FILE_CHANGED, &mm->flags))
>> - goto exit;
>> -
> I didn't even try to read the changelog so I do not know why do you
> want this change ;)
>
> But I would like to ack it in any case. I never understood why do we
> want/need this MMF_EXE_FILE_CHANGED check, I suggested to remove it
> many times.
>
> And can't resist, please note the xchg() below. Currently (before this
> patch) we do not need it. I was specially added to ensure that we can
> just remove this test_and_set_bit(MMF_EXE_FILE_CHANGED) without adding
> a race.

Thanks, Oleg. I'll take a look.
But should this be addressed in this patch? Especially if it's not
needed even now (before this patch)?


> Acked-by: Oleg Nesterov <oleg@redhat.com>
>

\
 
 \ /
  Last update: 2016-07-12 20:01    [W:0.154 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site