Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3281479yba; Tue, 16 Apr 2019 08:14:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYJ57SUp3RUXQjuGbl1T2OAUI8+oiqv6U5w9xPrcOgC5zLF4JGkf6Ix7bS7b/mymsN7Stg X-Received: by 2002:a63:5c43:: with SMTP id n3mr71847057pgm.163.1555427680947; Tue, 16 Apr 2019 08:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555427680; cv=none; d=google.com; s=arc-20160816; b=dud1dUbBO0galG+0SskNJMNNIF4e5/cKDUcHgheDijklZXoW07frtb1q1VhRnS1CMb rraFA1/smssdZiiuI5Jsd4gVV1W0DWau5aOId8rpm4+UoGVHzI5tgZI4oUGe87PP865Q mH3taPje3QoXoNjIk5NXEoJHzUh/yWHu7qPHNrZ2apVQHp4ddic4eDc40KQlgj4UpfHz sC8QeDz9HsO3xq6DIPM1dVdMpNJR8kVhcIsJHboxj/NdvG8ZW1q0SGEsue9y2XWkpJ3N 7H/SbXrtyoSitBaVA7Xa9lSVcFQGNB5LYyV4nDxAL++echfIUA8c6nPgKSSaKKeR3ANr UCUw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MK5Kv2uWqsB5YL8yFkCouil2yDClyfHbdhXn70TPjw0=; b=D0/AUhgMAzX/n69xV3LzZRaMs7YK41v2B2Av1Z+mqTuv5TR5GUClQONGcz2zQpZ2Jk movAlrxPsbTSU08GCJ2BjX8JtUkW9ETtXfVXf/6bDfznva4ryJXCsMueikzdI6hlcIeq N5lJAAALmjhP/OMOObGIqJnCY24gnUfqH7XVprksp3sIQ9h/0T3SEggi632P/riMeoJq 45hIFd4Z3Z4Cz2YHcWgfCC5f85l7odHuoNx787pLi/g9znIKAKLc7ncx49FIwt8JHoE9 9I0HjojujkG5X2fxY++SG1HWTvO4pKOc7B4kE7OyoRlR6+C9dtiezkvrNScMZijnejoc JK2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si47536095pll.132.2019.04.16.08.14.23; Tue, 16 Apr 2019 08:14:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727037AbfDPPNt (ORCPT + 99 others); Tue, 16 Apr 2019 11:13:49 -0400 Received: from www62.your-server.de ([213.133.104.62]:55460 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbfDPPNt (ORCPT ); Tue, 16 Apr 2019 11:13:49 -0400 Received: from [78.46.172.2] (helo=sslproxy05.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1hGPKD-0005C2-DS; Tue, 16 Apr 2019 16:44:41 +0200 Received: from [178.197.249.32] (helo=linux.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1hGPKD-000AUB-4e; Tue, 16 Apr 2019 16:44:41 +0200 Subject: Re: BPF RNG To: Kees Cook Cc: Hannes Frederic Sowa , LKML , Ingo Molnar , "Reshetova, Elena" , Alexei Starovoitov References: From: Daniel Borkmann Message-ID: <40a6486d-2dba-5574-06da-3e0ebb25f2b1@iogearbox.net> Date: Tue, 16 Apr 2019 16:44:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.3/25421/Tue Apr 16 09:57:17 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/16/2019 03:55 PM, Kees Cook wrote: > [correcting Alexei's email address and resending...] > > On Tue, Apr 16, 2019 at 8:54 AM Kees Cook wrote: >> >> Hi, >> >> In looking at prandom_u32() users, I noticed that BPF uses its own >> state variable with bpf_user_rnd_u32(). It appears that this state is Correct, we split that off from the main one. >> never reseeded like regular prandom_u32(). (See __prandom_timer().) Is >> this intentional, or should reseeding be happening? The prng is not to be used in any security-critical context. That said, we optionally could perform reseeding from time to time, though that should probably be done generically, so that all "external" prandom_u32_state() users could register themselves upon init whether they opt-in for periodic reseeding or not. Thanks, Daniel