Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbdHIPpy (ORCPT ); Wed, 9 Aug 2017 11:45:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53788 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753560AbdHIPpw (ORCPT ); Wed, 9 Aug 2017 11:45:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 70987C050CDE Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dhowells@redhat.com Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <8ac57c96bf5a0695ecc67fd230440b0b9d15740f.1502246502.git.baolin.wang@linaro.org> <6767.1502271233@warthog.procyon.org.uk> <11686.1502285205@warthog.procyon.org.uk> To: Arnd Bergmann Cc: dhowells@redhat.com, Baolin Wang , David Miller , james.l.morris@oracle.com, "Serge E. Hallyn" , marc.dionne@auristor.com, Dan Carpenter , "Jason A. Donenfeld" , Mark Brown , keyrings@vger.kernel.org, Linux Kernel Mailing List , LSM List , Networking Subject: Re: [PATCH 3/3] net: rxrpc: Replace time_t type with time64_t type MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29919.1502293547.1@warthog.procyon.org.uk> Date: Wed, 09 Aug 2017 16:45:47 +0100 Message-ID: <29920.1502293547@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 09 Aug 2017 15:45:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1097 Lines: 26 Arnd Bergmann wrote: > Ah, I'm slowly starting to understand how this fits together. So you can add > a key either through key_add() from local user space, or through an rxrpc > socket. No, you can't add keys through an rxrpc socket. There are three 'classes' of key: (1) Client keys (type rxrpc). These must be added by add_key() by userspace (but could also be acquired by upcalling to /sbin/request-key) and then the kernel calls request_key() to locate them on entry through either a kafs inode/file operation or through sendmsg() to an AF_RXRPC socket. (2) Server keys (type rxrpc_s). These are created by userspace and are presented to an AF_RXRPC server socket by calling setsockopt(). The server uses these to validate/decrypt the token passed by a RESPONSE packet. (3) Service connection keys (type rxrpc). These are created internally by AF_RXRPC after a successful challenge/response negotiation to hold the security details so that we have a struct key to pass around that corresponds to the key in (1). David