From nobody Sat Feb 26 00:39:12 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0045619E7407 for ; Sat, 26 Feb 2022 00:39:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K577N5KB5z4bv2 for ; Sat, 26 Feb 2022 00:39:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92DCF1741 for ; Sat, 26 Feb 2022 00:39:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 21Q0dC3O062733 for ; Sat, 26 Feb 2022 00:39:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 21Q0dCY1062732 for bugs@FreeBSD.org; Sat, 26 Feb 2022 00:39:12 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 262192] Crashes at boot with kern.random.initial_seeding.bypass_before_seeding=0 in randomdev_wait_until_seeded() Date: Sat, 26 Feb 2022 00:39:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: crash, needs-qa X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cem@freebsd.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: mfc-stable13? X-Bugzilla-Changed-Fields: flagtypes.name Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645835952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JqcrNmZOmj6SRWiqf8PM3ZqtSUSdTJyM6MdJI/UNJkQ=; b=Veyog4+AnDftR1qkfPxSS3h7hQXYFQ5npuAXnFmn+d/3oEUCNVrBIdAuTzq+6te+j2S/B7 zW6vs+1YZViEhArg3epLB8wLI1lAGqixi7K+GOnRojf5Msiel7Nwltal4dAeUmQ6H6nn3C 73EvZcR7rQ+9zdQiiAQ8Xu+Bk+AoPtx6qf7oBCWLw7LYzoZifthX4AtK2MHQ+qAPcraBo1 7sOnM0qU+25kN0ohuCPn2/sg5YGGqSxVVjoyxPDqhQ9skl38d2sgWeYFxmjdkmS1puv0ML 7xTYPBoxy7t0LhiALl2ANfCKdvPavIo/B5pZ+QMkHaQdcwOWidDMZs4mtQrU+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645835952; a=rsa-sha256; cv=none; b=Qh7AalhaUflVtHRBdZ2j48OMXrALthPy/yLM6URpYrieyVTH5Ll3zfiwaizLhTl3b+yzNd pA5uGaH3Fr+2ZKbM+SAxd+dmI7X+RX8eOl7gXjrRMPDIBUGg2LCHYtbJcvwn8BwizsbzaV x/kp+bvyBbZlrT6yQnxGlpBgGXqwmPRUEW89JJXckhw/uGFgsJNIpfTmxYNhA4a3JoWCB9 pJgpcOmfcGX48w7Wsm5gxNlWFR/DnE0iriNUf5B9t6c+vLFzakaCf9/zE21x+NGsZXeW4/ pegvs8kcyA8cp25pUDf82kaRM9mDFh4/KpqpxWVPWweSxPdg4G66zFKkEP6qbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262192 Conrad Meyer changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|maintainer-feedback?(cem@fr | |eebsd.org) | --- Comment #4 from Conrad Meyer --- I'm not really sure why tsleep() is panicing at that point. Presumably that initialization happens later in mi_startup. Your virtual hardware plus operating system configuration is resulting in a system that is not seeded by the time mi_startup hits __stack_chk_init (SI_SUB_RANDOM:SI_ORDER_ANY). This means that the system did not have any bootloader entropy (SI_SUB_RANDOM:SI_ORDER_FOURTH). __stack_chk_init happens very early, before random_kthread can run. So the system hasn't polled any "devices" for entropy, including RDRAND. First order fix is to figure out why you don't have /boot/entropy (or whate= ver) and fix that. (Most VMs don't have this problem.) Second order workaround= is to revert e199792d23341b0a887bf54c262147b213edd556 and set security.stack_protect.permit_nonrandom_cookies=3D1. This is practically s= imilar to not compiling in stackcookies at all. Third option is to set kern.random.initial_seeding.bypass_before_seeding=3D1. Could this be better? Sure. Chacha20_randomstir and/or read_random could attempt to manually poll available random sources (assuming any are loaded = and available!) during early boot if not yet seeded, or fetch jitter entropy (m= aybe not this early, though -- if tsleep is broken, jitter might be as well). K= yle Evans has expressed some interest in working on the latter. tsleep() could detect early boot and not panic instead of taking whatever uninitialized lo= ck it's taking. I don't plan to do any of that. --=20 You are receiving this mail because: You are the assignee for the bug.=