Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3046912lqo; Tue, 21 May 2024 05:32:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVbWLyLlNH5VE69eLcc76QtOrPNvpzlFt9Mg9xu4hknLkiDni1ZnpLD8tHOoQVb+N3kFp5LAdvvNTzJhralE8GS8vFvVNouNH10AV1kQ== X-Google-Smtp-Source: AGHT+IGqSa7UX2VKpKsVXthHWrdcN/JYuk22CEwAxCJuej241DMein2tUZKbdunfkBtJhEIgqDS/ X-Received: by 2002:a05:622a:1827:b0:43a:1d94:c573 with SMTP id d75a77b69052e-43f7a2c8979mr171096571cf.22.1716294769436; Tue, 21 May 2024 05:32:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716294769; cv=pass; d=google.com; s=arc-20160816; b=xFq/WJYw6eem/yzbOGBDjH/m8Mr8NhxEtWyRRnyXIMWnNXUA8irY79XwNoUSUZEeQf bE4iGOgmZWkiYmKsN4Bt77tSUqXHwsckFzP+esdonxARA3RqZJAkZyBIg0PMfWCmuEZh 2rng4cNCMRPE72OuuD0JCIE3qK6pPRT7XtD97v4ICJdKxQHQ+9vXix7UcU3gBP+QHJj1 xtOt18X0jSHU5Xa5DzId67MT7MDWob8lC9XBH6fOQEWyFRZkoeEIhQujCj2d+TF6Y6x0 dOGXbWW4XUcCrL7+PIX50ZsmX1+rcLcfDhEe74v0xgdxdM4TiHs69YmIXt4EP5MbdW9x Y9UQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bOeW+XNOZlEkfc+I6ht2irFCJlPanLIdFnPaPKj/f3k=; fh=XwqqVc9WuurAdnQatJFEmhIrbnuvMoscY6QOpXw74yA=; b=jt37qENmdJQaRVroqdRzFQZyYSABepSDWvz/qpEwZpEnYl8w6CInk+BL8q6qwpY5Xw /r9UsxiFWjT/+N39dQj9+wV782AWUcd3U9yehT7l4ux3wAhMX5QsQhXPg+EWux+tpanc z76df+XDkUbDDCcAFO49LH6N0GG3m6Ur28597iEJkxHEacdF899RmGqSPuOzWCvZ1hjA 5auf+sExPAz2K3CYe0ElFt/Yr3O1dcVyNqCeLUUSRtkTarHzujQf0CLZbbpJQkP7QYFz FyAIo5zcLq16Zok1DW6WV8zXOOB4iuDCTo9Rj3G05BLAbEH4oBV+ppRoqZ0He3yXuOAO x/RQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=csNPwieI; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-184951-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43f7cabe661si26282821cf.358.2024.05.21.05.32.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 05:32:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184951-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=csNPwieI; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-184951-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 65C831C21737 for ; Tue, 21 May 2024 12:32:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90DD0770EA; Tue, 21 May 2024 12:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="csNPwieI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C09776F1B; Tue, 21 May 2024 12:32:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716294745; cv=none; b=HhOhRSr5oLRpmj8Ez5WYUIqpqf0GFE3rQ+zQmVgoUTu5BSSblET2i/ljNtRbWqpc7jsCBnYFlyUk6lq04FERz8GmJp2V9UlPsItriionavqYuPTnSG3CREGjU20deOHc14KUTB1JVJMHh44LtpznXS9RuwMCmJLhnwdiz5iGnCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716294745; c=relaxed/simple; bh=lJH99oEfELQo4YpxFi9oSnZr1WynJ4J1GXjG73y39yc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hqgz6LLFDR+BPP7NQSa/QuE9QQXLHOUJOsFHV72aRNz4aF6ohCIfv2wBiupTYxv6aVpZw5/DZ2nQInjLHDeeebtLM474cTpe12MIljnlJWBPeKD8SXIt02GaQSbcz9Vzt6w/9adBmDcNxxh0hBKXsz4C1y+q8xgoaKIqxoSWl0Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b=csNPwieI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C906C2BD11; Tue, 21 May 2024 12:32:24 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="csNPwieI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1716294742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bOeW+XNOZlEkfc+I6ht2irFCJlPanLIdFnPaPKj/f3k=; b=csNPwieIdOzQfSLoGZnqiMjjip5EKQIo/6RLLoUAwB2Pyn95T9sN0R5Ak8dLeh6VaBLN1r DPwt+3zJpLFN1u5NTarkvpU7OBxK6L42JOrNeYQKkpgvGYcSCekH8XYmIzfuVYjoWCwfoF X05lwNv9Zw8+7LDYV+W8AqALn3N4Srs= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 88714705 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 21 May 2024 12:32:22 +0000 (UTC) Date: Tue, 21 May 2024 14:32:20 +0200 From: "Jason A. Donenfeld" To: Florian Weimer Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, tglx@linutronix.de, adhemerval.zanella@linaro.org Subject: Re: [PATCH v15 2/5] random: add vgetrandom_alloc() syscall Message-ID: References: <20240521111958.2384173-1-Jason@zx2c4.com> <20240521111958.2384173-3-Jason@zx2c4.com> <87msoj5qth.fsf@oldenburg.str.redhat.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87msoj5qth.fsf@oldenburg.str.redhat.com> On Tue, May 21, 2024 at 01:48:10PM +0200, Florian Weimer wrote: > * Jason A. Donenfeld: > > > Libc is expected to allocate a chunk of these on first use, and then > > dole them out to threads as they're created, allocating more when > > needed. The returned address of the first state may be passed to > > munmap(2) with a length of `num * size_per_each`, in order to deallocate > > the memory. > > I think “first use” actually means “processs start” here? We don't have > a way to report failure from arc4random and similar interfaces. First use, actually. On failure this just falls back to slow syscall getrandom() with identical semantics. Adhemerval has a branch of libc where he implemented this, if you're interested. He's in CC to send the link. Jason