From nobody Fri Jun 17 19:36:51 2022 X-Original-To: dev-commits-src-branches@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 3C84785A3A8; Fri, 17 Jun 2022 19:36:52 +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 4LPq6q58Jbz3PJ9; Fri, 17 Jun 2022 19:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494612; 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=CBMtjguT1OTw2vTfu6UBWXALHnXcQ7VTk9LUCMkrv4k=; b=H4q7KI6zU6Eu4HXr4EqW44CqB2mjGZMpOH+HbC4QGcP8v6Su389p/9LllcP6W2Ybq7EURB G8uoJ0IBAM9UITfrre5TcFhe/6vjhFmiJTWIcYB1j4/OtwGbrF2SfCxxd6Rop6WN6h0Eb8 b22ITwpIxJnNr3DNLlwMmgnCcb/gVWP3eRj/HkNk08kzxqQDsLBuv0fps3BA68ijvlgVs/ LiYgv8XdUCA117NJQ/VuYDRarjA0hzeOiQna1zLTb0BaoLWu6JZ2qQ2Zc8xmQsayOLTfG5 5oQvy+8rfa89EFxjsRHRGab62sog9IMzmQuyClVriAcUP/EKq8E8SjTND+qJJg== 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 7781E25AAD; Fri, 17 Jun 2022 19:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJapMp012582; Fri, 17 Jun 2022 19:36:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJap8w012581; Fri, 17 Jun 2022 19:36:51 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:36:51 GMT Message-Id: <202206171936.25HJap8w012581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: fbed3bdfd4ca - stable/13 - Call sv_onexec hook after the process VA is created. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fbed3bdfd4ca06459590ad2b713a8b6eea53e832 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494612; 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=CBMtjguT1OTw2vTfu6UBWXALHnXcQ7VTk9LUCMkrv4k=; b=j+bFljru04Y5sm5aoroq2ATbRMwz2Anlc896eg2YhyoyVTntZWuN1P9vm2aMFbIXy7AuHr yir5IDfjHInWK+h2dR7xVzxMxDrKHVhniGme5YudLXqzFc3UocoSByTqZwO+q9YmVRE7sj 5EXs2rRwhbCufh7R3l4CMc7FPEq3oTQuEaaVPqWTDS6fB+oxxGi7LmYpMrb0NbVausu53E UnZkowyZbw1LXhIXcX4Pxw9n/dKaGM5A3OQdhixgVGdlqmCn9hCebmfmPndyr8LBgCLEL9 F9tYSrVyZLKdbc9pDb0L20KHJhY/8PSv40Bv93Ob9RLnwJop4IUhNUUbEo15MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494612; a=rsa-sha256; cv=none; b=IDTmCXY/Y4UfU04LT4GGeppm7CcfVL0ZlfKWOw1swb9QlEg1QEiGMqF/TZBS+U0oUNT4M5 OYjTntAnkniJjQGaCz+nwmi7GhW33ZQMwiNG0CQHqXn8oh+f2Km7oaZQRAtYTNKdtbcAob 71YOjiHAaEp/3/aLr0i8vIRdfsUdTH0jSg307PhOwG57OLxPCdEv8WQMC8P/Ls5Sr44jWO i6Qr9gahCf7W+urrnPCpEeKm/Sbp/2Noj16yRq7A2NlbAAixanjTCZ0GLeEwlmgzIfEnpq ZYEtD14SAKrgGQ3UxeZ+yczwVVcuzUm9EenlD8IYjfHYlzSBU+c38eoUirskkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fbed3bdfd4ca06459590ad2b713a8b6eea53e832 commit fbed3bdfd4ca06459590ad2b713a8b6eea53e832 Author: Dmitry Chagin AuthorDate: 2022-06-17 19:33:04 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:04 +0000 Call sv_onexec hook after the process VA is created. For future use in the Linux emulation layer call sv_onexec hook right after the new process address space is created. It's safe, as sv_onexec used only by Linux abi and linux_on_exec() does not depend on a state of process VA. Reviewed by: kib Differential revision: https://reviews.freebsd.org/D30899 MFC after: 2 weeks (cherry picked from commit 62ba4cd340670e901fbaab98766bd5490b4334bd) --- sys/kern/kern_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 9dbafe52119a..e6081cba7a4b 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1143,8 +1143,6 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) if (p->p_sysent->sv_onexec_old != NULL) p->p_sysent->sv_onexec_old(td); itimers_exec(p); - if (sv->sv_onexec != NULL) - sv->sv_onexec(p, imgp); EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); @@ -1198,6 +1196,8 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) } } + if (sv->sv_onexec != NULL) + sv->sv_onexec(p, imgp); return (0); }