Received: by 10.223.164.202 with SMTP id h10csp770308wrb; Tue, 7 Nov 2017 14:22:33 -0800 (PST) X-Google-Smtp-Source: ABhQp+S4jwsFfX5q6yR+HMVRi5weyHwWXXqbvUAfuLfxpfUmYcDF6TEaxEBscIsOsCRehwXHRSTY X-Received: by 10.99.125.89 with SMTP id m25mr221472pgn.1.1510093353583; Tue, 07 Nov 2017 14:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510093353; cv=none; d=google.com; s=arc-20160816; b=qiw5Ey4laT7rSzMiuZMdODAGMZkbRdPB2/OxwzpHrhz5qqfWzN8TDtf9/yEfT2ftFs LgGECHuPBHAvx+/7ZYMiZVyZPW47hB7tIz3InmJQ06VtOeIe9/8YRWZipzxkkVFxrE9Y 0IfUDU1F6nbbAp0B35c3l6h7+yGQBYo92uDwkd3nmdiJbCdMMsA5/3OMuDLwtIfbQ+qP 5IMwgQJGPTbH4mhO3RXqThUgBKqZ/IRvfEaUG3cnSmdq4T6o5C0umhlR5Iml63sgFPhg tPp8dEnYkU6DHSXJil7F/fWeAda8CR0fm62bpL8I9NNN1ZO0KildebWpueGjaBQd7Vvd elVw== 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 :message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=yR8kpKDBPbtxFu4Zye5x5cc+ek6e9aSWuZ4wlAFPxM4=; b=P9mxivMwAq1z1ruOfwS5XGZxua1Z7KmpO89zMuWnI6TTV+dHh4dASl7b/t4AhCIzUy iv6RWgZf2UMH6maCeOl+5Tl4qBhPuWsvuTkW5ZadMhN1cEZVaOXtBkA4NqUTPUaneCJ2 Xf3luEdLHOMVpA/ppbJaW7F4Oh+4aWVPSyWnwFMnVTOuwkep+JiF6C9B2coWj69yfRZu ygKwLMZoUIcjA3aGq1xAc8azV1c12DX8Oko6RTFQssl6YNek9egrV1jtOosSeaRc4HDd KoMNs3clVxz2xsY+8BHqJgUwGIFza+mRTEfxpZA5+hKz50X7fTTrthD6yvKpse3n1OMZ Zqbg== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21si130143pfe.291.2017.11.07.14.22.19; Tue, 07 Nov 2017 14:22:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754662AbdKGM2H (ORCPT + 91 others); Tue, 7 Nov 2017 07:28:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42152 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752545AbdKGM2F (ORCPT ); Tue, 7 Nov 2017 07:28:05 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 67F56C058ED4; Tue, 7 Nov 2017 12:28:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 67F56C058ED4 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com Received: from localhost (ovpn-112-38.ams2.redhat.com [10.36.112.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7182260C90; Tue, 7 Nov 2017 12:28:02 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: aarcange@redhat.com, hughd@google.com, nyc@holomorphy.com, mike.kravetz@oracle.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v3 0/9] memfd: add sealing to hugetlb-backed memory Date: Tue, 7 Nov 2017 13:27:51 +0100 Message-Id: <20171107122800.25517-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 07 Nov 2017 12:28:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Recently, Mike Kravetz added hugetlbfs support to memfd. However, he didn't add sealing support. One of the reasons to use memfd is to have shared memory sealing when doing IPC or sharing memory with another process with some extra safety. qemu uses shared memory & hugetables with vhost-user (used by dpdk), so it is reasonable to use memfd now instead for convenience and security reasons. Thanks! v3: - do remaining MFD_DEF_SIZE/mfd_def_size substitutions - fix missing unistd.h include in common.c - tweaked a bit commit message prefixes - added reviewed-by tags v2: - add "memfd-hugetlb:" prefix in memfd-test - run fuse test on hugetlb backend memory - rename function memfd_file_get_seals() -> memfd_file_seals_ptr() - update commit messages - added reviewed-by tags RFC->v1: - split rfc patch, after early review feedback - added patch for memfd-test changes - fix build with hugetlbfs disabled - small code and commit messages improvements Marc-André Lureau (9): shmem: unexport shmem_add_seals()/shmem_get_seals() shmem: rename functions that are memfd-related hugetlb: expose hugetlbfs_inode_info in header hugetlb: implement memfd sealing shmem: add sealing support to hugetlb-backed memfd memfd-test: test hugetlbfs sealing memfd-test: add 'memfd-hugetlb:' prefix when testing hugetlbfs memfd-test: move common code to a shared unit memfd-test: run fuse test on hugetlb backend memory fs/fcntl.c | 2 +- fs/hugetlbfs/inode.c | 39 +++-- include/linux/hugetlb.h | 11 ++ include/linux/shmem_fs.h | 6 +- mm/shmem.c | 59 ++++--- tools/testing/selftests/memfd/Makefile | 5 + tools/testing/selftests/memfd/common.c | 46 ++++++ tools/testing/selftests/memfd/common.h | 9 ++ tools/testing/selftests/memfd/fuse_test.c | 44 +++-- tools/testing/selftests/memfd/memfd_test.c | 212 ++++--------------------- tools/testing/selftests/memfd/run_fuse_test.sh | 2 +- tools/testing/selftests/memfd/run_tests.sh | 1 + 12 files changed, 200 insertions(+), 236 deletions(-) create mode 100644 tools/testing/selftests/memfd/common.c create mode 100644 tools/testing/selftests/memfd/common.h -- 2.15.0.125.g8f49766d64 From 1584123369970513679@xxx Wed Nov 15 09:22:51 +0000 2017 X-GM-THRID: 1584123369970513679 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread