Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398AbdGRJCF (ORCPT ); Tue, 18 Jul 2017 05:02:05 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:35420 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322AbdGRJCD (ORCPT ); Tue, 18 Jul 2017 05:02:03 -0400 MIME-Version: 1.0 In-Reply-To: <20170718084959.GA25267@kroah.com> References: <3910055.ntkqcq1Chb@positron.chronox.de> <22067042.Wh8NKMhEMa@positron.chronox.de> <20170718083014.GA18340@kroah.com> <5020806.nso7MErEBx@positron.chronox.de> <20170718084959.GA25267@kroah.com> From: Arnd Bergmann Date: Tue, 18 Jul 2017 11:02:02 +0200 X-Google-Sender-Auth: BHt09wouXGrjyzc1MnunOze-7p0 Message-ID: Subject: Re: [RFC PATCH v12 1/4] crypto: make Jitter RNG directly accessible To: Greg Kroah-Hartman Cc: =?UTF-8?Q?Stephan_M=C3=BCller?= , "Jason A. Donenfeld" , linux-crypto@vger.kernel.org, Linux Kernel Mailing List 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-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6I92BbU019517 Content-Length: 1389 Lines: 35 On Tue, Jul 18, 2017 at 10:49 AM, Greg Kroah-Hartman wrote: > On Tue, Jul 18, 2017 at 10:40:07AM +0200, Stephan Müller wrote: >> Am Dienstag, 18. Juli 2017, 10:30:14 CEST schrieb Greg Kroah-Hartman: >> >> Hi Greg, >> >> > > +typedef unsigned long long __u64; >> > > +typedef long long __s64; >> > >> > types.h already has these defines, don't re-typedef them again... >> >> The issue is that the C code is compiled without optimizations. Thus, the C >> code shall not depend on any other header file. > > That is very strange for a kernel file, I don't know what to say... > >> This issue was discussed during the inclusion of the Jitter RNG C code into >> the kernel. > > Ok, that was then, this is now, why not change it now? How does > including types.h change anything? I can see why the jitterentropy implementation avoids using kernel headers, the problem now is that part of it gets moved into a new header, and that already violates the original principle. >From my reading of the code, we could probably leave the structure definition in the crypto/jitterentropy.c, and have the statically allocated instance in the same file when CONFIG_LRNG is set, or provide a way to allocate an instance early (I assume you can't call jent_entropy_collector_alloc() here since you need the RNG long before kzalloc() works). Arnd