Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1458626ybc; Tue, 12 Nov 2019 22:03:50 -0800 (PST) X-Google-Smtp-Source: APXvYqw5H/DlH8ZVKhXAhDqIbP61l4zx0CnejMQH97DhpDLlbDLyI9zNG0qqo7mefhaQhXMsoOhO X-Received: by 2002:a17:906:8697:: with SMTP id g23mr1130344ejx.177.1573625030627; Tue, 12 Nov 2019 22:03:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573625030; cv=none; d=google.com; s=arc-20160816; b=fHdSsx1AP+XbpLpLGsL2BPier0kS4ES3XuhmTeiSSP06m/3dQ6XU7pessOJFCpRLgG 7jQMHg5Vohaq5MbZvNtdNYz8P/vI1gqEyy55lop+5fNR2y0Icmfa23MOl2xeBLj4/Ey8 JHvilLhA/I2dKrw1Gi1JRZBajTolIOxu3Em21ISME3IK8K0FKr3yYWnKlel7Vmwv17HA ybp2KIeLGQXrnK6WAbb7ZItMQGTdX/fqdWvMVYFqg1JQx5uYGSAxcP8GQeAxJxDYIcjJ FpcgH0E3nfYqt+HM/OYQ9fhbZsUE0IBv5gIavXhB+qfdFGIP7mmhW6/9RQkaIrhV152u xgAg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=phY5nYA9dHfZmr9N/f2WhSW/Yk2EVx6rjISS971Sg2o=; b=egFeo8Fif8yCU7TT8MBb+xqoK/ziwDj1RVQQxDGarCc/D807dzkRI9cpCJMF/vVyej QyAh9spvk7754Z3NiQ9iwyNWPkhw4zLr81RNeodCBDPTkiKUZQA/sxgv00vW48ENfuJx CHLcgb2jT7lV23MlBWgm4KIXboslwhfpQOND0Nsi+0MKQ6TP1bWOjV8BQdJBVhIdMUo6 wIHp0CpITkbaGCpwhy0lAauWs6Rr2+jpWCiOjdzmEZ9Zw9Hu9QM2uZqh2eS1mj0hvaKo Sit3hX9W3iDUX7x9/CxpKFvGPgS52YULWKcMKzUdzSnAwBgF/q/gHULUCJN7LXHx1rXG sqMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mXfCrazN; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce9si546030ejb.213.2019.11.12.22.03.11; Tue, 12 Nov 2019 22:03:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mXfCrazN; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725908AbfKMGCx (ORCPT + 99 others); Wed, 13 Nov 2019 01:02:53 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:39760 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbfKMGCw (ORCPT ); Wed, 13 Nov 2019 01:02:52 -0500 Received: by mail-qk1-f196.google.com with SMTP id 15so754521qkh.6; Tue, 12 Nov 2019 22:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=phY5nYA9dHfZmr9N/f2WhSW/Yk2EVx6rjISS971Sg2o=; b=mXfCrazN9OmG7u9ZHylHgcIWpfHsn9ZPDWi5eVrh3USyFDSrlAIqK3YbWi5Gt1I5G3 gjKQVXWCRSAx1O8yY+IaIoaHEwVKKfiKPxQbxhF6W9APf5JXQD/PPVvO57Q5YPNnK8vp 94vMbmLlH2ISX9divPjKRhO1JH2Sh1xrervXN7P0Y1rmfBx+hiYXYFyaJ4cZz7KDmVAo e7sKwwxFqGRq7fTU4aVaQoSGDyDXYi1ohraFQUADPpcyaDhkyyHf/cIejD4m0zEUzQyc JnO4hfzmk6S4bDUKGe34KJ5IfGeoDOSOEgGIpXL0d3lKy7faUbJBJVXRvDzZLkQCzfW+ AvZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=phY5nYA9dHfZmr9N/f2WhSW/Yk2EVx6rjISS971Sg2o=; b=ge6GjaogSgKb2Uo8ePd2rF3WIjpMuFcCcKrMM3i/2uZV2inC2edbYiV4MEZ8JfUiRw rqtdtRdWSanNfdohy6W+Qggf35xc86ExFdCBlxxcoIwOdF/G1SjOLnV9/Li4OFi0f50G x85CYrav6cIqMyfF11x4s76Xcfd4BUqrTnNHnsQOcQf3Kg3uypicqqEZpZrKtWrRvzHf 8Fs8gmWhBqQ12j3NTwdvFGgibUQ+WVGhmKXHcw1TVxxkvIGoJLwzfg0isbg3NdZhUS+U GN8QVa3/B2AGSPDE4TOFuRdFk9ZmOJygqL2a8nmmTAw1rlIa1dpWjtZB2NMAYcJoWMGg S1TA== X-Gm-Message-State: APjAAAUUPn7nj9WIbQA2ezSkuRy4whu9zUkG1BhzoJv8hUQyId12lzeZ fqd42KoJxL6MXQGVy6wAgYtQa3U0e6YFBxpRxmM= X-Received: by 2002:a37:7c81:: with SMTP id x123mr1137940qkc.212.1573624971655; Tue, 12 Nov 2019 22:02:51 -0800 (PST) MIME-Version: 1.0 References: <6157374.ptSnyUpaCn@positron.chronox.de> <3385183.Cb3iLDTLdO@positron.chronox.de> <556c89ae-4272-970d-1644-cb77dc3c7946@gmail.com> <9152597.fJySsU3eCD@positron.chronox.de> In-Reply-To: <9152597.fJySsU3eCD@positron.chronox.de> From: "Alexander E. Patrakov" Date: Wed, 13 Nov 2019 11:02:40 +0500 Message-ID: Subject: Re: [PATCH v24 11/12] LRNG - add SP800-90B compliant health tests To: =?UTF-8?Q?Stephan_M=C3=BCller?= Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-crypto@vger.kernel.org, LKML , Linux API , "Eric W. Biederman" , "Ahmed S. Darwish" , "Theodore Y. Ts'o" , Willy Tarreau , Matthew Garrett , Vito Caputo , Andreas Dilger , Jan Kara , Ray Strode , William Jon McCann , zhangjs , Andy Lutomirski , Florian Weimer , Lennart Poettering , Nicolai Stange , "Peter, Matthias" , Marcelo Henrique Cerri , Roman Drahtmueller , Neil Horman Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org =D1=81=D1=80, 13 =D0=BD=D0=BE=D1=8F=D0=B1. 2019 =D0=B3. =D0=B2 05:38, Steph= an M=C3=BCller : > > Am Dienstag, 12. November 2019, 20:58:32 CET schrieb Alexander E. Patrako= v: > > Hi Alexander, > > > > +config LRNG_HEALTH_TESTS > > > + bool "Enable noise source online health tests" > > > + help > > > + The online health tests validate the noise source at > > > + runtime for fatal errors. These tests include SP800-90B > > > + compliant tests which are invoked if the system is booted > > > + with fips=3D1. In case of fatal errors during active > > > + SP800-90B tests, the issue is logged and the noise > > > + data is discarded. These tests are required for full > > > + compliance with SP800-90B. > > > > How have you tested that these tests work at runtime? Maybe add some > > code under a new CONFIG item that depends on CONFIG_BROKEN that > > deliberately botches the RNG and triggers failures? > > > I am unable to find sensible information about CONFIG_BROKEN in the recen= t > kernel tree. > > Do you happen to have a pointer on how that option is to be used? This option is not used on its own. You create a new option, CONFIG_TEST_LRNG_FAILURE_MODE or something like that, and put your code under the ifdef guarded by that option. And then, to prevent ordinary users and allyesconfig from selecting it, in Kconfig you say: "depends on BROKEN". This way, the option becomes unselectable in menuconfig but still works as intended when added manually to .config (obviously, with the BROKEN dependency removed locally). Definition: https://github.com/torvalds/linux/blob/9c7db5004280767566e91a33= 445bf93aa479ef02/init/Kconfig#L68 Example usage: https://github.com/torvalds/linux/blob/c87237110f2553b4200a8= b3401a01198edfcf0d9/drivers/gpu/drm/i915/Kconfig.debug#L166 -- Alexander E. Patrakov