Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp637917imm; Thu, 31 May 2018 06:57:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLspTw5OqbLqbLLsVRivZADt/szakvVDkEknHTcxO7ZqrgQK9clnWz7hn0lRHMyWT51gN5i X-Received: by 2002:a17:902:8:: with SMTP id 8-v6mr6985733pla.287.1527775035487; Thu, 31 May 2018 06:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527775035; cv=none; d=google.com; s=arc-20160816; b=MaBTrphAANjMaMYBQKjEI3vqCuWjKu7reiCXRM5Mgzo3Ps9LC4fC8VNg3yfkMZ/WW6 IfF63W6XXZvEF53suQa4anvL+rUYYFEI69aNU7seKhs0buGnHWGNbJXksRfsxG4iNQre hq/Z0/K8icOl4GH/Y3syZfL/WPoKefERJ8pWZaHK7PB1NncRNp5ew/tgy0Z8FddsLVSO e91lublcBlCT12aPA3AicxHEWTEn0Ns6/VxC9IylcDFpQKqhOioyKTiEfaf7+fUEFwMB m+sjFAPvxQuEvrxm28byfnXxbJfx7T7zFg+ttdJ1Xg4U1MHhHj3vb2h0fhFxIpLqN3nH 8yMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4+ITJptajYUQX7YX7pI1lutm9nzT+eJbVb6Wl+2JYS8=; b=kWpSh1eWMMn5+qIDVM4MnBeLC+rNhJ1Ff5cBAgW7zwWz9YzxC5iWCvCbSOrMwfzuDg XxROcijgwKDpKzTvOxjU5e9M/F5vKvZdCxRPdrazMxpuKCBmp0t9exUp/HeFXdS+YnZF F8GQyOubh2Lr2VbTiA+/W488NnyNe+Sl7ydCVuhiWMsjuAJSLi0TQxMZq9H5Iq6K/0cc 7KSPitd2Qkak4n2HW0oyFBwLJ/tEnR+YJCCRBsMq/3to8bBckzsPeUmROCznD7LNL0ic JDX8MjcH4DY9XWpHs4+rToz2NVTYds1/J7Id2yTfiJyoe0qKyNpqTj2dGIvK+8YRMiNU lHqA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o73-v6si37389303pfg.327.2018.05.31.06.57.01; Thu, 31 May 2018 06:57:15 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755398AbeEaN4K (ORCPT + 99 others); Thu, 31 May 2018 09:56:10 -0400 Received: from mga01.intel.com ([192.55.52.88]:4697 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755231AbeEaN4I (ORCPT ); Thu, 31 May 2018 09:56:08 -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 fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2018 06:56:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,463,1520924400"; d="scan'208";a="55457175" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 31 May 2018 06:56:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id E1996E3; Thu, 31 May 2018 16:56:05 +0300 (EEST) From: "Kirill A. Shutemov" To: Andrew Morton Cc: Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCH] mm/shmem: Zero out unused vma fields in shmem_pseudo_vma_init() Date: Thu, 31 May 2018 16:56:02 +0300 Message-Id: <20180531135602.20321-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.17.0 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 9d6c7e595415..693fb82b4b42 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.17.0