lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160712170144.GC4557@redhat.com>
Date:	Tue, 12 Jul 2016 19:01:45 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Stanislav Kinsburskiy <skinsbursky@...tuozzo.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

On 07/12, Stanislav Kinsburskiy wrote:
>
> 12.07.2016 18:42, Oleg Nesterov пишет:
>> 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)?

Sorry for confusion...

Yes, it is not needed now (before this patch). Because only one caller
of prctl_set_mm_exe_file() can succced and update mm->exe_file. So we
could just do

	fput(mm->exe_file);
	mm->exe_file = get_file(exe.file);


But after this patch we do need this xchg(), otherwise 2 callers of
prctl_set_mm_exe_file() can race with each other. And this was the
actual reason for xchg: simplify the MMF_EXE_FILE_CHANGED removal in
future.

Oleg.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ