Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1117678imm; Thu, 31 May 2018 15:55:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKINfy9aE8GzNAAN8LynyEuldzoHv5kXSL2YsDaxIfNU1cDh/nRQ0DONREI+PobhFsnjWpK8 X-Received: by 2002:a17:902:9a08:: with SMTP id v8-v6mr8649810plp.148.1527807318005; Thu, 31 May 2018 15:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527807317; cv=none; d=google.com; s=arc-20160816; b=o8F7zSU7ru8+8XTcRI75alaDDEYMLvc1kE7Y9u1FE0AJgmwg/wXrVxzTiw3ujIpebV 7Z5e0NvW8ym9OyHJX3iAOS9tKU9L+ktqQP4P6yvg5FBR31p8b5g93toCKwOF70xp6z5j xkSGFwO+Sp2p/erjhR9cUx0kdSu9w/w9Rd0DuIR1b+rg274BqUI/GW0b3b7ilDeWHeQL k2Bg9hevPMbXEnRj3m38rJJZS86X7HPVPp81ssN2vVdZgWDX40IJwvy0CIzgx7lpX6AA vaWQtv7gmWTWnA9IBt5XLX2VRN35m37ppkKjLBQRf66RJiq1RvPu5hoYmswxQkdK9ZJu st8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=JikjqG8Kf+iLPvYHzxoEBneuikNh4VUFurTKzo5ofW8=; b=Ws9KDCHNhnLeM/pUUufF+DrrOmx3s9DVYA97LKC7Bx133NUkAX30t212emtHRuY6iZ wOj/HjHtAC9gFGxsleUgOmMaqyZugSIafAAGn1DeBYtFcpFk9+wEqzjyvA6Z4Es3fOoj jmzw8nJRjXr8myMDPFlxxZnggFukEkIbkTYhbfJZlBDKZI31GeME3d2hLk/5GINaPEQ1 zKiPpNXt0SOkOIJ+cNtjlL43QIf3H+h5xhNybktTfNBIJ023YUj7z+kIWiKN59EmPusQ 6YpgtZpGRlOXeAvhmLWKzsM+dafiy0jwJ3VNb2WjmJjYgZaewG2+mQolTCy2QbJ55cRC 4cRA== 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 f20-v6si15069653pgn.464.2018.05.31.15.55.03; Thu, 31 May 2018 15:55:17 -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 S1751479AbeEaWw7 (ORCPT + 99 others); Thu, 31 May 2018 18:52:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59854 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbeEaWw6 (ORCPT ); Thu, 31 May 2018 18:52:58 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8AF97E88; Thu, 31 May 2018 22:52:57 +0000 (UTC) Date: Thu, 31 May 2018 15:52:56 -0700 From: Andrew Morton To: "Kirill A. Shutemov" Cc: Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/shmem: Zero out unused vma fields in shmem_pseudo_vma_init() Message-Id: <20180531155256.a5f557c9e620a6d7e85e4ca1@linux-foundation.org> In-Reply-To: <20180531135602.20321-1-kirill.shutemov@linux.intel.com> References: <20180531135602.20321-1-kirill.shutemov@linux.intel.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 31 May 2018 16:56:02 +0300 "Kirill A. Shutemov" wrote: > 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. > So there are no known problems in the current mainline kernel? > --- 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); > }