Received: by 10.223.176.5 with SMTP id f5csp1076038wra; Fri, 2 Feb 2018 10:45:26 -0800 (PST) X-Google-Smtp-Source: AH8x227DdXP3CwABvuORoKrlqrSppDGPBXClRyWQ5uu50q4dz5aV9qDRdpqEmodgb0hALqyUtLRE X-Received: by 10.99.114.24 with SMTP id n24mr5408058pgc.376.1517597126667; Fri, 02 Feb 2018 10:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517597126; cv=none; d=google.com; s=arc-20160816; b=OQu2BHmQqtZo9KEu3UUJviyZ7O4Z23CEQ5JMWOs7T0D9jHW+z6Hvxb7tCJsMv7lnrM 2JMkvGyPVa7gXITRiP/ubclFK8jA3xtOfOf9r1ySNfX2YISKfvZKErNa5N5Lyh1oZxNg qXkHe/nudrkg0FuUWXCfy1mUB9SAizaXRYLe/miRH7/bL+aAvUkwsk1tWloRS+3A2sVf Iub0OGcMHObE+NpvFx/VadiOj5SfjgD4Wi2g5KfN3BpGp3fYlI1My6finGdFfiTylb4B VYqJv3WCoJN2BPvfIko9AtLjG1KJmO4kbLypLyfSWZVRh1uXN0dsAHaR+lDjRzNW7V26 eBlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=yoPxrHUY0rZcG2r5nYUWo4LZXYlS5e3I/rpWq33ONjQ=; b=ebATRvdwvNK2Lvk363Sj0/kivt0Lr8XXqo/7eLhVhhaiC4LLwQDKNpbs57ijeTDhzL VUtIX8M29Cl0emCYoUrjQkL+bq55SswaGYnQn4krIqZKV5kI0n9PFfWZERcMCWs6gKg1 xDF2vMp/3Doo5fWPe2XI5/lmnoLD5uRPfWDGvqHYcATNC8VMmP5QNSx5n+dG+eb+15sR WUtgMBB0ujpnBBmJM4XnbGEJvSArBdtgTC1RD3Qhx0Er64I42flwjLlDGTS5eltUfDK9 U48GM+hewk/YTQfsRzLHVQVyMZnNZP8u13W3OET7LW8aO/XMEcZR8EtitPAuhbajnTW0 aKOQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1-v6si226955plm.153.2018.02.02.10.45.11; Fri, 02 Feb 2018 10:45:26 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754941AbeBBSnf (ORCPT + 99 others); Fri, 2 Feb 2018 13:43:35 -0500 Received: from resqmta-ch2-08v.sys.comcast.net ([69.252.207.40]:37370 "EHLO resqmta-ch2-08v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752542AbeBBSn1 (ORCPT ); Fri, 2 Feb 2018 13:43:27 -0500 Received: from resomta-ch2-02v.sys.comcast.net ([69.252.207.98]) by resqmta-ch2-08v.sys.comcast.net with ESMTP id hgHnebnHTvd8rhgJ4eI9GG; Fri, 02 Feb 2018 18:43:26 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-02v.sys.comcast.net with SMTP id hgJ3eNtlwtbS7hgJ3eNxZm; Fri, 02 Feb 2018 18:43:26 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 4C41111602AB; Fri, 2 Feb 2018 12:43:25 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 491C011602A5; Fri, 2 Feb 2018 12:43:25 -0600 (CST) Date: Fri, 2 Feb 2018 12:43:25 -0600 (CST) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Igor Stoppa cc: jglisse@redhat.com, keescook@chromium.org, mhocko@kernel.org, labbott@redhat.com, hch@infradead.org, willy@infradead.org, linux-security-module@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [PATCH 3/6] struct page: add field for vm_struct In-Reply-To: <48fde114-d063-cfbf-e1b6-262411fcd963@huawei.com> Message-ID: References: <20180130151446.24698-1-igor.stoppa@huawei.com> <20180130151446.24698-4-igor.stoppa@huawei.com> <48fde114-d063-cfbf-e1b6-262411fcd963@huawei.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfID9mcQf5JMNc6oCJQJ4mHhLBY4baydYAg54LAGvNcUhnye5RaU87Tp818gpsexinIDGJF916t7kLaleryOLd7kjpAxgRICfNWhcV9FvYRWf7z1lCX9P wZfVEc3xzVCoi3qyeP3fTRzmuHZ6J8tUTVEnjqlCC9N7+vKPNMC6btJSl5AqZgVKtASAvSuRsskemRU8FWgSPSSsCZMeHMnYAxiSnbTTw18KZtRSsc3MpfOV Pez5EkOHe8zZYF8dCdzFGLG1QmDozOgypFSMF+eCV6QgySl8iZYu0bnsHqmvqy1TFdKrJMyYpnEweeyONwjC5EiSkKqUV5/a6bXqS9oLn1RVY0BtHJdjQw/Z g3++ftmXvd/siqAJxNQGryE8i/2qIpfFo4riJRNSoC2c5iBVjKAB4oP/I8gnVo5PBAsSe6mJf4LKViFa/IJy9KOmbxesp8qE/bSe3QlhgfcSPhj0x1OmBaTR Hp8gH5m5CB8JbpK7hbInyda2MEWbWCSsLDMU0xOTMaN8dblAbAONIBqQDwE= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Feb 2018, Igor Stoppa wrote: > > Would it not be better to use compound page allocations here? > > page_head(whatever) gets you the head page where you can store all sorts > > of information about the chunk of memory. > > Can you please point me to this function/macro? I don't seem to be able > to find it, at least not in 4.15 Ok its compound_head(). See also the use in the SLAB and SLUB allocator. > During hardened user copy permission check, I need to confirm if the > memory range that would be exposed to userspace is a legitimate > sub-range of a pmalloc allocation. If you save the size in the head page struct then you could do that pretty fast. > I cannot comment on your proposal because I do not know where to find > the reference you made, or maybe I do not understand what you mean :-( compund pages are higher order pages that are handled as a single page by the VM. See https://lwn.net/Articles/619514/