From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440AbaBOXFu (ORCPT ); Sat, 15 Feb 2014 18:05:50 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:54016 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751802AbaBOXFt (ORCPT ); Sat, 15 Feb 2014 18:05:49 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Andrey Wagin Cc: Cyrill Gorcunov , Aditya Kali , Stephen Rothwell , Pavel Emelyanov , Oleg Nesterov , LKML , "criu\@openvz.org" , Al Viro , Andrew Morton , Kees Cook References: <1392387209-330-1-git-send-email-avagin@openvz.org> <1392387209-330-2-git-send-email-avagin@openvz.org> <874n41znl5.fsf@xmission.com> <20140214174314.GA5518@gmail.com> <20140214180129.GK13358@moon> <8761ohqzc6.fsf@xmission.com> Date: Sat, 15 Feb 2014 15:05:43 -0800 In-Reply-To: (Andrey Wagin's message of "Sat, 15 Feb 2014 00:44:46 +0400") Message-ID: <87vbwg7z94.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX1+QKUD6itcs1/+H45nWqXe/1EodnQ3n0oI= X-SA-Exim-Connect-IP: 98.207.154.105 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG * -0.0 BAYES_40 BODY: Bayes spam probability is 20 to 40% * [score: 0.3287] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Andrey Wagin X-Spam-Relay-Country: Subject: Re: [CRIU] [PATCH 1/3] prctl: reduce permissions to change boundaries of data, brk and stack X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 14 Nov 2012 14:26:46 -0700) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrey Wagin writes: > 2014-02-14 23:16 GMT+04:00 Eric W. Biederman : >> >> Hmm. Let me rewind this a little bit. >> >> I want to be very stupid and ask the following. >> >> Why can't you have the process of interest do: >> ptrace(PTRACE_ATTACHME); >> execve(executable, args, ...); >> >> /* Have the ptracer inject the recovery/fixup code */ >> /* Fix up the mostly correct process to look like it has been >> * executing for a while. >> */ >> >> That should work, set all of the interesting fields, and works as >> non-root today. My gut feel says do that and we can just >> deprecate/remove prctl_set_mm. > > start_brk and start_stack are randomized each time. I don't understand > how execve() can restore the origin values of attributes. As is the location of the vdso and there isn't a way to set that. So perhaps what we want to do is to change the randomization with mremap(old_addr, size, size, MREMAP_MAYMOVE | MREMAP_FIXED, new_addr) and just have the kernel update all of the addresses in bulk when we move the location. I don't know what the folks who are worried about losing tampering evidence will think but as a targeted special case it may not be at all crazy. Eric