From patchwork Mon Oct 23 21:40:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10023197 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 9AD37603D7 for ; Mon, 23 Oct 2017 21:43:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B70B28932 for ; Mon, 23 Oct 2017 21:43:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8069928938; Mon, 23 Oct 2017 21:43:07 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2996128921 for ; Mon, 23 Oct 2017 21:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932264AbdJWVnF (ORCPT ); Mon, 23 Oct 2017 17:43:05 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:53682 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932230AbdJWVmj (ORCPT ); Mon, 23 Oct 2017 17:42:39 -0400 Received: by mail-io0-f194.google.com with SMTP id 189so21720447iow.10; Mon, 23 Oct 2017 14:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3Yfs/8DKKdrc1dp/8fpKhalhfGjGCXihEUBk0IQ0evE=; b=ghlbmXXMFNKK2OeKK/bzMJgUsAkaXoq1wMkMXlFJDOvvYcMtA2Vb7XGDnfPo8OsjxJ 0iv8jAxJWQsll3arUb6se1Po7pv0yYI0TX9gCzaaKq2ClK5ymFvgfRY/GW6kcqb3g/Y/ xCJ30UgQYZDBYy0NNmbkMKjPm5zmdRIe6vVMPhXq57S5TgePt/6iF5djb2cT69Dtg9xy kfAFaBEV0OaaWvfOQNU6mQWHfCzsV4nX5jJm+obShqv+UEYlLr1uqmk6ZRf6ezqX9h/F U90783EdWzMmp6RB2nKLT0rBYTuDmocSXNGzvaBzLpbgsoQzjkSxTlwOtRRfkP/iL3jZ e1BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3Yfs/8DKKdrc1dp/8fpKhalhfGjGCXihEUBk0IQ0evE=; b=I/EK1PlLqsVnTlGvCgi4XYLnqSsJPGB3GwsZfTSwR2Dt/xSOgtM8xFrFFwqLn0JjT8 QvZ7cqbnr99DpLzN7yvh+WZldQx0d11DQPiyr7AfBQ8V5V97vdt5xCbvTW9+LgYutX5c aiH4iPdjF9REo/9P7uSneQjSVZoirQttwCwfJFiVcjE9FZ+h7xl2SwcoGV6RGUZvfPCt vaFy3RIu6vM/cP5ZXvLlv9qgg6Dh6FqEjqGq22fzaj7iQhcgxkcFqjqZ3KpPv0Wxk6A2 0aPteQ7STlCT4ZMgZ37sHfZEY1jha0OAniM70iXsbj7vcgK/TPbLrb6PgRyKIJkJJ+7k /PwQ== X-Gm-Message-State: AMCzsaVD/LqFWDVN7knAiUrzro01qvV3Cwqi804PRdInCLnOroNK+bnA NItPHPZJNKAAskDdAd19mu4qOfxf X-Google-Smtp-Source: ABhQp+Sf8Lydz7qTkbbn0sYc4Q4QmZ0Ai9NicxevcMM9xRJS+CAKJNchh+zsl7lFdBmQ8TOK7Cfedg== X-Received: by 10.107.37.143 with SMTP id l137mr18420094iol.104.1508794958837; Mon, 23 Oct 2017 14:42:38 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.175.88]) by smtp.gmail.com with ESMTPSA id i63sm3558482ioi.68.2017.10.23.14.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Oct 2017 14:42:38 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-api@vger.kernel.org, keyrings@vger.kernel.org, "Theodore Y . Ts'o" , Jaegeuk Kim , Gwendal Grignou , Ryo Hashimoto , Sarthak Kukreti , Nick Desaulniers , Michael Halcrow , Eric Biggers Subject: [RFC PATCH 22/25] ext4 crypto: wire up FS_IOC_GET_ENCRYPTION_POLICY_EX Date: Mon, 23 Oct 2017 14:40:55 -0700 Message-Id: <20171023214058.128121-23-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.0.rc0.271.g36b669edcc-goog In-Reply-To: <20171023214058.128121-1-ebiggers3@gmail.com> References: <20171023214058.128121-1-ebiggers3@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers FS_IOC_GET_ENCRYPTION_POLICY_EX allows filesystem encryption users to retrieve the encryption policy for files and directories that use a v2 encryption policy. Unlike the original FS_IOC_GET_ENCRYPTION_POLICY, FS_IOC_GET_ENCRYPTION_POLICY_EX is also extensible to new versions of the policy struct that may be added in the future. Signed-off-by: Eric Biggers --- fs/ext4/ioctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index b8a6765a556f..954042f311dc 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -978,6 +978,9 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) case EXT4_IOC_GET_ENCRYPTION_POLICY: return fscrypt_ioctl_get_policy(filp, (void __user *)arg); + case FS_IOC_GET_ENCRYPTION_POLICY_EX: + return fscrypt_ioctl_get_policy_ex(filp, (void __user *)arg); + case FS_IOC_ADD_ENCRYPTION_KEY: if (!ext4_has_feature_encrypt(sb)) return -EOPNOTSUPP; @@ -1117,6 +1120,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case EXT4_IOC_SET_ENCRYPTION_POLICY: case EXT4_IOC_GET_ENCRYPTION_PWSALT: case EXT4_IOC_GET_ENCRYPTION_POLICY: + case FS_IOC_GET_ENCRYPTION_POLICY_EX: case FS_IOC_ADD_ENCRYPTION_KEY: case FS_IOC_REMOVE_ENCRYPTION_KEY: case FS_IOC_GET_ENCRYPTION_KEY_STATUS: