Received: by 10.223.185.116 with SMTP id b49csp2778284wrg; Mon, 5 Mar 2018 08:32:23 -0800 (PST) X-Google-Smtp-Source: AG47ELsUrAwVS6VrNLqB/+nd3xw49h/kXzqAkmCcGcQkHFHaoEjVgz9TiDwEBje8eVqDR0yBHZHF X-Received: by 10.99.126.24 with SMTP id z24mr12493952pgc.343.1520267543600; Mon, 05 Mar 2018 08:32:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520267543; cv=none; d=google.com; s=arc-20160816; b=FwSMY5iNwox3gM5i1nExtwSDsioAuOyaoA406GezBf0RIiKsVDZSQ7cKcap9ZrkbMs 6APq0Yp7TWKadL2g8pPuPeT2WYb2hihX7K7A+WHL2mzUO20ezG4g32arirvFSlYYHhS4 FdtZi8hg6wUA08LbmXQjxogkXY3L6coObjqVhN2ZHGMS/5LL55ZXoiUlIyQ0Y+EZ4Tfp O+I4ZXut+hDCiGeH8a2HhPB1A9LtKTpCBQihbkQSaCc62b86rzAt+d9MbmBbiu0//TtN rcpuN/UpUska5Epms9xs0xJdytYgmbY0f9ePdZjoalWxFdHpI8obVrBNMTeea9kX44Va yhsw== 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=1pVDuuqL2/+fN31N/Ax0d9YR7sCw745TzyzURFDrAXM=; b=hjcb1vZ4poKugCOpmVpCwxcxX0FruocgOoXMcv0XtV5m8h4zsEY1pnIQ5HgDsuxx63 ALSRLf/ljduW1vVv48057v+B3dqUm1avVR/iZ0ZIQRGlTkWjskhPpO/vcmfAqXd545pg +39hc2kQnoPy/dnrCcicymEyA6g62b1GKP+g8pznmIYD2K8s3KUoVxFzFpR+w0x8N28G VWBCRV3I6OE6iC/Kw6ArrcZHxAsF5EuV4aRSUHMKDq24tYnOgMyHcuB36BYtQVley87s eRbykW8JORtRkNF0zeQD53UkPRqiW/Ni7kPdH1Z1IS0bmCg+b2UNDz6XN/8THPRpVRlB V6GA== 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 h19si8520393pgn.310.2018.03.05.08.32.09; Mon, 05 Mar 2018 08:32:23 -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 S1753092AbeCEQaO (ORCPT + 99 others); Mon, 5 Mar 2018 11:30:14 -0500 Received: from mga04.intel.com ([192.55.52.120]:44464 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbeCEQ02 (ORCPT ); Mon, 5 Mar 2018 11:26:28 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 08:26:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,427,1515484800"; d="scan'208";a="32528724" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 05 Mar 2018 08:26:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 58D7A4C9; Mon, 5 Mar 2018 18:26:20 +0200 (EET) 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: [RFC, PATCH 10/22] mm/shmem: Zero out unused vma fields in shmem_pseudo_vma_init() Date: Mon, 5 Mar 2018 19:25:58 +0300 Message-Id: <20180305162610.37510-11-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180305162610.37510-1-kirill.shutemov@linux.intel.com> References: <20180305162610.37510-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 1907688b75ee..e0e87b6aad26 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1395,10 +1395,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.1