Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp396335imm; Thu, 31 May 2018 02:26:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxdkLz32HGmNQNTMBj+o2YHFQf4Ghb1iLzIBIwfgRKkw7oEJWQmjxeMXNIqDAnIMD0sCaK X-Received: by 2002:a65:64d3:: with SMTP id t19-v6mr408090pgv.148.1527758764137; Thu, 31 May 2018 02:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527758764; cv=none; d=google.com; s=arc-20160816; b=WQWatpBmYhHBD6x5qXuKg9Q7iwvlUtrmYMEM6dLJONZTqeBWNsSUO75xbGFtsqQk5p l9bk7gzB2XgSxlCqmsHvhJwOsCoDi/5Z7ULw3ZBap784mUj1twe1eEp0QGXM82y029/t VUJNkIlhgKAfI3gmyz4xvAf5BI0S8SssNV2pvoRBVUvIKEtYLYzLsuLS8W9tNzSrMo8Z BJ8KC/YVBecTezLpsvmd1IGpkzewsKph0ijX/9c9/HwyAP6PTz5ZKRtOjOFIEEoX/rGW vN/MT7y1k+OMV7AoBETa7u8PsbPrmxCrrwM843+Bjz7Ob5rENs7cNVnuuNaM4hOlsLWV aEyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=HshwlmzjTRAkEO8St9/h+mX3qUAvwQaW6p5GkgD2P9k=; b=kjU57brZzuvTRH8trc9zo0KHUJTqgjrOoh5H6jUAytjsyW19zuaPEDti829OAQlw8e cZ3tk0PDFgTN4A2NWzLcCNIeV8V0AZ8M7TnU63+9OqehQ2lQHYvfcHnHaGhmeSdVGl8r DlyRek5cBMv9N6kdOU1szGrpTMEiXL8KZVdtj+/A48n1qO0DWotvnAQmBmYZBMNDAnop XKKHCPkkadOwRJxXZNR37FFIdaF6Lsk0eRzYtBnGIE3X7wdhwqj46DPQF9DOqTQrP9Ii YB9V6i9IGquyjuDoLmLusGgxl+8epq1sjz+fnA9XPVn0xM6IIvwc2ZnqW833aqAcHKVo dFNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si35209379plc.574.2018.05.31.02.25.49; Thu, 31 May 2018 02:26:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754208AbeEaJY3 (ORCPT + 99 others); Thu, 31 May 2018 05:24:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:33230 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754103AbeEaJY1 (ORCPT ); Thu, 31 May 2018 05:24:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4D5B6AE61; Thu, 31 May 2018 09:24:26 +0000 (UTC) Date: Thu, 31 May 2018 11:24:25 +0200 From: Michal Hocko To: Mike Kravetz Cc: Andrew Morton , linux-mm@kvack.org, LKML , libhugetlbfs@googlegroups.com Subject: Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map Message-ID: <20180531092425.GM15278@dhcp22.suse.cz> References: <20171129144219.22867-1-mhocko@kernel.org> <20171129144219.22867-3-mhocko@kernel.org> <93ce964b-e352-1905-c2b6-deedf2ea06f8@oracle.com> <20180530080212.GA27180@dhcp22.suse.cz> <20180530162501.GB15278@dhcp22.suse.cz> <1f6be96b-12ac-9a03-df90-386dab02369d@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1f6be96b-12ac-9a03-df90-386dab02369d@oracle.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 30-05-18 17:51:15, Mike Kravetz wrote: [...] > [ 38.931497] load_elf_binary: skipping index 0 p_vaddr = 8048034 > [ 38.932321] load_elf_binary: skipping index 1 p_vaddr = 8048154 > [ 38.933165] load_elf_binary: calling elf_map() index 2 bias 0 vaddr 8048000 > [ 38.934087] map_addr ELF_PAGESTART(addr) 8048000 total_size 0 ELF_PAGEALIGN(size) 2000 > [ 38.935101] eppnt->p_offset = 0 > [ 38.935561] eppnt->p_vaddr = 8048000 > [ 38.936073] eppnt->p_paddr = 8048000 > [ 38.936897] eppnt->p_filesz = 169c > [ 38.937493] eppnt->p_memsz = 169c > [ 38.938042] load_elf_binary: calling elf_map() index 3 bias 0 vaddr 804969c > [ 38.939002] map_addr ELF_PAGESTART(addr) 8049000 total_size 0 ELF_PAGEALIGN(size) 2000 > [ 38.939959] eppnt->p_offset = 169c > [ 38.940410] eppnt->p_vaddr = 804969c > [ 38.940897] eppnt->p_paddr = 804969c > [ 38.941507] eppnt->p_filesz = 1878 > [ 38.942019] eppnt->p_memsz = 1878 > [ 38.942516] 1123 (xB.linkhuge_nof): Uhuuh, elf segment at 8049000 requested but the memory is mapped already > > It is pretty easy to see the mmap conflict. I'm still trying to determine if > the executable file is 'valid'. It did not throw an error previously as > MAP_FIXED unmapped the overlapping page. However, this does not seem right. Yes, it looks suspicious to say the least. How come the original content is not needed anymore? Maybe the first section should be 0x1000 rather than 0x169c? I am not an expert on the load linkers myself so I cannot really answer this question. Please note that ppc had something similar. See ad55eac74f20 ("elf: enforce MAP_FIXED on overlaying elf segments"). Maybe we need to sprinkle more of those at other places? -- Michal Hocko SUSE Labs