From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DDECC76186 for ; Mon, 29 Jul 2019 20:15:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12198205F4 for ; Mon, 29 Jul 2019 20:15:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730366AbfG2UPP (ORCPT ); Mon, 29 Jul 2019 16:15:15 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:41355 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729147AbfG2UPK (ORCPT ); Mon, 29 Jul 2019 16:15:10 -0400 Received: from callcc.thunk.org (96-72-102-169-static.hfc.comcastbusiness.net [96.72.102.169] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x6TKElfw026772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jul 2019 16:14:48 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id AC8394202F5; Mon, 29 Jul 2019 16:14:45 -0400 (EDT) Date: Mon, 29 Jul 2019 16:14:45 -0400 From: "Theodore Y. Ts'o" To: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-api@vger.kernel.org, linux-crypto@vger.kernel.org, keyrings@vger.kernel.org, Paul Crowley , Satya Tangirala Subject: Re: [PATCH v7 06/16] fscrypt: add FS_IOC_ADD_ENCRYPTION_KEY ioctl Message-ID: <20190729201445.GA16445@mit.edu> References: <20190726224141.14044-1-ebiggers@kernel.org> <20190726224141.14044-7-ebiggers@kernel.org> <20190728185003.GF6088@mit.edu> <20190729194644.GE169027@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190729194644.GE169027@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Jul 29, 2019 at 12:46:45PM -0700, Eric Biggers wrote: > > For that matter, we could just add a new ioctl which returns the file > > system's keyring id. That way an application program won't have to > > try to figure out what a file's underlying sb->s_id happens to be. > > (Especially if things like overlayfs are involved.) > > Keep in mind that the new ioctls (FS_IOC_ADD_ENCRYPTION_KEY, > FS_IOC_REMOVE_ENCRYPTION_KEY, FS_IOC_GET_ENCRYPTION_KEY_STATUS) don't take the > keyring ID as a parameter, since it's already known from the filesystem the > ioctl is executed on. So there actually isn't much that can be done with the > keyring ID. But sure, if it's needed later we can add an API to get it. Yeah, I was thinking about for testing/debugging purposes so that we could use keyctl to examine the per-file system keyring and see what keys are attached to a file system. This is only going to be usable by root, so I guess we can just try to figure it out by going through /proc/keys and searching by sb->s_id. If there are ambiguities that make this hard to do, we can add an interface to make this easier. - Ted