Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965201AbcDYViy (ORCPT ); Mon, 25 Apr 2016 17:38:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56654 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964951AbcDYViw (ORCPT ); Mon, 25 Apr 2016 17:38:52 -0400 Date: Mon, 25 Apr 2016 14:38:50 -0700 From: Andrew Morton To: Thomas Garnier Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Kees Cook , Greg Thelen , Laura Abbott , kernel-hardening@lists.openwall.com, LKML , Linux-MM Subject: Re: [PATCH v2] mm: SLAB freelist randomization Message-Id: <20160425143850.b767ca9602fc1be9e13462a5@linux-foundation.org> In-Reply-To: References: <1461616763-60246-1-git-send-email-thgarnie@google.com> <20160425141046.d14466272ea246dd0374ea43@linux-foundation.org> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 708 Lines: 19 On Mon, 25 Apr 2016 14:14:33 -0700 Thomas Garnier wrote: > >>> + /* Get best entropy at this stage */ > >>> + get_random_bytes_arch(&seed, sizeof(seed)); > >> > >> See concerns in other email - isn't this a no-op if CONFIG_ARCH_RANDOM=n? > >> > > The arch_* functions will return 0 which will break the loop in > get_random_bytes_arch and make it uses extract_entropy (as does > get_random_bytes). > (cf http://lxr.free-electrons.com/source/drivers/char/random.c#L1335) > oop, sorry, I misread the code. (and the get_random_bytes_arch() comment "This function will use the architecture-specific hardware random number generator if it is available" is misleading, so there)