From patchwork Mon Oct 23 21:40:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10023185 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 48FB2603D7 for ; Mon, 23 Oct 2017 21:42:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AEB628938 for ; Mon, 23 Oct 2017 21:42:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FF5128932; Mon, 23 Oct 2017 21:42:55 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 D5A3828932 for ; Mon, 23 Oct 2017 21:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932281AbdJWVmy (ORCPT ); Mon, 23 Oct 2017 17:42:54 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:51258 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932246AbdJWVmm (ORCPT ); Mon, 23 Oct 2017 17:42:42 -0400 Received: by mail-io0-f196.google.com with SMTP id b186so21740274iof.8; Mon, 23 Oct 2017 14:42:41 -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=JTvI73Oj3Dl4mvmZRRODzNdflOYA5Ch8R//atESWGDc=; b=lufl455kDTyzCtOLPyb4YHNopkfC/myBB5XPQwvenbfCRaK162lbyebysjlLAzfq0v wnrWP8FFOzt+t9dpjRVLqqtn9W1zCZY44cDZwkvNmh5R8mHXmPIyf9u8W6v9p1V0hmwQ eKyDE+ioUzeOEeHBengCVzvsNYsSScTfPcQvxM1lTNQCpgpDqcRjoUsHwV4Nb0GC4G/Q gVD890OziSY+W96hPwM6FxucoDf6aJUa1eoMmiQI+ZXsYsqXvRD4tGW8WjZIo6n2ZxTM cGy+qAjA7RNl44U0di4Z3yRtyfWvO1jkWfrd0wac5mcetmJcYaDOymW0v+CobyQGqMK3 q2fA== 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=JTvI73Oj3Dl4mvmZRRODzNdflOYA5Ch8R//atESWGDc=; b=AEd2XEQ0feMV/VapRruJmiAyVXQDvU4GhJgLUcRJHmrD/d3lvpi4B/Ma1RZ4mq/oQr 7tbdXWBJRFZS8Un1rKeFvh65T+msJdyGvqaH/kgZj6rJf5ZStIKH9q3uGnFPGQ8T6YYY bEUkBrGuqad9KYvxhTlt73GJvNLyx2xRUtdLo/igtwPnthyLT0WmL1IMDlUNomOgmfEn qwNfOZF/3IjR+M4zL86u01WT4kHZW0YpCZ50QLpOYxfqSR4Lt4q9ZgY+vVHCUYDNAkVR PmxrgyteXLFecMK6A41bA4x5ZCI/Xo/2yCBgqiF5TSurh5Dsrmnqdk3nXrTA8l0eJvfC 3VDA== X-Gm-Message-State: AMCzsaWg5g6cWFH/RKLLbpiIssoZJxbfNjwgJE14WjcYV0hfyG1Hh/GE 71Brkb8FG7/YoCLZYwNEqpMtFgTR X-Google-Smtp-Source: ABhQp+ScReiKSbXswNsep7vpcXMH2OsyA/pz5ActX2y6vakq4hkK11jTeQTIlDjGsbMneLjoLf4tRA== X-Received: by 10.107.146.134 with SMTP id u128mr18327542iod.209.1508794961361; Mon, 23 Oct 2017 14:42:41 -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.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Oct 2017 14:42:40 -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 24/25] ubifs crypto: wire up FS_IOC_GET_ENCRYPTION_POLICY_EX Date: Mon, 23 Oct 2017 14:40:57 -0700 Message-Id: <20171023214058.128121-25-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-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@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/ubifs/ioctl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index 09ede2d1898f..2064c01ac864 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c @@ -197,13 +197,12 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return -EOPNOTSUPP; #endif } - case FS_IOC_GET_ENCRYPTION_POLICY: { -#ifdef CONFIG_UBIFS_FS_ENCRYPTION + + case FS_IOC_GET_ENCRYPTION_POLICY: return fscrypt_ioctl_get_policy(file, (void __user *)arg); -#else - return -EOPNOTSUPP; -#endif - } + + case FS_IOC_GET_ENCRYPTION_POLICY_EX: + return fscrypt_ioctl_get_policy_ex(file, (void __user *)arg); case FS_IOC_ADD_ENCRYPTION_KEY: return fscrypt_ioctl_add_key(file, (void __user *)arg); @@ -231,6 +230,7 @@ long ubifs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; case FS_IOC_SET_ENCRYPTION_POLICY: case FS_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: