Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp197020ybk; Tue, 12 May 2020 20:09:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzctfqDzpgefcqiiXpclHHCrKs0rHZgvGeFY7HXBwaZWpbQWyjVQvk2haQggJ0tWaLxwk2Q X-Received: by 2002:a17:906:6891:: with SMTP id n17mr8067387ejr.338.1589339363186; Tue, 12 May 2020 20:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589339363; cv=none; d=google.com; s=arc-20160816; b=NH28fPxdIMWnRiGYLybA4eWn0oEFULvlglN+RhXDbwL0W2Gw3rObERaYzbEPF8CGUG +UGzssNOGpGXNdNwYQZ76XQV0+K9jG3PcrR6IvguneH/yfk4z+D2p3o6U/1SrAm7a9H8 SQCwAJSc63v/OlnPtyoy9ceGwESNZUYYC4WM7aa1c7/EMuPQs/E0Gw0D6qR7vOqc/0A0 ZX2qsPQLn43YlG4Z46nvaKNTduy2gfP5e6nHon4j6iv2qem8VF/S5vfdDjk3t3B5XSD8 rwp4NBs3Oat22XYAA946LZWJdSd6mtIV4o2kGIfrhAr9SfGnQxFdIrahmMQrv0D5igSw yaGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PVdFjVNairqkes2ZWDUf2+D3kpmUfJlI0ZWDfJzOBJk=; b=grs8X1PPo8MzNTfV6m8INDjxzrL2zpNMLwkHnsIkLJutOKQ8Hg+sM3Qd25Hcgr6gaW gKhQhxmWt/OHWvWBhLAvojA6OeMaVHRI+0AyVTFxjoQCvbKlYn8yfcYNHMDis3TSB0gb vDIcIfaomP+Tim2tYGwPtXNybBH4X5RgrDNvxKVUarNBf/14O4i3/ycnaDppEE9iB55h IK5DkmmkeJHTMgaDi+CUL3OGvluIHrVkniz+lrj7W6vqyCSpjUM7iLtnV0RB3B8WRFBE nR885gHLoDIIuiIxRm3oKLCe8jXY7eiLqLRT16DDCU/ZtFFkSp1yxmXLeyMgVV/v26XR kuzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yoPvoPvr; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id q10si9420333eju.123.2020.05.12.20.08.49; Tue, 12 May 2020 20:09:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yoPvoPvr; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 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 S1726161AbgEMDHG (ORCPT + 99 others); Tue, 12 May 2020 23:07:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:42612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725898AbgEMDHG (ORCPT ); Tue, 12 May 2020 23:07:06 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A843D2176D; Wed, 13 May 2020 03:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589339225; bh=mf0A77JO/o1Mk6zUTHq9K+pvz3bYpz5zIclotccg+Fo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yoPvoPvrtTgr0s5g4gLXEiIOsQf1dxfj/oBrrGa+nwoA6dE2mGMBtdWeohFt+yKvn 4KlSpBlNspt1Pg1OVOViCkzUUafX+woN5Q0mQkMWH2ysQ77USKFxfJNTgDaMtkx6hS UGIOguCPrp8uo1y+tI6zLJ6p8n4VHZjG9dmJvNI0= Date: Tue, 12 May 2020 20:07:05 -0700 From: Jaegeuk Kim To: "Theodore Y. Ts'o" Cc: Eric Biggers , linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Daniel Rosenberg Subject: Re: [PATCH 2/4] fscrypt: add fscrypt_add_test_dummy_key() Message-ID: <20200513030705.GB108075@google.com> References: <20200512233251.118314-1-ebiggers@kernel.org> <20200512233251.118314-3-ebiggers@kernel.org> <20200513005538.GF1596452@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200513005538.GF1596452@mit.edu> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 05/12, Theodore Y. Ts'o wrote: > On Tue, May 12, 2020 at 04:32:49PM -0700, Eric Biggers wrote: > > From: Eric Biggers > > > > Currently, the test_dummy_encryption mount option (which is used for > > encryption I/O testing with xfstests) uses v1 encryption policies, and > > it relies on userspace inserting a test key into the session keyring. > > > > We need test_dummy_encryption to support v2 encryption policies too. > > Requiring userspace to add the test key doesn't work well with v2 > > policies, since v2 policies only support the filesystem keyring (not the > > session keyring), and keys in the filesystem keyring are lost when the > > filesystem is unmounted. Hooking all test code that unmounts and > > re-mounts the filesystem would be difficult. > > > > Instead, let's make the filesystem automatically add the test key to its > > keyring when test_dummy_encryption is enabled. > > > > That puts the responsibility for choosing the test key on the kernel. > > We could just hard-code a key. But out of paranoia, let's first try > > using a per-boot random key, to prevent this code from being misused. > > A per-boot key will work as long as no one expects dummy-encrypted files > > to remain accessible after a reboot. (gce-xfstests doesn't.) > > > > Therefore, this patch adds a function fscrypt_add_test_dummy_key() which > > implements the above. The next patch will use it. > > > > Signed-off-by: Eric Biggers > > Reviewed-by: Theodore Ts'o Reviewed-by: Jaegeuk Kim