Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEC20C3F2C6 for ; Sat, 29 Feb 2020 19:02:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92D5924680 for ; Sat, 29 Feb 2020 19:02:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583002964; bh=v/dxdUzMi5BClO84askTDLqpiG52LyTh0c5NKk9qtfE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=pBFen7S+dPA2zBN24j9iKyJrSEblboOJfF2hVpAPxzcUA8LE2NyPt6H3YiTHv0VS7 4NokxJLuW0Q//yWbk3ogkH1ufOkUrJ7vb+YokPUmIZdDDe1AtzX90R9ZDdlOUBDZEk Y/P86EL3ohWKVwmYBrXeujNtgICESanWN3ygASno= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727386AbgB2TCo (ORCPT ); Sat, 29 Feb 2020 14:02:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:41444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727341AbgB2TCo (ORCPT ); Sat, 29 Feb 2020 14:02:44 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82AEB2467D; Sat, 29 Feb 2020 19:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583002962; bh=v/dxdUzMi5BClO84askTDLqpiG52LyTh0c5NKk9qtfE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=y9C2W3o9s2rZc5/yf3FQD10PIYSBtS3kkn635kUER/NjdBk1sn1R//j3YtjDZ1GU9 jP1Iu9X994V18yD3+S8Dr3dLv/WXaN1trJLbfDq4BcC8AZaAr/c/llKSWkNs9ZAsuD 7DZ02C9FiNbF7HWLf65cMMSxSi8gez6uqomPBLJA= Date: Sat, 29 Feb 2020 20:02:39 +0100 From: Greg KH To: Vikash Bansal Cc: "stable@vger.kernel.org" , Srivatsa Bhat , "srivatsa@csail.mit.edu" , Alexey Makhalov , Srinidhi Rao , Anish Swaminathan , Vasavi Sirnapalli , Sharath George , Steven Rostedt , Ajay Kaher , "rostedt@goodmis.org" , Stephan Mueller , Yann Droneaud , Herbert Xu Subject: Re: [PATCH v4.19.y, v4.14.y, v4.9.y] crypto: drbg - add FIPS 140-2 CTRNG for noise source Message-ID: <20200229190239.GB832132@kroah.com> References: <20200227055805.3011-1-bvikas@vmware.com> <20200227070030.GA290231@kroah.com> <87EC78FF-21EE-4921-B819-CBA4D328E159@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87EC78FF-21EE-4921-B819-CBA4D328E159@vmware.com> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Sat, Feb 29, 2020 at 10:01:49AM +0000, Vikash Bansal wrote: > > On 27/02/20, 12:30 PM, "Greg KH" wrote: > > > > On Thu, Feb 27, 2020 at 05:58:05AM +0000, Vikash Bansal wrote: > >> From: Stephan Mueller > >> > >> commit db07cd26ac6a418dc2823187958edcfdb415fa83 upstream > >> > >> FIPS 140-2 section 4.9.2 requires a continuous self test of the noise > >> source. Up to kernel 4.8 drivers/char/random.c provided this continuous > >> self test. Afterwards it was moved to a location that is inconsistent > >> with the FIPS 140-2 requirements. The relevant patch was > >> e192be9d9a30555aae2ca1dc3aad37cba484cd4a . > >> > >> Thus, the FIPS 140-2 CTRNG is added to the DRBG when it obtains the > >> seed. This patch resurrects the function drbg_fips_continous_test that > >> existed some time ago and applies it to the noise sources. The patch > >> that removed the drbg_fips_continous_test was > >> b3614763059b82c26bdd02ffcb1c016c1132aad0 . > >> > >> The Jitter RNG implements its own FIPS 140-2 self test and thus does not > >> need to be subjected to the test in the DRBG. > >> > >> The patch contains a tiny fix to ensure proper zeroization in case of an > >> error during the Jitter RNG data gathering. > >> > >> Signed-off-by: Stephan Mueller > >> Reviewed-by: Yann Droneaud > >> Signed-off-by: Herbert Xu > >> Signed-off-by: Vikash Bansal > >> --- > >> crypto/drbg.c | 94 +++++++++++++++++++++++++++++++++++++++++-- > >> include/crypto/drbg.h | 2 + > >> 2 files changed, 93 insertions(+), 3 deletions(-) > > > > This looks like a new feature to me, why is it needed in the stable > > kernel trees? What bug does it fix? > > In 4.19.y, 4.14.y & 4.9.y, DRBG implementation is as per NIST recommendation > defined in NIST SP800-9A and it designed to be ready for FIPS certification. > But it has missed one of the NIST test requirement define in FIPS 140-2(4.9.2), > so it is not ready for NIST FIPS certification. > With this patch FIPS 140-2(4.9.2) continuous test requirement will be fulfilled. Then use 5.4 or newer kernels if you need such a certification. Adding this new feature to older kernels is just that, a new feature. What is preventing you from using 5.4? It's much better security wise than older kernels for a whole load of reasons. thanks, greg k-h