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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09B46C07545 for ; Wed, 25 Oct 2023 20:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbjJYUNG convert rfc822-to-8bit (ORCPT ); Wed, 25 Oct 2023 16:13:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjJYUNF (ORCPT ); Wed, 25 Oct 2023 16:13:05 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB395192 for ; Wed, 25 Oct 2023 13:13:02 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id AFB80622F589; Wed, 25 Oct 2023 22:13:01 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iN3NeRnDa_0H; Wed, 25 Oct 2023 22:13:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 4A2D8622F58A; Wed, 25 Oct 2023 22:13:01 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vmC9xltJM6QH; Wed, 25 Oct 2023 22:13:01 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 23623622F589; Wed, 25 Oct 2023 22:13:01 +0200 (CEST) Date: Wed, 25 Oct 2023 22:13:00 +0200 (CEST) From: Richard Weinberger To: Petr Vorel Cc: linux-nfs , Steve Dickson Message-ID: <857096093.3016.1698264780882.JavaMail.zimbra@nod.at> In-Reply-To: <20231025194701.456031-1-pvorel@suse.cz> References: <20231025194701.456031-1-pvorel@suse.cz> Subject: Re: [PATCH 0/3] Add getrandom() fallback, cleanup headers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: Add getrandom() fallback, cleanup headers Thread-Index: Bpx3skmGDG7VX5pK6h7r55kvR0ekAA== Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "Petr Vorel" > I also wonder why getrandom() syscall does not called with GRND_NONBLOCK > flag. Is it ok/needed to block? With GRND_NONBLOCK it would return EAGAIN if not enough randomness is ready. How to handle this then? Aborting the start of the daemon? Before we other think the whole thing, the sole purpose of the getrandom() call is seeding libc's PRNG with srand() to give every waiter a different amount of sleep time upon concurrent database access. See wait_for_dbaccess() and handling of SQLITE_LOCKED. I'm pretty sure instead of seeding from getrandom() we can also use the current time or read a few bytes from /dev/urandom. Just make sure that every user of sqlite_plug_init() has a different seed. Thanks, //richard