[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69b3bfd5-02aa-51ad-12b4-dc8d330b6c67@virtuozzo.com>
Date: Tue, 12 Jul 2016 18:52:29 +0200
From: Stanislav Kinsburskiy <skinsbursky@...tuozzo.com>
To: Oleg Nesterov <oleg@...hat.com>
CC: <peterz@...radead.org>, <mingo@...hat.com>, <mhocko@...e.com>,
<keescook@...omium.org>, <linux-kernel@...r.kernel.org>,
<mguzik@...hat.com>, <bsegall@...gle.com>,
<john.stultz@...aro.org>, <ebiederm@...ssion.com>,
<gorcunov@...nvz.org>, <matthltc@...ibm.com>,
<akpm@...ux-foundation.org>, <luto@...capital.net>,
<vbabka@...e.cz>, <xemul@...tuozzo.com>
Subject: Re: [PATCH] prctl: remove one-shot limitation for changing exe link
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@...hat.com>
>
Powered by blists - more mailing lists