From patchwork Wed Mar 28 18:15:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10313807 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 523E0605B4 for ; Wed, 28 Mar 2018 18:15:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4370B29B43 for ; Wed, 28 Mar 2018 18:15:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3815129B64; Wed, 28 Mar 2018 18:15:21 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, 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 9A7E329B43 for ; Wed, 28 Mar 2018 18:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbeC1SPT (ORCPT ); Wed, 28 Mar 2018 14:15:19 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:46238 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753249AbeC1SPP (ORCPT ); Wed, 28 Mar 2018 14:15:15 -0400 Received: by mail-pg0-f66.google.com with SMTP id t12so1278381pgp.13 for ; Wed, 28 Mar 2018 11:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=v/QeiV+Pw6WADvBF4AXhV8DbjTUr75XbWQX/4v5uI7c=; b=vAf8EfSkoTfDB7UQlr6R2+0Ai6AsT5AHHvg20BiRD/5l/reVc4teVxJIRQxaRyjZSe jlgL5g/onf8NbMIonlejE/WzZAUZGgvzeZYSbnBqoLVvVZeq3u8K+91ZGCJtFSPD38ah JjyejzUf4xd8bmEYmi07kA2bbFgiES8ro/krJMN5JXpOxe/eXh1Yd/RjlN1ZC+VMZQcw QoA2IdPhTfR1t6B6gc9gPJ7qLjnPWYBpiO/POc/kKDK/Kyp1cez+Grh5Ld5Txtm+dRPH aL14S1iQkRgGx3jDM0q6ZH3GcqBWbruL2vm9etk93XoGJSI92xMPOmpvJt/aSVFsx6ZM 6p+w== 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; bh=v/QeiV+Pw6WADvBF4AXhV8DbjTUr75XbWQX/4v5uI7c=; b=DRYn5bCoOYATa8PjR5p3gDUb6OMzmbD+ZTQkbh0nw+/32BFJBmvujLNT6tEMfPa5F7 yuY4mDd6QerRWxE/YZOuFA1V4iECXqeGdbAfpGMJ0Muy3HG5d/oROL2/wmRq1yitEeYZ Q6s9Oy7r1lqUqbgblBl58rF4AmDErMF3d/+7SjAUHH9soPgtHgl/2kkP6txdfjpjfTco s5A5U/FF1WWggaqarQ6Tm60qVIiKE9ncFStKPWU8jWK2q9ymF6aoI+txhJYDoDq5O9qc lLrWrxmetEIvu3u+pI2L1d5RJd9AtE7LyAk4VU3LSx6yV+cDBZSZ1AvT+v83hcS9ybce jvDQ== X-Gm-Message-State: AElRT7Gtv/WMj5vvOCbtk4Eq+C+2MK2FmKLvr2dfo6lkghskZDFlIC7G ol/WZvvvHR8tT4OEUe1Wxb8BuynSSG2T9Ww08z5slUUMrYfaUAwKjMwOTsQwtTSeLZBdLjbPOn8 EoddUFTxILGBaxthC X-Google-Smtp-Source: AIpwx4+xLIRj4hgwAQo5BGzi0VV8+epXs7c8LQiuTOeUkfsjk+VNIwH+W/NxZ7IlEH4AQQ/7l+9yig== X-Received: by 10.98.236.86 with SMTP id k83mr3799676pfh.84.1522260915162; Wed, 28 Mar 2018 11:15:15 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id d4sm5306021pgc.43.2018.03.28.11.15.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 11:15:14 -0700 (PDT) From: Eric Biggers To: linux-f2fs-devel@lists.sourceforge.net, Jaegeuk Kim , Chao Yu Cc: linux-fscrypt@vger.kernel.org, Victor Hsieh , Michael Halcrow , Theodore Ts'o , Eric Biggers Subject: [PATCH] f2fs: reserve bits for fs-verity Date: Wed, 28 Mar 2018 11:15:09 -0700 Message-Id: <20180328181509.199870-1-ebiggers@google.com> X-Mailer: git-send-email 2.17.0.rc1.321.gba9d0f2565-goog X-ccpol: medium 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 Reserve an F2FS feature flag and inode flag for fs-verity. This is an in-development feature that is planned be discussed at LSF/MM 2018 [1]. It will provide file-based integrity and authenticity for read-only files. Most code will be in a filesystem-independent module, with smaller changes needed to individual filesystems that opt-in to supporting the feature. An early prototype supporting F2FS is available [2]. Reserving the F2FS on-disk bits for fs-verity will prevent users of the prototype from conflicting with other new F2FS features. Note that we're reserving the inode flag in f2fs_inode.i_advise, which isn't really appropriate since it's not a hint or advice. But ->i_advise is already being used to hold the 'encrypt' flag; and F2FS's ->i_flags uses the generic FS_* values, so it seems ->i_flags can't be used for an F2FS-specific flag without additional work to remove the assumption that ->i_flags uses the generic flags namespace. [1] https://marc.info/?l=linux-fsdevel&m=151690752225644 [2] https://git.kernel.org/pub/scm/linux/kernel/git/mhalcrow/linux.git/log/?h=fs-verity-dev Signed-off-by: Eric Biggers --- fs/f2fs/f2fs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index ae69dc358401..96d7809c4541 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -146,6 +146,7 @@ struct f2fs_mount_info { #define F2FS_FEATURE_QUOTA_INO 0x0080 #define F2FS_FEATURE_INODE_CRTIME 0x0100 #define F2FS_FEATURE_LOST_FOUND 0x0200 +#define F2FS_FEATURE_VERITY 0x0400 /* reserved */ #define F2FS_HAS_FEATURE(sb, mask) \ ((F2FS_SB(sb)->raw_super->feature & cpu_to_le32(mask)) != 0) @@ -598,6 +599,7 @@ enum { #define FADVISE_ENC_NAME_BIT 0x08 #define FADVISE_KEEP_SIZE_BIT 0x10 #define FADVISE_HOT_BIT 0x20 +#define FADVISE_VERITY_BIT 0x40 /* reserved */ #define file_is_cold(inode) is_file(inode, FADVISE_COLD_BIT) #define file_wrong_pino(inode) is_file(inode, FADVISE_LOST_PINO_BIT)