Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1869811ybb; Sun, 29 Mar 2020 15:47:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuN35bmmFA69Ag7fo5FUfGI+MtPf3y7vfQ/0NHb4IDOGKscXrUBPrvpJGOEh1tMDcLcM292 X-Received: by 2002:aca:7506:: with SMTP id q6mr5894819oic.73.1585522037520; Sun, 29 Mar 2020 15:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585522037; cv=none; d=google.com; s=arc-20160816; b=KrHrWJ6XO7mRgIpp09mgiHd1qgJxkB9nWGhllqOfpaIgTU/y0jfJBGM4vSqLHaPTAM Z9lBMDBUkiFJgu+4sSZAaDFmzR9tYyAwfK7DMNp5Bxw2Wto71V9H5ZxiE12hOxoUh7oS Auqy7PhO62NJnRE+NyUYKQzGUPghwSa31Awf2Kurs2k3QtMBB01TtP4MxIpg94Yd2Pn+ 4JlB9eE13anGWeVBwVyWM5iAbyLR1Nm+6/BqoOq0ADiZWTYHsolg5yp7+b+dVZnzWwIw K33DEg9y5k0P7zHEz3bG5rYYNgjLamJYFeLkS8SGgsvzMvJmoTSM3y6KSqL+7xwylSZF 99yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4+YFamD+rk3pGnPVsQCdZ4BWzaSDaazUq7GaLMAvAmQ=; b=vCUheeJGLkx/+O75u18YA6wef81kJCCo8qhoNOTCIcAESzPbJ8uYkXncXHcerVqk0R yPvUabjpqoBNqaxyJDN86FO+zXubKC+AJvVklVZqm+YT+/eziONDpwe1gjQ5Iq+3/g9Z ZbZ5iuvM8jsImKvCZHaBz2owwiddiSeKWy2xAAIWx4zLNs4JoNxNw7SCWq4TabMf5/hj ZPaR8nDhOsN6k0BAGyI5JIEWSMk1JxYpU93bXiZcsH2RM5nGwVLdW1yDu69ggUkuBtFD /8RwuaJGpwxLTZu8/4YlfOoNKkON3xOHg/+Ipv8tUe3Dfr/8ftCdgEkeFMlsQlCAteLp c5+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ItnsYShc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23si5751088oti.18.2020.03.29.15.47.04; Sun, 29 Mar 2020 15:47:17 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ItnsYShc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728923AbgC2VjH (ORCPT + 99 others); Sun, 29 Mar 2020 17:39:07 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36589 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbgC2VjG (ORCPT ); Sun, 29 Mar 2020 17:39:06 -0400 Received: by mail-wr1-f66.google.com with SMTP id 31so18856617wrs.3 for ; Sun, 29 Mar 2020 14:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4+YFamD+rk3pGnPVsQCdZ4BWzaSDaazUq7GaLMAvAmQ=; b=ItnsYShcZm6ooRrKDOeQxLDzvFUEHhf1luwCKa2jXLuYMQLHD3kRPw9TDOJUY05WFA BRfkFkmum2aCG9ZfEepcnnnx1PQEsgX8YpLDsnPP9PYEPGwbgncnlFls1GUQVQTYM4M8 wiqvgw3nuQcSK5aIJD6biTbwJu6aV9VIm+7GCMbV/5A/b06Ho0OJ4VcV2kD3mJyjCluc x+jmHy/iga9z0oabN/uuSn1uL/CJtvK5d/r40NG+ygCU0vsOmVXZt7PdTFhu+sj002jn Z/wj1hZgO9sxhypOB/UjppXuN7X+vOLQsa5lUiU/Fn6/w6jGI6YmEWngNVItWEj6Of7p fOSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4+YFamD+rk3pGnPVsQCdZ4BWzaSDaazUq7GaLMAvAmQ=; b=p+03oSnC4sQTfT7PI7WlJng9mH3mUUYKQtRCale9oNByDG9unQDLPrQJhuSv8ShRfv wHG8cgakbLsY1huN9099xK7UN+976Ij3RJiBc9BwMclrurvoXAXxKqfSjUEKvv8hwi2x XBnxTF+Tp4EjBKenTWmYi/D3T09k3NR1C835f5qEiLTYSZS188Pjes8IeJ2n+s5jkwv0 ynZyCjwdg9+f1/MnBsV3b3TAeM/QWdEk0LEa87ZAbYPsWAUOpHYN1X5CXbr7DvbAI+pP Y80CWeif8S86+DZoO2DOFjdDglZvRto6OiX5FTUegZo1GcH5fVYXcLqc6U+26U3LmdCj NfuA== X-Gm-Message-State: ANhLgQ1b3ytI/ewCbL1dQPZOd2wv3MXRv4kyxmGwM1FTcPK+2NZQ0f1I 3EIhIpdJh1vf0gZRk+q6xZDvs+QvxiCOG2ZocFU= X-Received: by 2002:adf:9384:: with SMTP id 4mr11351603wrp.214.1585517944701; Sun, 29 Mar 2020 14:39:04 -0700 (PDT) MIME-Version: 1.0 References: <20200305183939.256241-1-davidgow@google.com> In-Reply-To: From: Richard Weinberger Date: Sun, 29 Mar 2020 23:38:53 +0200 Message-ID: Subject: Re: [PATCH] um: Fix overlapping ELF segments when statically linked To: Brendan Higgins Cc: David Gow , Patricia Alfonso , Richard Weinberger , Jeff Dike , linux-um , Linux Kernel Mailing List , Anton Ivanov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 10:24 PM Brendan Higgins wrote: > > On Thu, Mar 5, 2020 at 10:39 AM David Gow wrote: > > > > When statically linked, the .text section in UML kernels is not page > > aligned, causing it to share a page with the executable headers. As > > .text and the executable headers have different permissions, this causes > > the kernel to wish to map the same page twice (once as headers with r-- > > permissions, once as .text with r-x permissions), causing a segfault, > > and a nasty message printed to the host kernel's dmesg: > > > > "Uhuuh, elf segment at 0000000060000000 requested but the memory is > > mapped already" > > > > By aligning the .text to a page boundary (as in the dynamically linked > > version in dyn.lds.S), there is no such overlap, and the kernel runs > > correctly. > > > > Signed-off-by: David Gow > > I can confirm that I am seeing this problem as well. (I know we run > the same Linux distro; nevertheless, this is a real problem for some > population of users.) > > Reviewed-by: Brendan Higgins Applied, thanks! -- Thanks, //richard