Received: by 10.213.65.68 with SMTP id h4csp640820imn; Wed, 28 Mar 2018 10:01:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+N9cbfkK7fXp8pzyApprm4/jddAF5X0nyjWWofsVkki2V8ox67qRqapJRYUoXdbg+QChRI X-Received: by 10.99.100.68 with SMTP id y65mr3129270pgb.257.1522256471088; Wed, 28 Mar 2018 10:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522256471; cv=none; d=google.com; s=arc-20160816; b=joEF0tIVhZaWIcQPrqi3yk9i2PMFbyY8QeWe3Cfsak1iLioyPGPgPc7oC/PMluTw48 qJVPfUO49RrJRe8AW9Ciqoe2DmX5jDtazYyMGvmismitOBJMCIwuAEQaIOb221gql+wt mjTaeZAIiWEX1U5YJ1vh8R+5SVoXUdWaIslAxxl9Ej1WKNddw1XF1oB0HtjqLGwhz4J7 k6mAdDvEvDp9GVqh+o5KbeOM6zz9i2IvASriifwb5ZteZ2d6tQzz2DkYKdP8euiXZG7r X+QVv8Xiw8wxy+SQ4td1aXhHxZf7HG+4gT3dBg46qVffT7R7wgQQBY6gLVXqOeYVejCs f6Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=5UMcVJqKhGP3aQh0MjwME1c6imvG+Y29Qd23GdxyUCU=; b=zIlXt+55jt/G8R/LFyrPEsREzPlmR4JlRZfRIwYviLYbmyR6tKe3itL1LAV41NupzP SK8mfLJZfCuxJ473gNihwRo5r8fL3MB5JFqvKVHchBPFwV+UIaIiFaLvVHnYaYcfFeAu lEzJ6UhHyzqn+tsEPyYCti+o3vX3ef2uKachmPArowHtbqojOw9lrGsMeZnOywJ+5zc4 LOuuMH8SKYP1ca511BeYSy8JvbedymG7+N9Sa0V4N5YmvOV8amzAzZaXt4Di2MruUCIb sfOWyZgBvScSK/C7UX7DzQeALzVXEGSoZOGLz88bd1peHtiH2gNFFf75hdjynMBQ8dS0 0cOA== 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 f34-v6si4094553ple.622.2018.03.28.10.00.31; Wed, 28 Mar 2018 10:01:11 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753339AbeC1Q7M (ORCPT + 99 others); Wed, 28 Mar 2018 12:59:12 -0400 Received: from mga02.intel.com ([134.134.136.20]:53107 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752161AbeC1Qzt (ORCPT ); Wed, 28 Mar 2018 12:55:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2018 09:55:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,372,1517904000"; d="scan'208";a="38891232" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 28 Mar 2018 09:55:44 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 42EFA1A8; Wed, 28 Mar 2018 19:55:43 +0300 (EEST) From: "Kirill A. Shutemov" To: Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky Cc: Dave Hansen , Kai Huang , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCHv2 03/14] mm/shmem: Zero out unused vma fields in shmem_pseudo_vma_init() Date: Wed, 28 Mar 2018 19:55:29 +0300 Message-Id: <20180328165540.648-4-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180328165540.648-1-kirill.shutemov@linux.intel.com> References: <20180328165540.648-1-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org shmem/tmpfs uses pseudo vma to allocate page with correct NUMA policy. The pseudo vma doesn't have vm_page_prot set. We are going to encode encryption KeyID in vm_page_prot. Having garbage there causes problems. Zero out all unused fields in the pseudo vma. Signed-off-by: Kirill A. Shutemov --- mm/shmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index b85919243399..387b89d9e17a 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1404,10 +1404,9 @@ static void shmem_pseudo_vma_init(struct vm_area_struct *vma, struct shmem_inode_info *info, pgoff_t index) { /* Create a pseudo vma that just contains the policy */ - vma->vm_start = 0; + memset(vma, 0, sizeof(*vma)); /* Bias interleave by inode number to distribute better across nodes */ vma->vm_pgoff = index + info->vfs_inode.i_ino; - vma->vm_ops = NULL; vma->vm_policy = mpol_shared_policy_lookup(&info->policy, index); } -- 2.16.2