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=-11.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 43C81C4338F for ; Tue, 24 Aug 2021 07:33:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D207610D0 for ; Tue, 24 Aug 2021 07:33:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234998AbhHXHeY (ORCPT ); Tue, 24 Aug 2021 03:34:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234995AbhHXHeX (ORCPT ); Tue, 24 Aug 2021 03:34:23 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88F36C061757 for ; Tue, 24 Aug 2021 00:33:39 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mIQwC-0007OI-KS; Tue, 24 Aug 2021 09:33:36 +0200 Subject: Re: [PATCH 0/4] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys To: Tim Harvey Cc: David Gstir , Aymen Sghaier , Mimi Zohar , Jan Luebbe , keyrings@vger.kernel.org, Steffen Trumtrar , linux-security-module@vger.kernel.org, Udit Agarwal , Herbert Xu , =?UTF-8?Q?Horia_Geant=c4=83?= , Richard Weinberger , James Morris , Eric Biggers , "Serge E. Hallyn" , Sumit Garg , James Bottomley , Franck LENORMAND , David Howells , open list , Jarkko Sakkinen , linux-crypto@vger.kernel.org, Sascha Hauer , linux-integrity@vger.kernel.org, "David S. Miller" References: <2b48a848-d70b-9c43-5ca0-9ab72622ed12@pengutronix.de> <9200d46d-94a2-befd-e9b0-93036e56eb8a@pengutronix.de> From: Ahmad Fatoum Message-ID: <8b559c9c-a4c0-d335-5e54-40b9acc08707@pengutronix.de> Date: Tue, 24 Aug 2021 09:33:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-integrity@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On 23.08.21 19:50, Tim Harvey wrote: > On Mon, Aug 23, 2021 at 6:29 AM Ahmad Fatoum wrote: >> On 20.08.21 23:19, Tim Harvey wrote: >>> On Fri, Aug 20, 2021 at 1:36 PM Ahmad Fatoum wrote: >>>> On 20.08.21 22:20, Tim Harvey wrote: >>> It works for a user keyring but not a session keyring... does that >>> explain anything? >>> # keyctl add trusted mykey 'new 32' @u >>> 941210782 >>> # keyctl print 941210782 >>> 83b7845cb45216496aead9ee2c6a406f587d64aad47bddc539d8947a247e618798d9306b36398b5dc2722a4c3f220a3a763ee175f6bd64758fdd49ca4db597e8ce328121b60edbba9b8d8d55056be896 >>> # keyctl add trusted mykey 'new 32' @s >>> 310571960 >>> # keyctl print 310571960 >>> keyctl_read_alloc: Unknown error 126 >> >> Both sequences work for me. >> >> My getty is started by systemd. I think systemd allocates a new session >> keyring for the getty that's inherited by the shell and the commands I run >> it in. If you don't do that, each command will get its own session key. >> >>> Sorry, I'm still trying to wrap my head around the differences in >>> keyrings and trusted vs user keys. >> >> No problem. HTH. > > Ahmad, > > Ok that explains it - my testing is using a very basic buildroot > ramdisk rootfs. If I do a 'keyctl new_session' first I can use the > system keyring fine as well. Great. Does this mean I can get your Tested-by: ? :) > Thanks - hoping to see this merged soon! You and me both. Cheers, Ahmad > > Tim > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |