From nobody Tue Mar 26 02:09:27 2024 X-Original-To: dev-commits-src-all@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 4V3YCC62tXz5FnfF; Tue, 26 Mar 2024 02:09:27 +0000 (UTC) (envelope-from git@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 4V3YCC5dR2z4Z74; Tue, 26 Mar 2024 02:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711418967; 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; bh=v8y/Comi2w4qxan6lBYVEtRfR8GRstWonj0UGt6kumI=; b=PGk/43Qf2UyqvVaU3KHP6LJcY3tagWKpFuF2Gj33JX2vKbTlboNc+qZ95PZcG04FYKQdBq qjfjkMi3cr1gtptFCwCr8ZKcSpgpciNFjirypLd5UdgGa+VHQpnFJvOKRhDQCyqazmGNg0 ksBx+DhU0bEsDhOlp0pU6SuaKVufb1iuB8yYLo7cLQjOd9jLROw5R+FRnCFXEa4lXiwAYx FxUVofOSgzJhyk9MwpDKWrLqdgXqRMq5++GlhJoJhXtE/Tork1t2e/ROma2fnxVGHv16N7 GOPUNotIrvnMoafm4HL20OLzKGmRBMcLy/GbYbUSw9eP7Uoujp05qxBSQ4cFgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711418967; a=rsa-sha256; cv=none; b=AilSvdEso8jhanQa6f07XWVu9UHmSJ32PtInes/mVYnBUkTF0kTaZJBCcg/JHI12mONiVE rRZeKWAoPkCvZAdus0s6hIyNMiMfVsfXf9Zdf858GbNKze8p2GfiKcTKtHoIK81g08ShhC hcsJXikBx3hRaJ/w4t0/mYt/DRgEBOddiF18iffoywQKcfNQXivmWjPkuQCAoAPaspnONF 5tW/0FP5xvP6yhoWEkPSpg/UgWKPnmelZNIGdilMGT++VlCbAqyvF8rP24bQ+laU+YMe5G VamxfaQ7K3uclKylnuCqgzGp2pPrUz+FVN0A2kRzfx8w1wxo+r5ynNpUXvBdwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711418967; 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; bh=v8y/Comi2w4qxan6lBYVEtRfR8GRstWonj0UGt6kumI=; b=GJFossWNWw/9eVzs0vL+CbtgY9l5aEYFFQDeC8ljTs2dxEXo54eBOpfF0oqAGSt7XRtSKC 8MJB6frgtaq0RPjWN93kMfka9vpXr8GpoSr4fad7QGCxAiL99Eh1RrfYpaNeMM9HiCyNFy X2IwTMhXEaqgiN19OjxfUo5zyYEV9aik6A938k9VOW39ve9uR7ZaDcfFN3rSNwLFosrR6n VZNukPvoGR7NE1E8hZf4FIriKP+L9i+q9O5fKQrUky60K1HCdEoE/TTf3OUUvubBRNPfzA HBYZBAJCKu4UEvS70jni6FZITzlrQkaI42TEm97hkqyHl8Qw+mtUOHO8uIpLew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4V3YCC5FLHzh2W; Tue, 26 Mar 2024 02:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42Q29RWp013879; Tue, 26 Mar 2024 02:09:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42Q29RLt013876; Tue, 26 Mar 2024 02:09:27 GMT (envelope-from git) Date: Tue, 26 Mar 2024 02:09:27 GMT Message-Id: <202403260209.42Q29RLt013876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e0c92dd2b7e6 - main - amd64: initialize td_frame stack area for init(8) main thread List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0c92dd2b7e62e4f8281c9ad1d31465bb32f9e3b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e0c92dd2b7e62e4f8281c9ad1d31465bb32f9e3b commit e0c92dd2b7e62e4f8281c9ad1d31465bb32f9e3b Author: Konstantin Belousov AuthorDate: 2024-03-25 12:10:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-26 02:01:38 +0000 amd64: initialize td_frame stack area for init(8) main thread Unitialized td_frame mostly does not matter since all registers are overwritten on exec to activate init(8). Except PSL_T bit from the %rflags which might leak into fresh init as garbage, causing spurious SIGTRAPs delivered to init until first syscall is executed. Reviewed by: emaste, jhb, jhibbits Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44498 --- sys/kern/init_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 3df4b1edf4a2..3e4f19d655e6 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -784,6 +784,7 @@ start_init(void *dummy) */ KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); + memset(td->td_frame, 0, sizeof(*td->td_frame)); oldvmspace = p->p_vmspace; error = kern_execve(td, &args, NULL, oldvmspace); KASSERT(error != 0,