From patchwork Thu May 31 13:56:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 10441155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 92C70602BF for ; Thu, 31 May 2018 13:56:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85A8529097 for ; Thu, 31 May 2018 13:56:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A7C6291D8; Thu, 31 May 2018 13:56:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FAD229097 for ; Thu, 31 May 2018 13:56:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 337B16B0008; Thu, 31 May 2018 09:56:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2E70F6B000C; Thu, 31 May 2018 09:56:10 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FD486B000E; Thu, 31 May 2018 09:56:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id CDF056B0008 for ; Thu, 31 May 2018 09:56:09 -0400 (EDT) Received: by mail-pg0-f71.google.com with SMTP id o19-v6so3336816pgn.14 for ; Thu, 31 May 2018 06:56:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=4+ITJptajYUQX7YX7pI1lutm9nzT+eJbVb6Wl+2JYS8=; b=JGfdoAxOmIQrYQR1MmTzDd6o/9XHiIwgiUN4ovJvFbuJI2WzR8LTznYlJdqg30eAL+ JGj94RHUS4rJefW5l4UK9JVBvXTnZjptYAYoJgjSFGicp/8ImLm0TQ+TRgkAgrhHWqjF kd0zxW/uC5vqOuvj8vSYmJFZCkcV2dAofKmTxw/GlXDCAa3InxhJQmod2K/beMgbN04X tYC0VHAbjC8tvQux5PCpN0F4sFT6q3+ME5GVZPOS9Fc6l1VELWB3bdZHaiMmEvI+fslC DbwayzyxHMnerHe+QYR9PCVHJjgLH26QekApf7jK8tavZ1jZ1jyOvcFVQhK0yLC7CMGm DY2A== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: ALKqPwfInGGwQRlaJmwTQAojx3shAjbGRW1ssx9kqdjL04LoQL5/ZZyu JtKN+j9gdAIJCr5Ka/TldbSOe8Xw8oyFLxdEyL0M5cxks6IQQXX6o5/xY42ZNG3XWk8vX6K0HBR 8OadHrN/wWd1w5bo1a2IYnYUbhktQ75pGsb+qmeDj0rS78xifbj/ot0V5txHN8oWipQ== X-Received: by 2002:a62:9513:: with SMTP id p19-v6mr6917486pfd.239.1527774969531; Thu, 31 May 2018 06:56:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLgBkkgW8uPwyFAwced1P9DiMAP2D2AYB/7qjmkmKIBycjIMnQi7UEbOXz4AiopDnAqkzY+ X-Received: by 2002:a62:9513:: with SMTP id p19-v6mr6917448pfd.239.1527774968706; Thu, 31 May 2018 06:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527774968; cv=none; d=google.com; s=arc-20160816; b=H8nEcWM6JrGGBAqGzKI9hNuBPy//uIhSCc5GgO63L4zvCWJOwZE/IYHS9WEznYQqMB v5dYWaPbajsG8jbQ+o0UBTm2ZZlaPhN8cUOMreWN7ml4YYDZ93pqFlxylbsBbyl7vNuP ufKpXbcXe6Apn0PcXjt3PbaPWtfLPgm3G2xtPkuLtY5JMMqiqSDRlgVCP/fQy8bYeRNO Fsr4rEBAngCiP1h0nhV0OqiQ/WUJ/JVUmaHrVXgJltRIO5j8BgB866F9cbNZ/Geq14Mg 8jiaOpC1s9Mg35D4O4tlyblGmomMtdlkLc/SPbfhWvytiy3Dz8eqWwEYx45i7mVE5rtZ r5jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=4+ITJptajYUQX7YX7pI1lutm9nzT+eJbVb6Wl+2JYS8=; b=H3goVW//rBMFnKZUt3HytUwZcKk1Bdrt7h5yfYXmEAnCABoQiKF5vt5LYUsvSKC2jv DX29AdbxzdpEXlhb/OJMQZj443aqeoR02o0zO5K+7EeYy0y3LYQOLviTM/NKF1ItoheK 6riN3uoq0ndICcqRK1CYPa+B4J7ht0IXdMkOKmT70bR2rHwMTLtc1e4Orw+JLzCDwz0P lhDCs4trjyCLpraxR1Y8letBVhN4Rb5vp/MiCC4eol5y/yzr6N8bd2vz2dd9PEki16WJ 0sCdiNrGAJqT+6aU+u0MlWEOnHn5dPIs86UGudOzl584JyPbbQFgDAwXpfPN5CZSHeA4 /dlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga18.intel.com (mga18.intel.com. [134.134.136.126]) by mx.google.com with ESMTPS id c10-v6si17914027plz.190.2018.05.31.06.56.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 06:56:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.126 as permitted sender) client-ip=134.134.136.126; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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); }