Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3060872pxk; Sun, 4 Oct 2020 23:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn1Eok3cT+UMLZrWWJC1o6QgZIs9pxw80yanBz9gSLoTRVevMqoKw6WhwnElY3i0CKOrLW X-Received: by 2002:a17:906:b053:: with SMTP id bj19mr5920155ejb.146.1601879135021; Sun, 04 Oct 2020 23:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601879135; cv=none; d=google.com; s=arc-20160816; b=psFBIUJz+QM/bHGONm2NeMKVRiN4llX/uHpTAEClGpN45fX+4994wjvCiYfthpOlgW tplmwVIuUvqhsbLVPaWK2EeoqiZsKOMdQUVnVaUt+Tx4nNixTeu2nk+otwvRGCKuDjS3 B2rnjVr73/dXTyAmX+W61pyU7YYgLTZ84JwABsJsirmO19oI4bwczwBC4MZ9pgjeSeeS kJ4kH+HUshqFUKD3IDQWboXRAcYUcPvzUsIIXSlUuMJRnPGgYpC6EWWNleFxwnD42jlL unVHEd2R5zhaTCgPhW/5GEfByZ3bkeK5k8cThSoLeZMWKAy+u23F6hxLRR/dRw1nj+Ux mhQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FSXh8fyYHTxhgsplaGIq2EQ+2nA2VGk2+qiMYHPZxdg=; b=JVyhPqSf2G7Wa9k/yzlkSaUh1qjAh2X0+qh5PhvJGA1fHCmJg0j2LRHQx6T5jNPKFf MEXCG91GsQsU2nMsYWto9SWUPjtcVJ/+lghV/1jPGnfNROG60nZMdko4G+mGSslQr1Ho LCQJfF4clwf4FtukTG+Q/zmvNaxWITNfHy5Ry8YuAu+Ble+i50bWztsOPtCxfZYZtQSa M4ONYq8DXoEtdhjregCFlQxjE6yZOYB70TOKZUnqRuVC6I6m/BqrdPmQk3ncGis0Lwp9 f6MWZflqclnVDDG7gUMeJ8nvnRjElId+AZyXxnqBbvgXLYboxXtqaO2jofunY4bfQHsp o3hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ThJc1Zmt; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si6617410ejd.442.2020.10.04.23.25.10; Sun, 04 Oct 2020 23:25:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ThJc1Zmt; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725880AbgJEGY6 (ORCPT + 99 others); Mon, 5 Oct 2020 02:24:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:59116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbgJEGY6 (ORCPT ); Mon, 5 Oct 2020 02:24:58 -0400 Received: from mail-oo1-f54.google.com (mail-oo1-f54.google.com [209.85.161.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A6E6C207EA; Mon, 5 Oct 2020 06:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601879097; bh=Yrr7GNWUAVWaaz1jIc/uXs8U/IEt8VrM/dIArGoeqEE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ThJc1ZmtFFTxYDdNdNd+qvSTOF09HxfMQO8wyxvIf3O/jNqXFBOknbeaXhDwLlWAs PrdZrskYzZZoD3C1yFpNziMtzwMXM8CWgS2UJsNIFlZq4Gs/IBNJnAl5IpT1GVcSz7 FfpjLECmQYssfScz4NDLWjzumgZ8IcsQuQBSbbac= Received: by mail-oo1-f54.google.com with SMTP id b12so1963023oop.13; Sun, 04 Oct 2020 23:24:57 -0700 (PDT) X-Gm-Message-State: AOAM53123GvanQ29Bce+sClk1yAQAIKz/SECzV4FJMN+7Z/kHElaRCtN 2iyxLcAwjwFtTXgDjQlTl3ur6wDACse/I5RyORc= X-Received: by 2002:a4a:c3ca:: with SMTP id e10mr4325783ooq.41.1601879097030; Sun, 04 Oct 2020 23:24:57 -0700 (PDT) MIME-Version: 1.0 References: <20200930065617.934638-1-palmerdabbelt@google.com> <20201002064905.GA27115@infradead.org> <5692716.lOV4Wx5bFT@positron.chronox.de> <20201005061918.GB1856@infradead.org> In-Reply-To: <20201005061918.GB1856@infradead.org> From: Ard Biesheuvel Date: Mon, 5 Oct 2020 08:24:46 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] crypto: jitterentropy - bind statically into kernel To: Christoph Hellwig Cc: "Stephan M??ller" , Palmer Dabbelt , linux-riscv , Android Kernel Team , kernel test robot , Linux Crypto Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, 5 Oct 2020 at 08:19, Christoph Hellwig wrote: > > On Sun, Oct 04, 2020 at 11:16:10PM +0200, Ard Biesheuvel wrote: > > On Sun, 4 Oct 2020 at 20:48, Stephan M??ller wrote: > > > > > > The RISC-V architecture is about to implement the callback > > > random_get_entropy with a function that is not exported to modules. > > > > Why is that? Wouldn't it be better to export the symbol instead? > > get_cycles is a low-level time keeping detail that really should not > be exported, and at least for RISC-V this would be the only modular > user. Once that is sorted out I'll audit other common architectures > to drop the export, as it isn't something that should be used in ramdom > driver code. Fair enough. But this means we should fix the jitterentropy driver rather than sidestepping the issue by only allowing it to be built in a way where we don't happen to notice that the symbol in question is not meant for general consumption. If jitterentropy is a special case, we could put a alternate non-'static inline' version of random_get_entropy() in the core kernel, and only export it if JITTER_ENTROPY is built as a module in the first place. But I'd prefer it if jitterentropy switches to an API that is suitable for driver consumption.