[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180531155256.a5f557c9e620a6d7e85e4ca1@linux-foundation.org>
Date: Thu, 31 May 2018 15:52:56 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: Hugh Dickins <hughd@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/shmem: Zero out unused vma fields in
shmem_pseudo_vma_init()
On Thu, 31 May 2018 16:56:02 +0300 "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com> 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);
> }
Powered by blists - more mailing lists