Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1087934ybh; Tue, 10 Mar 2020 14:25:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvgYZYvfn9DplrzI8aY8s0wvdepGIF0o0tpZkp1zBNOxRiQda7PTOaa12/bpVEFlqASpBSX X-Received: by 2002:a9d:412:: with SMTP id 18mr12081401otc.134.1583875530816; Tue, 10 Mar 2020 14:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583875530; cv=none; d=google.com; s=arc-20160816; b=tXvW03Tw1KhcFtjzwJkn14kG1M5s+9rCYWkdcfgbLbuQKsrMlONuLpqUEw+exBzpst MhnWb09YjlUv2unY39o1N4OKh3EctTni/5ZcgsfaaUUIj8qGJ468yYW3dvRs+8cNiyqf 14thAntjaBRdZIrPm1PDc1k+v6ThYYG3quAOwT/hpciH/0mJLU1U/nsJxqzcqmcIBgLk GWPv8+6KbgFVHbmGy7HfAeBqx8R/Qo8xz2mr1gyCw/j47/DUz+MH3d2krSOmFK4kKfSm vFNFWqpwdAX/+/qz61q5EN6aaXzFpNS7YZmKKejDgHPkg6RSQgYvO6Ew+F4LbVnrpPEs BRug== 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=w/CkCVqmCtyVrNdTteJRfzqZVn1Fmayt+pRMN6dA6WQ=; b=gXycctXj65rFC0sRjXhn1ER9m76L/w0DH3TW1D+MgO3kX1JRVQcmrtZexlwbNtpaDN kLUVR6S0E3s55lpo1yQEsP1aS7XiQhlRtMjz+XFmUmn0Fc+ykHN9EEZZp8bHnXiQ2IBb 5/F8gT9Fcs5Rn9+03SlZIR8mFNuqIgI07Pumz8mdoIjHybUkuELysGgSZb27FoVktrZ8 rOHqM0F8dDzlwtFCGflI4M1ovgIMaCT4z311mrpi6HkFt1x1pmNDfKoGQrNUADxkXfSQ 7XtzLhP5BsWzYAI+V4G3GgFoNub5h7WCValIPHQJqpeDhVKv6Z6GCHYX91hQjPrKQdbr SJjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CYF6h+VX; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22si11532oic.271.2020.03.10.14.25.18; Tue, 10 Mar 2020 14:25:30 -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=@google.com header.s=20161025 header.b=CYF6h+VX; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727528AbgCJVYe (ORCPT + 99 others); Tue, 10 Mar 2020 17:24:34 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45647 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbgCJVYe (ORCPT ); Tue, 10 Mar 2020 17:24:34 -0400 Received: by mail-pl1-f193.google.com with SMTP id b22so20485pls.12 for ; Tue, 10 Mar 2020 14:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w/CkCVqmCtyVrNdTteJRfzqZVn1Fmayt+pRMN6dA6WQ=; b=CYF6h+VXHl19LIAYXl7Ey55sWNZwBlILMjJhtQIgPX7qIyptQACPY8ADJcC8vkk7rs qKvI3FOahK7tMELwmCKGa/+HTlWZKP5TdgfiYa/X+GJkJip2WfomYqZRQYsTrQ5Hngch g2pImAJOaAMtIXpjDSqdxUOAUvZDika1yd7LHzIT9rOOPpJM9O8ok7cMt+2RLpQyoMUF tW5WKuknRZhn9qCC1Ui95yzJKCKrC7BDohv5ZnBjfqWNf5gXXdNeOx11HPMorOT6wn1J /9X/0saUjVqBA20QrP9OmCf1FXmea04Sg+i8Ei/iV8UB/94MS0KfV4phcOvFKoZfRzmh 9HMQ== 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=w/CkCVqmCtyVrNdTteJRfzqZVn1Fmayt+pRMN6dA6WQ=; b=Q29VmvRKuei1bkwu9kCk5goPS7BALS3wc0tg0G0q4l48aU4RBVcT3SrtyL7iNxGiK6 cDx/E3CS2QHIZblAV6WhQbpz7LjLXtvtYLup2DA+WV7CqGolNGFCmnhrZVRLYPuo8vYm 2FjTxWgTlk1yK/a/UBsmeKWaVbsGkZKP+BPPg9RFxAC5y2HiqyFWrm64PTiQd2lJBySn PEPR0Omb8xqhI3aLFITi5irX3JCLzae6aDVt7l9XXqEZq7EMOwFYRfIqWLqhKnCCu6JP UXeiB6FfB1NKCIfvPeZ47LGRlqgHxNloRHdioN0oEansdnArCe4pBTzUnKB+Zi1GpxdC LXZw== X-Gm-Message-State: ANhLgQ2VDBVaOeaTQuV2cQlHbRW8/EpUOonb/YEE8+1tH8qQEUeydGgV ZrhBj+fQRhmdhSpddVvCGwvdcvHv41JHQfIMJ0Ki3Q== X-Received: by 2002:a17:90a:fe04:: with SMTP id ck4mr3730232pjb.29.1583875473395; Tue, 10 Mar 2020 14:24:33 -0700 (PDT) MIME-Version: 1.0 References: <20200305183939.256241-1-davidgow@google.com> In-Reply-To: <20200305183939.256241-1-davidgow@google.com> From: Brendan Higgins Date: Tue, 10 Mar 2020 14:24:22 -0700 Message-ID: Subject: Re: [PATCH] um: Fix overlapping ELF segments when statically linked To: David Gow Cc: Jeff Dike , Richard Weinberger , Anton Ivanov , Patricia Alfonso , linux-um , Linux Kernel Mailing List 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 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