Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965276AbcDYVoF (ORCPT ); Mon, 25 Apr 2016 17:44:05 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:35070 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965123AbcDYVoA (ORCPT ); Mon, 25 Apr 2016 17:44:00 -0400 MIME-Version: 1.0 In-Reply-To: <20160425143850.b767ca9602fc1be9e13462a5@linux-foundation.org> References: <1461616763-60246-1-git-send-email-thgarnie@google.com> <20160425141046.d14466272ea246dd0374ea43@linux-foundation.org> <20160425143850.b767ca9602fc1be9e13462a5@linux-foundation.org> Date: Mon, 25 Apr 2016 14:43:58 -0700 Message-ID: Subject: Re: [PATCH v2] mm: SLAB freelist randomization From: Thomas Garnier To: Andrew Morton Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Kees Cook , Greg Thelen , Laura Abbott , kernel-hardening@lists.openwall.com, LKML , Linux-MM Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 883 Lines: 25 On Mon, Apr 25, 2016 at 2:38 PM, Andrew Morton wrote: > 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) No problem, better double check it. I agree it is misleading. Thomas