From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751845AbdARB6i (ORCPT ); Tue, 17 Jan 2017 20:58:38 -0500 Received: from mga11.intel.com ([192.55.52.93]:62896 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825AbdARB6h (ORCPT ); Tue, 17 Jan 2017 20:58:37 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,247,1477983600"; d="scan'208";a="54500455" Subject: Re: random: /dev/random often returns short reads To: "Theodore Ts'o" , Denys Vlasenko , Denys Vlasenko , Linux Kernel Mailing List References: <20170117043640.4ykofgcwfysvgyue@thunk.org> <20170117171539.dadciiz2kfjtqrfk@thunk.org> <09f2ce2d-3c84-bb12-560c-3208691d2c55@redhat.com> <71338f5a-83e3-4316-845d-8cdea735df0f@linux.intel.com> <20170117234149.alego63cw6a7azw3@thunk.org> From: "H. Peter Anvin" Message-ID: <7c128925-a4d8-dda4-b9f9-597902d752be@linux.intel.com> Date: Tue, 17 Jan 2017 17:54:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170117234149.alego63cw6a7azw3@thunk.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/17/17 15:41, Theodore Ts'o wrote: > On Tue, Jan 17, 2017 at 02:29:30PM -0800, H. Peter Anvin wrote: >> If there is a real need to hack around this, then I would instead >> suggest modifying random_read() to block rather than return if the user >> requests below a certain value, O_NONBLOCK is not set, and the whole >> request cannot be fulfilled. It probably needs to be a sysctl >> configurable, though, and most likely defaulting to 1, as it could just >> as easily break properly functioning applications. > > Ugh. This seems horribly complicated. If we _really_ need to give > aid and comfort to people trying to do pointless FIPS certification > workarounds (as opposed to closing bugzilla complaints with "working > as intended"), how about this? Personally I'm fine with your parenthesized solution, and we can always tell them that the workaround for their broken app is to mount /dev/urandom over /dev/random until they have fixed their software. ;) -hpa