Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp138619ybk; Tue, 12 May 2020 17:57:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXBVjHtXNfHlVVm581rixbadvvdEtcVsudq4RIr4A0bvMzyRNqGqxVO9y/kxTtVKW3rnfm X-Received: by 2002:a05:6402:501:: with SMTP id m1mr2376154edv.207.1589331444987; Tue, 12 May 2020 17:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589331444; cv=none; d=google.com; s=arc-20160816; b=maOJK6NamNOtrzZwAoVxXqWBurDI1dat8HeFa2cA4Nfv3E2F4Zu9jvFSwk2bxjTUXq YQVl/wvVd9DARFiDlT135T7mo4QgNdMtax8gMqnabYCtnPRbSEujfQ8CMJVgLYCWRDao P+HI3Uv48HPmSvSEhznG1u9tEDjtbialCKkOyp7RzHX5GWn1n880Ac3A9gzgflrmL4nU 74IIgm252uMoh909VqdJc0M/k5TOGN2++10Ie3Z3Ku4EPGJ+4ukXwT3tokjGeQielMLV 8Dlesy9tWYw1yZqu8/FtP77zOdZlHEgC0slU1C3xKLQXEudCQH1O60jDHEzlBcENEXrD GBPA== 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; bh=1TXqjayUvCrme096A8vo5dxTea3J4uSqpdNM3rup1aM=; b=OFDbN9OOrEDWwdE/horgbTOA/TStgSlv3ubxnG6gBkANwUWu/YsW4ikGfFgWf6MY22 jKl+4E8jgfYIzOKni7Zit1r+I2m6FTSNMnm20f8auVGDsuFxF6mHu5expNMozRhhgMIQ BpeGR3rQ4cRrOl/sJmKkJSmXzQAYrfsnY2bgkGB2oruwHn0quP9ootnoAI/5U8/xLgf5 Qvm+tp4Yy2QhXj8WK5F2MdM00BxsEq6gYmhwBnAlohvVnokvQpM9B5OqmRcD1dZ9LeNQ JB16PM1XW+W9iaFdpoqMqNW/Jzbyz5dImUzgaau9ujBuCIo5EmSTNf5oxwL2+wT/Av2N 8oYw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si5482745edt.220.2020.05.12.17.57.01; Tue, 12 May 2020 17:57:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732158AbgEMA4B (ORCPT + 99 others); Tue, 12 May 2020 20:56:01 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:55970 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732082AbgEMAz7 (ORCPT ); Tue, 12 May 2020 20:55:59 -0400 Received: from callcc.thunk.org (pool-100-0-195-244.bstnma.fios.verizon.net [100.0.195.244]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 04D0tcEU000849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2020 20:55:39 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id C4B6E4202E4; Tue, 12 May 2020 20:55:38 -0400 (EDT) Date: Tue, 12 May 2020 20:55:38 -0400 From: "Theodore Y. Ts'o" To: Eric Biggers Cc: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Jaegeuk Kim , Daniel Rosenberg Subject: Re: [PATCH 2/4] fscrypt: add fscrypt_add_test_dummy_key() Message-ID: <20200513005538.GF1596452@mit.edu> References: <20200512233251.118314-1-ebiggers@kernel.org> <20200512233251.118314-3-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200512233251.118314-3-ebiggers@kernel.org> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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