Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp92474lqc; Thu, 7 Mar 2024 11:11:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX9zt+6Vy65A75LJhFZrHvcwEYwMbfEKqeT7KCBpx96IvlifJKO0eDRAC8bw7NQNWx2rDgnNLk8VLV/tnJENjQduYrmuI+g1AuK3ipfzQ== X-Google-Smtp-Source: AGHT+IE9V5VDKWJCpqTxtpYaN+ucv5AzaBu0gsxyIoNPO7hyGcwPGFxzrIQ0eA1NR+XXekGi/zDN X-Received: by 2002:a17:903:1d1:b0:1db:8d0a:cfa9 with SMTP id e17-20020a17090301d100b001db8d0acfa9mr3459340plh.6.1709838676215; Thu, 07 Mar 2024 11:11:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709838676; cv=pass; d=google.com; s=arc-20160816; b=ZEuNDjluYCJFyZyqvq9TmbRS9IEhaCCrapgOdzB3vFOHNb9fRaVfayvj2qQvxMtP7X kltKOCoVQ2fLOejCNV0DPyXLQZhqNjI50Pz+YkVeI/VPvlToKiKshy7rXiVVGqIBEY4r yFey2xGl2hIopT6ipXUU8T8HLG3UFjtG0gejE3+o5ofjrpAYH/6yEGgWGJAJFVXUWcqU q6esG/l4wfiuS/3J7mb2w03PDxIfnj1hBhv1WVlrAXB4oFQ7wMz1iZVdoApoSfoj6pZc 28zEGqYpKDNVuVlCGZUWvAl9rSnm1L3P52J3UQPYSL0uzM7pQnIw5VcIBStV+LtoZAHp 5GIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=q6/jADR/0UePn6YUf/L4DAbrCMU1cm50ZPRMKWLUirY=; fh=9jl9rashE+gPrSkOMNWJ3e937BU+FC2Eia/qC5LhHEg=; b=GzVi8GzOQqeAPqoUBGdQg6KancPiJrNSgSKB34M+MS9yXYVQzeG8zD08t44izc+a2q ch2K51Y/vAmU+1U8huu7MtyYJ3SnFGuJSBqw3tH73foAtfr8LyLl64IQEUQE5zeztHt+ cSf1TaMUKPiJpmU3ifaM0RoIeNbnuXpc2npzltXwp8nO8SIiLrwDHF0DnzfMRSjTT03x 8n5NBpztsWuRfDelvR5YLNN/inUgZKz00xXSZ25A7EBcxDwX/UgUP9tl+jbGQXc5LD7m 4yGTxCubuq9oCCRmBDXKOqjQAVaymfNRsMJGDxHQZxPI8Vyqjynl2ttoR+8VArdWMEZk vMJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="KGGKnv/8"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-96073-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96073-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u1-20020a170902e80100b001dcd0d28cc0si14616634plg.108.2024.03.07.11.11.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 11:11:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96073-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="KGGKnv/8"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-96073-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96073-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E172B282F34 for ; Thu, 7 Mar 2024 19:11:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50CE113665C; Thu, 7 Mar 2024 19:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KGGKnv/8" Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A29A135A7A for ; Thu, 7 Mar 2024 19:10:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709838650; cv=none; b=CqSOEfiQQxNiUWmsz0XERDC65HRXmDHMGaMmWHJtkC+O6r3yn5+/kIxGu9Wbq9cw46kNyD+B43TTN6TQuWYF3MlpD5+/4T5kp+TR6HtnfNRUaiWEwtgKd/uVbokabKvpDIwWER6BiwRxR9S79/FHqRZEga0PBQnGe8mUjvPdm1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709838650; c=relaxed/simple; bh=izSH/PMxUOlhLqiqWhtGUMGagmQW6jaoeudrrfnJ9Qo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ti22Y3pPQYbJ1p2rUdU1q0zRwp7u0kmK7jElfPmaJ3vfRMpslM0//MsG0FOF4cMxQfNKlQ3C2he5bE+M3DkIxwctC0urP1goei8wZ1WE/c/rt81EEO30ylOs8jg8j96c9wZ+oaivKoWtWaFia3lCrJPIEWzv3i9gAWLLU1DyEQk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=KGGKnv/8; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e5a232fe80so993939b3a.0 for ; Thu, 07 Mar 2024 11:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709838648; x=1710443448; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=q6/jADR/0UePn6YUf/L4DAbrCMU1cm50ZPRMKWLUirY=; b=KGGKnv/8YuctKrGXVQXW8dxWq8ftiGlZx51D84ZxcYEX42nz27+TWRx9Uh8mpm2tVH fnEjkQ28SUetzzWjr0Ouk1OG2F1J30fVbfy4gBafrf+QqGuTb++PJFj/cb6huPtBqXtu +h8BGP8cL6aEqg0eZlsINgnPvumAdxMCYiE4k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709838648; x=1710443448; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=q6/jADR/0UePn6YUf/L4DAbrCMU1cm50ZPRMKWLUirY=; b=tYscl5aiOFBrxnzn2L32j5kVs24PsA+XnSRzD5FygRBa2RbE7E227QCMUvODkmv64G 7U2JZfndrWEqy5QjqzUXmH3EjaVpliSaIj+Hz3JSsI9AaFnY1R7yxEpYNmAScVORHc6I gHrbz/bbWYJXUsx+Y5SqBtB9oRhGrKHgdiGw9LGoHECaIwoc2wymNA25d5eUDqWYkbWP HA7MzwHVz3v2pR+ZVya2vx8X0WFsAO1rSBRFi1HYCmzg3Z+9zIor6GA+J4p6F13vPIF/ +yU/O5+N8dEfSCJHgQsJBGn7LVXYhSiWX48Gk7tboqoMNNbafIesgiJkApviavUVckrX hs9A== X-Forwarded-Encrypted: i=1; AJvYcCUTqq2m8/4Sgo9C58IpMEq1HD8VRhcfON4CYUMT9glBJ+jY31/QHvLYo1LTUketeYWU2m6jx1pNtXCs6/2ZE2gFCrLD/7aoWmU9xe5b X-Gm-Message-State: AOJu0Yy+109rWwg7UCEqbN5LIiRj3k6efQtwcAzj8AaR8ONi+vZcnukL 6Qyw4pwTn9K2uSbaltjHI5+PEOkBURkYq2XK8ihb8HfiZKU/9LvjkaP4ybxdYg== X-Received: by 2002:a05:6a20:5498:b0:1a1:6914:6bc0 with SMTP id i24-20020a056a20549800b001a169146bc0mr3186404pzk.5.1709838648372; Thu, 07 Mar 2024 11:10:48 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id r11-20020a63ec4b000000b005d880b41598sm12872052pgj.94.2024.03.07.11.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 11:10:47 -0800 (PST) Date: Thu, 7 Mar 2024 11:10:47 -0800 From: Kees Cook To: Arnd Bergmann Cc: Jeremy Linton , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , "Jason A . Donenfeld" , "Gustavo A. R. Silva" , Mark Rutland , Steven Rostedt , Mark Brown , Guo Hui , Manoj.Iyer@arm.com, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, James Yang , Shiyou Huang Subject: Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization Message-ID: <202403071105.C3B038C@keescook> References: <20240305221824.3300322-1-jeremy.linton@arm.com> <20240305221824.3300322-2-jeremy.linton@arm.com> <202403051526.0BE26F99E@keescook> <34351804-ad1d-498f-932a-c1844b78589f@app.fastmail.com> <38f9541b-dd88-4d49-af3b-bc7880a4e2f4@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Mar 07, 2024 at 12:10:34PM +0100, Arnd Bergmann wrote: > For the strength, we have at least four options: > > - strong rng, most expensive > - your new prng, less strong but somewhat cheaper and/or more > predictable overhead > - cycle counter, cheap but probably even less strong, > needs architecture code. Are the low bits of a cycler counter really less safe than a deterministic pRNG? > - no rng, no overhead and no protection. For the pRNG, why not just add a reseed timer or something that'll happen outside the syscall window, if that's the concern about reseeding delay? (In which case, why not continue to use the strong rng?) -- Kees Cook