Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbdHIPNC (ORCPT ); Wed, 9 Aug 2017 11:13:02 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:38326 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752047AbdHIPM7 (ORCPT ); Wed, 9 Aug 2017 11:12:59 -0400 MIME-Version: 1.0 In-Reply-To: <11686.1502285205@warthog.procyon.org.uk> References: <8ac57c96bf5a0695ecc67fd230440b0b9d15740f.1502246502.git.baolin.wang@linaro.org> <6767.1502271233@warthog.procyon.org.uk> <11686.1502285205@warthog.procyon.org.uk> From: Arnd Bergmann Date: Wed, 9 Aug 2017 17:12:58 +0200 X-Google-Sender-Auth: 7MzssPbkynEio7eGuSG_M_qGe1I Message-ID: Subject: Re: [PATCH 3/3] net: rxrpc: Replace time_t type with time64_t type To: David Howells Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1643 Lines: 35 On Wed, Aug 9, 2017 at 3:26 PM, David Howells wrote: > Arnd Bergmann wrote: > >> Do you know which format is used in practice? Are both kad and k5 common >> among rxrpc users? > > The aklog program I'm using uses the non-XDR interface to push a Kerberos 5 > ticket to the kernel, so it doesn't actually invoke rxrpc_preparse_xdr() from > rxrpc_preparse(). 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. >From what I can tell, the program you have at http://people.redhat.com/~dhowells/rxrpc/klog.c will keep working beyond 2038 but not beyond 2106 on all 64-bit architectures and on those 32-bit systems that have a libc with 64-bit time_t. It could be modified to use the xdr_rxk5 key format, which would make it use 64-bit time values (and require the kernel fix mentioned above). In contrast, the rxrpc socket interface would need a major rework to support 64-bit expiration times. It receives a kerberos ticket with a 32-bit issue time that gets used to calculate the expiry time in rxkad_decrypt_ticket, and from there we pass it through a rxrpc_key_data_v1 into key_instantiate_and_link(), which calls rxrpc_preparse() and that just takes the expiry out again and sticks it into another 32-bit field in struct rxkad_key, from where it finally gets copied into the (now 64-bit) key_preparsed_payload->expiry field. Does my understanding match what you intended for the interfaces? Is there a need to extend the rxrpc socket interface to support xdr_rxk5 keys as well? Arnd