Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2297622ybc; Wed, 20 Nov 2019 11:54:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwKV0S+cSCNZFw81n/BdVoYzKiHlOiwhxN7aHggxOLVF6PguKBx5Og3jk5xv28u2+r3gTzV X-Received: by 2002:a17:906:37cd:: with SMTP id o13mr7382814ejc.148.1574279667944; Wed, 20 Nov 2019 11:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574279667; cv=none; d=google.com; s=arc-20160816; b=H4FruN5tNDZKfKdNRHyZ3oSWi0LpWSewsouhoR01DclmIMsvkXpUUHMQ7f9OKWictc a6FIA143sbA+u9D5dnUOCuMaW9FuVF8GJPKM4MoohofaIjMZD5YzFFkJhi6bTBDyJDdE +ZgpY+OiKZShXoSDN7AahOEqBei9UIZBbMlmPvqBIofjSX0dX/cHfdO8f+h0bxgaaqIy ElXjdumW/CacjvvLEAwnBk8mGT/hm+e4wNNKzkwk2SK/o1fOgFTCA226a1BtG8ERVZn1 y8C/FcvP120G+IvVUITg13+kZSWqApJzbGHt4UvvnMzda2GJz4d5U9VNxbvSr5tQ0QJ3 xGYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LeodlJc2E0O1WN5oYZY2L3ih1kyEFugDWGrCoq/S39M=; b=vaF2ywqJzByifu0ixw7nweLlJRzUtePka4YF2/YjVx8u2X2X+4RM3WyX2U8+tj3DnP MhsvXuLguOJSPGZAFNGvRrpePSPhvbQzSfYPh5/dYVgGNnv7Sx8IyjzIWYl9hPm++dnF HhCaYkTlfMpWvhKWH5nW2qpr08rbSRdFskxnC/DedVXy2sGkvM344DxOCkD21hhrIqn0 XzclWH+wKf9k8OXVGnElr+scc2sb+VwWyEqwpJI8JR/iUuJnj7J7RBpJpa/oJTka9qI9 CZDQshXXQRAW6Jg/Bl0O9dOe6FNRNIkwb22SDgkkF13uhP4XIqpIL4u4LIY6LBFQ4X8o 6bSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@chronox.de header.s=strato-dkim-0002 header.b=ruprINJH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si411736ede.120.2019.11.20.11.54.04; Wed, 20 Nov 2019 11:54:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@chronox.de header.s=strato-dkim-0002 header.b=ruprINJH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727706AbfKTTwX (ORCPT + 99 others); Wed, 20 Nov 2019 14:52:23 -0500 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.81]:29107 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbfKTTwW (ORCPT ); Wed, 20 Nov 2019 14:52:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1574279540; s=strato-dkim-0002; d=chronox.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=LeodlJc2E0O1WN5oYZY2L3ih1kyEFugDWGrCoq/S39M=; b=ruprINJH9bhaV2VGvM41XuV/8huZ76KYqhD2WHYIyFx+E9yqRcQ7eOK7AnMgrMQsx5 e9qpTE3GHrhs/g4wbHFV5NdpcoBBuyzqRa56Q8EfJUXN2Ywff2Z5J+8wgnwx398AK8xg hav/iGWI6MyayuOet6rCfbZhMAe7VicD+du4i3hKBHt8wL+aiN1NBzSgis0YUE+fMA+6 QrzEGLh4YRGJKuCqvufjPvsOWvRj1bbUpXQ4WTpTQFgzVcv1gRr9KMgs+BJ8h5lSY8Sk 6uNTnXJEC7DMSpyVoYJs+ciXsmOuMwTE/7FRZWFLEXcDFyC2xglZPF0UidMwrUQ4E3hF g2ow== X-RZG-AUTH: ":P2ERcEykfu11Y98lp/T7+hdri+uKZK8TKWEqNyiHySGSa9k9xmwdNnzHHXDbL/ScbtM=" X-RZG-CLASS-ID: mo00 Received: from positron.chronox.de by smtp.strato.de (RZmta 44.29.0 DYNA|AUTH) with ESMTPSA id N09a57vAKJpBmvw (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 20 Nov 2019 20:51:11 +0100 (CET) From: Stephan =?ISO-8859-1?Q?M=FCller?= To: Greg Kroah-Hartman Cc: Andy Lutomirski , Arnd Bergmann , Linux Crypto Mailing List , LKML , Linux API , "Eric W. Biederman" , "Alexander E. Patrakov" , "Ahmed S. Darwish" , "Theodore Y. Ts'o" , Willy Tarreau , Matthew Garrett , Vito Caputo , Andreas Dilger , Jan Kara , Ray Strode , William Jon McCann , zhangjs , Florian Weimer , Lennart Poettering , Nicolai Stange , "Peter, Matthias" , Marcelo Henrique Cerri , Roman Drahtmueller , Neil Horman Subject: Re: [PATCH v25 10/12] LRNG - add TRNG support Date: Wed, 20 Nov 2019 20:51:11 +0100 Message-ID: <1695782.oZ5Vf4nH9s@positron.chronox.de> In-Reply-To: <20191120132918.GA2892197@kroah.com> References: <5390778.VeFRgus4bQ@positron.chronox.de> <19681012.svDddlc5pN@positron.chronox.de> <20191120132918.GA2892197@kroah.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, 20. November 2019, 14:29:18 CET schrieb Greg Kroah-Hartman: Hi Greg, > On Wed, Nov 20, 2019 at 09:58:35AM +0100, Stephan M=FCller wrote: > > Am Dienstag, 19. November 2019, 13:41:50 CET schrieb Greg Kroah-Hartman: > >=20 > > Hi Greg, > >=20 > > > On Tue, Nov 19, 2019 at 02:07:40AM -0800, Andy Lutomirski wrote: > > > > > As this would introduce a new device file now, is there a special > > > > > process that I need to follow or do I need to copy? Which > > > > > major/minor > > > > > number should I use? > > > > >=20 > > > > > Looking into static const struct memdev devlist[] I see > > > > >=20 > > > > > [8] =3D { "random", 0666, &random_fops, 0 }, > > > > > [9] =3D { "urandom", 0666, &urandom_fops, 0 }, > > > > >=20 > > > > > Shall a true_random be added here with [10]? > > > >=20 > > > > I am not at all an expert on chardevs, but this sounds generally > > > > reasonable. gregkh is probably the real authority here. > > >=20 > > > [10] is the aio char device node, so you better not try to overlap it= or > > > bad things will happen :( > >=20 > > Thanks for your insights. > >=20 > > Which device minor number could we use? >=20 > Get your own dynamic one by using a misc device if you _REALLY_ want to > add yet-another-char-node-for-random-data. >=20 > But I would have thought that we all realize that this is not the way to > do things. Let's not have "random", "urandom", and "true_random" be > something we want to totally confuse userspace with, that way is insane. >=20 > Please just make the existing userspace api "just work", don't add to > the mess. Thank you, I think we should follow that advise. With that and considering Alexander's rightful remark we have a challenge. = So,=20 changing the syscall may not be the right way unless we find a way to restr= ict=20 the permissions somehow (capability? LSM? None of that seems to be a good=20 fit). What about providing a /sys file? I.e. adding a file that: a) has permissions 440 per default and maybe the ownership of root:root b) allow user space to perform a chown/chgrp c) only supports reading of data from user space But then, how could we provide a common interface for the existing random.c= =20 and the LRNG? Or should we use a proc file for that? If yes, I guess it should not be a=20 sysctl, but a "regular" proc file that should allow a chown(2) operation. O= n=20 the other hand, is proc the right place to provide a user space interface f= or=20 exporting data to user? Thanks a lot. Ciao Stephan