From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F4C9C54E4A for ; Thu, 7 Mar 2024 19:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MRTsCRUMkBc6mZlA8UwKKDKJ3DEUtHSV7rbItWtpO4Q=; b=WFjSZb46tMhNsW ZrTNa+SpDc9UYwkPng5+EPdl1hpH7W4fQg6Rb6YIGu0qXWEpdEbQJZkOqQRSea4VeO+6Mzscv9gnX trJTAkyEv7XoHKbclFRL0HmlanWNQUPfPDgzA8G+zRXifDnfk9ZrumnCrJKcCnt9LeB4Z1SCjdXbh NdpP7AYHnA0zDFPrvDBd6VC/TsL01PVmk4MSp5wzT6+3/wPNjI5USTNQSePRBKKcQDE8dweb0k30O sCMvoVfJnelb9nAtNyCcAl0eW87Ovrm/7K1ASex7TC77kubXSIkf0ZSvJTdKb0ArEh38H+ZYuoIeG V6u76DpMNXtRy+rDTuCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1riJ8n-000000060dy-1fdu; Thu, 07 Mar 2024 19:10:53 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1riJ8j-000000060cF-35Vn for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 19:10:51 +0000 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6e56787e691so1693386b3a.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=lists.infradead.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=TDAtCj+a8MvdD0716tLThW+F5DvsYTBIZpfBKejRm9x3B7XcvQpvF+2MWoxsT/v8Gn Uc1VGzV72uc3mysRMmT0LIyICEioSdD8xOo2xOXZsGij1d01FE4NUyZbOjZBBMMwFq8q KFmDWkC6pR60lLvLEREJ8tnXFDuBC1TZcdRGU= 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=aHggOfcLTyhSpL6Nv7vy5jwHkLBgYCpMcUEKJ6ICeQrVKhyRgoYROMiE1occ/X+/fx lfxZTC7NGhw5ibptVblWHgkm8gWA9Jg1zFKQtYyotkBPYJpa2M5mYaJujhyLtC0PyocE MOnJXXrWGRBr4fTlj4zRMI6cOCaChSoFnQkmrBgXreIILSNN+99AdGSqhLUf6I5ZX1Yn K2G5hWopHjeHqYHNmHcydR/RFaFWvFxGJKfqdutgusfyQ1S/iUAgnc77lquFvPWOtZys nehdGQ9qXrAJvt8k2YArwJQYLBIAQKs3qQfKIt/JzfwNFD6Li6Fryiwv5CDMbDWVJCOk 07og== X-Forwarded-Encrypted: i=1; AJvYcCVJXcZMrJtK+XPPm8pJaem/og5UjX1J9C7FLadWoFT9U7wGUS4h+t/55Q5I2ZM/xLaH3w4dDDSyg//jYpSEqf+DGDkrmcP2BH1UTDEm7IH4JV08Fa4= X-Gm-Message-State: AOJu0Yx0gDaNKiy6F57JCczonsr0FMwduhXJh8ffHVkfZ4gDanH9BkUi OTrdJZkQ5kpQXJDjbcIbs3Bxqt6DItgxqGgxqo+uLJ0on5OeifopeZUWJuqQzw== X-Google-Smtp-Source: AGHT+IFN6Sz1G8Qiw0tjzpneM1RD2JAmKvXtZLyGSb+PlWyD/N9lVUXVr/U3iktkEiuQ0N39CeDwsA== 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240307_111049_879595_D8D1EA1C X-CRM114-Status: GOOD ( 12.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel