Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751835AbdFTLKW (ORCPT ); Tue, 20 Jun 2017 07:10:22 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:32922 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbdFTLKV (ORCPT ); Tue, 20 Jun 2017 07:10:21 -0400 Date: Tue, 20 Jun 2017 14:10:18 +0300 From: Cyrill Gorcunov To: Oleg Nesterov Cc: Hugh Dickins , Andrey Vagin , LKML , Pavel Emelyanov , Dmitry Safonov , Andrew Morton Subject: Re: [criu] 1M guard page ruined restore Message-ID: <20170620111018.GD1909@uranus.lan> References: <20170620075206.GB1909@uranus.lan> <20170620105116.GA20974@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170620105116.GA20974@redhat.com> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 978 Lines: 24 On Tue, Jun 20, 2017 at 12:51:16PM +0200, Oleg Nesterov wrote: > > You can write a simple test. Just do mmap(MAP_GROWSDOWN) and look at > /proc/self/maps. If it reports vm_start + PAGE_SIZE rather than addr > returned by mmap, then the kernel is old. > > > Second I guess we might need to detect @stack_guard_gap runtime as > > well > > I do not think so. criu does not need to know about the new guard area > at all. It simply doesn't exist from user-space pov. > > In fact, I think this should have been true even before this change, just > stack_guard_page_start() was not accurate and this is the reason (I guess) > you had to play with stack guard; the first page (hidden by show_map_vma) > can have a valid stack data, for example if the application played with > MAP_FIXED or munmap(). > > So I think you should simply disable, say, unmap_guard_pages() and most > of all other MAP_GROWSDOWN code in criu. Looks like a good plan. Thanks Oleg! Gonna try it. Cyrill