Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp25461ybx; Tue, 29 Oct 2019 13:45:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGJUg5LBKCNwNAZqWz4toa98G/+i80nteQLgTCClWXTtP+vJFbJ/yBf+ZqQzyUm/h7jMQZ X-Received: by 2002:a50:b966:: with SMTP id m93mr27490194ede.228.1572381936467; Tue, 29 Oct 2019 13:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572381936; cv=none; d=google.com; s=arc-20160816; b=Mvpjr71H1lSsfFPJaqDwDDcidipp7v2W2fIhIkgoL0ywJurJhnkowBWTGPGmk83od8 I+u+nE82TpAJJapmzd2+SGHRzNTnK4bjjZbNpD6sccP8WLsptglpSiRC/gIsPPH7ZjCg aq67GPKd1dPqDRMiowBiH2yzAhWnqbAz8Aby2UXa1EMBD7vlNPjCODyWO71rOIniyFgW 6KugAZhXc1BKyBhtn7BmrL/H/QF4iqQqOHKrVcDvs17JQmQRD7X9/7mb81uWxVRQJIHa MP/jdMYrrr4LJf9kntKUec19fMCx1wy5NMEHFhZ+8WPyRKFadEv6n5VO1Qa6sFw0kHjE KeYA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H99sQMG7es/EvE8xYo7i/A1BavLKhqiOXiXHNzdeh34=; b=T9mFoOjFiZQaAnquKaMln/DAPpMTF54FBX9XIWpm8Q8YZ2h1elNroODwGvW6nxhBSY D8wa3PR+OdxIroejQqu5/fqxiD2QlBfjCV9cFJDk63c5x+RKosGvpcrnV2yyrS/kN4z9 G6fqrwa62c2LToMr+pFhmqHOh9GuaGGLQqCVGAMOOUIk/a13MfSmGcF/QKg/T7/5J1Kd 9pXRFNGQQHkjDOn6yAoUAsdaMbkrE0QEBQSHtBxyr0mTOVK2wg/Q6s+mEE/suCfBxFj0 NeGjUAU9hpGQ60QiNq4I7yhLl3ZfdUNCtXH5u/plBps34mC3tibrWuNR6ZQ6olaBAjY8 9QmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rd7PXg6z; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si11612787edm.231.2019.10.29.13.45.11; Tue, 29 Oct 2019 13:45:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rd7PXg6z; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727567AbfJ2Un4 (ORCPT + 99 others); Tue, 29 Oct 2019 16:43:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:34740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbfJ2Un4 (ORCPT ); Tue, 29 Oct 2019 16:43:56 -0400 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27ABC21721; Tue, 29 Oct 2019 20:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572381835; bh=bA1Nt9TWZvija+pWQm/jvZD5pLPHccs35Yz1RfF2GZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rd7PXg6zwRW6AzBcDukG70kVXPnDFY/Yp1M1Yi465IxdRteBn/mWEGk2RcSAX0bx9 zel1es+30DpGpOmI1ko07QXwQLI0WJLYWrVJ486au+twTpg7V/PgIwyKBDURx3jDP4 2oMAidPnxs9Tw9ec8wOtrlajmDWE6C9PK+eKYyUs= 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-api@vger.kernel.org, David Howells , Theodore Ts'o , Jaegeuk Kim , Victor Hsieh Subject: [PATCH 1/4] statx: define STATX_ATTR_VERITY Date: Tue, 29 Oct 2019 13:41:38 -0700 Message-Id: <20191029204141.145309-2-ebiggers@kernel.org> X-Mailer: git-send-email 2.24.0.rc1.363.gb1bccd3e3d-goog In-Reply-To: <20191029204141.145309-1-ebiggers@kernel.org> References: <20191029204141.145309-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Eric Biggers Add a statx attribute bit STATX_ATTR_VERITY which will be set if the file has fs-verity enabled. This is the statx() equivalent of FS_VERITY_FL which is returned by FS_IOC_GETFLAGS. This is useful because it allows applications to check whether a file is a verity file without opening it. Opening a verity file can be expensive because the fsverity_info is set up on open, which involves parsing metadata and optionally verifying a cryptographic signature. This is analogous to how various other bits are exposed through both FS_IOC_GETFLAGS and statx(), e.g. the encrypt bit. Signed-off-by: Eric Biggers --- include/linux/stat.h | 3 ++- include/uapi/linux/stat.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/stat.h b/include/linux/stat.h index 765573dc17d659..528c4baad09146 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -33,7 +33,8 @@ struct kstat { STATX_ATTR_IMMUTABLE | \ STATX_ATTR_APPEND | \ STATX_ATTR_NODUMP | \ - STATX_ATTR_ENCRYPTED \ + STATX_ATTR_ENCRYPTED | \ + STATX_ATTR_VERITY \ )/* Attrs corresponding to FS_*_FL flags */ u64 ino; dev_t dev; diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h index 7b35e98d3c58b1..ad80a5c885d598 100644 --- a/include/uapi/linux/stat.h +++ b/include/uapi/linux/stat.h @@ -167,8 +167,8 @@ struct statx { #define STATX_ATTR_APPEND 0x00000020 /* [I] File is append-only */ #define STATX_ATTR_NODUMP 0x00000040 /* [I] File is not to be dumped */ #define STATX_ATTR_ENCRYPTED 0x00000800 /* [I] File requires key to decrypt in fs */ - #define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */ +#define STATX_ATTR_VERITY 0x00100000 /* [I] Verity protected file */ #endif /* _UAPI_LINUX_STAT_H */ -- 2.24.0.rc1.363.gb1bccd3e3d-goog