Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6107085rwl; Tue, 4 Apr 2023 07:59:37 -0700 (PDT) X-Google-Smtp-Source: AKy350YMSyNEIR/GW7S+tQm9k+hvnbhTRpSCPIcd6CfpdSWLAHZ0Exc1IzAx7PsElxlI5SlrlsR2 X-Received: by 2002:aa7:cb4f:0:b0:4fa:e8f3:9685 with SMTP id w15-20020aa7cb4f000000b004fae8f39685mr2610072edt.28.1680620377047; Tue, 04 Apr 2023 07:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680620377; cv=none; d=google.com; s=arc-20160816; b=PY9EPL/pjt4wgAwPuBnPthSGowhL7jBxff4l6oI94W39zAZiPY43umr2GLIMEQmZ5Q Nq8zxaMfbdG1mCOu08JuwsWZenx+6fXy39vFaaMCHb1X7IeFVWGX1zyO+xDWYH/hFrv4 /gE+iq0Aoxp6tY7/ntD7gBswDILecqhZVUOiE2c1yC5oOfZFxyrLRjb9DD3Tempnrglf pYfVqL6c3RcfWOiF0KzOeu8vyep6CX0qAl1TUir4RKWeBpdw9+CVeAOXEKLWI5fXT+5m h9ky7fIEe6svHBdY8w5/ZLHSqvet2+zjq0KrmQiLhlolIb3zcP17HnJsrBtGSLZvmu8b PbFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2wyXRFn15U7YuTtccu17S72kQxdrsvbnQJV5citpTBw=; b=TVACSV+IYwZ7UOaJmFP04RhpvdCPWoBqse3PUZ7rgrqnLHMkIXI0x2QLoRP105LLNi Zca4juHTgu5jlgaMohar9ZcojLWtFcsrpE1CcStAnnzwJXoaRiMpT2LAFRH7NzvrUhaz /Ntt0r4r0P46yKt5tjbbjsj4ffe9h2DN+n5jLBfuSqO+hmffgeeErn/6gWmK43eR896m olleH2V3j6SN7VgPMeVi0JBDlhf2Fn3E0xnczCijVRUVo6M1N0sogHAJJ7ikfrJTbzge 9vH1aRkBA0sO3tl8zMetr72PI5F9XxmJtE+Fpcyj7hUdSOA06Be/e93iUdhDMyy+IfJF KFiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f9rMXOWx; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u23-20020aa7d897000000b00501df17fe9fsi1577702edq.78.2023.04.04.07.59.12; Tue, 04 Apr 2023 07:59:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f9rMXOWx; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235496AbjDDO5f (ORCPT + 99 others); Tue, 4 Apr 2023 10:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233000AbjDDO4u (ORCPT ); Tue, 4 Apr 2023 10:56:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ED6A49D4 for ; Tue, 4 Apr 2023 07:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680620158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2wyXRFn15U7YuTtccu17S72kQxdrsvbnQJV5citpTBw=; b=f9rMXOWxDNdUIdaQPJxskMpRHn4rHA4effDRVSxw5JqaJsTzZeh8LcunplFQYKjeULRSn6 8Zl3oVGyx7+D+Y9U1bnE+OB0z7n85uKG6W9oSJjfHEJDNjQ4UuNTcZsLY/6RoBwAbqXcHG 1lODMnl891BqZYpkGIjHJ7otVvEmXRQ= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-296-8RJGVCp9OpaVLqBuCaf-TQ-1; Tue, 04 Apr 2023 10:55:57 -0400 X-MC-Unique: 8RJGVCp9OpaVLqBuCaf-TQ-1 Received: by mail-qt1-f197.google.com with SMTP id m7-20020a05622a118700b003e4e203bc30so19945965qtk.7 for ; Tue, 04 Apr 2023 07:55:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680620156; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2wyXRFn15U7YuTtccu17S72kQxdrsvbnQJV5citpTBw=; b=FQTZnZj5TUxF6q2ZA+83GVLTMEKdfYhq0F2kCYkhRx6NkEHI/ILe0o4yTDPeAxpG2H DCGVHm43bbblWVTZehgYYT+r/0kxDcdTaIHu1E8CKIKZbvIlzAmVNQ1UJWcABOUy7GzY Du8cFC0Br/jowrx4o4Ri5YSHF3qZA7AfLcHrRFXVTEDBrV9r5OyqChB1NN+PQRxpp/mq g+C51Gj1WlCbWaOdUevxtdiwRLz/Rh98GUtAg6ATjES1Puk/jvSHem6cEAcBAqJ9M1ba 4P+/6Oj6rDOBuribd5QutuEWhuh1uFnjAHwLSCqU8aLvK1PIYC4skZSxkspIQ+2MapIi EG/g== X-Gm-Message-State: AAQBX9eu70OOUX33p213YI3rUZ8/wbMqPu9K3i7LtysuFc3X9APIFQoz egqI7CG6ut04wBr4iGi1z/QpNXSkMKtv6xoReoRSNqCpBSvFA4XqdUTIS1sX1/Z6ECakNy4/Od8 YWi8iNcJCU94s+dN0Eyxg X-Received: by 2002:a05:6214:202b:b0:57e:67c2:b9cd with SMTP id 11-20020a056214202b00b0057e67c2b9cdmr4447874qvf.27.1680620156127; Tue, 04 Apr 2023 07:55:56 -0700 (PDT) X-Received: by 2002:a05:6214:202b:b0:57e:67c2:b9cd with SMTP id 11-20020a056214202b00b0057e67c2b9cdmr4447836qvf.27.1680620155884; Tue, 04 Apr 2023 07:55:55 -0700 (PDT) Received: from aalbersh.remote.csb ([109.183.6.197]) by smtp.gmail.com with ESMTPSA id j4-20020ac86644000000b003e6387431dcsm3296539qtp.7.2023.04.04.07.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 07:55:55 -0700 (PDT) From: Andrey Albershteyn To: djwong@kernel.org, dchinner@redhat.com, ebiggers@kernel.org, hch@infradead.org, linux-xfs@vger.kernel.org, fsverity@lists.linux.dev Cc: rpeterso@redhat.com, agruenba@redhat.com, xiang@kernel.org, chao@kernel.org, damien.lemoal@opensource.wdc.com, jth@kernel.org, linux-erofs@lists.ozlabs.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, Andrey Albershteyn Subject: [PATCH v2 22/23] xfs: add fs-verity ioctls Date: Tue, 4 Apr 2023 16:53:18 +0200 Message-Id: <20230404145319.2057051-23-aalbersh@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230404145319.2057051-1-aalbersh@redhat.com> References: <20230404145319.2057051-1-aalbersh@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Add fs-verity ioctls to enable, dump metadata (descriptor and Merkle tree pages) and obtain file's digest. Signed-off-by: Andrey Albershteyn --- fs/xfs/xfs_ioctl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 3d6d680b6cf3..ffa04f0aed4a 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -42,6 +42,7 @@ #include #include #include +#include /* * xfs_find_handle maps from userspace xfs_fsop_handlereq structure to @@ -2154,6 +2155,22 @@ xfs_file_ioctl( return error; } + case FS_IOC_ENABLE_VERITY: + if (!xfs_has_verity(mp)) + return -EOPNOTSUPP; + return fsverity_ioctl_enable(filp, (const void __user *)arg); + + case FS_IOC_MEASURE_VERITY: + if (!xfs_has_verity(mp)) + return -EOPNOTSUPP; + return fsverity_ioctl_measure(filp, (void __user *)arg); + + case FS_IOC_READ_VERITY_METADATA: + if (!xfs_has_verity(mp)) + return -EOPNOTSUPP; + return fsverity_ioctl_read_metadata(filp, + (const void __user *)arg); + default: return -ENOTTY; } -- 2.38.4