From nobody Thu Feb 29 00:24:32 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 4TlX691tt9z5Chpl; Thu, 29 Feb 2024 00:24:33 +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 4TlX690brfz53v0; Thu, 29 Feb 2024 00:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709166273; 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=Nqr++lQLqne/xURadxtowdFlxGsqF1wWrfD6d0jRwYc=; b=dZv5jiAOM+Zq84YPadloNHQvn4SxlLX5kYZ2m23xAZa7t2MCis9ezC+L1ZNcZaMJaFoUB3 axsfzHNnRlEQxG+joxSzirrEXOPGJIo2cw+ooFa6E1+sD5E2rgDOWw9vkWB+juVq9LSiZk iJiD26UqNjbAmBYx0oAbLYSt5tfB3HcYaLLParQMrBiVDr403acfTlBT13xTv+3SR/p4xW O3Mrrb/TgwKY5WXmlQwhpzQJsg1WD1xMfVwBTE7b/ZlOtsbVHwkiEiQhjw9K+LHefZMlZb HafNzKBoFYMefTbeSFfKCvVfKVsXiJg3nQx0vxHuyl31q8o1a0JdNRxteaYKXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709166273; a=rsa-sha256; cv=none; b=n2btqmQ/z476ZdCZmorfNeGUhL5S+H1hvOYnQFS54J9ZfeNl4BrFY9QrzrhHEm6ey2TqhA 6x6UJnwz6JvXG9JdoFyXhkzXjuRYoYxJ7njs7ubZCyPsxsxoraORl/jWD928w1wuymkdxc Vu33NWNx8Xc5Kfl4S0pLkVhO36Qn1+roZkbjI5ezOm6WKk5qumFLGgHjXGCdtYT2Pt6Ilg YSfiDw7f9QoBxWkVR0rIt0Z0NEbrE0R3TqPSPFeGd4m5NNTpNLOSTe7J1Ou0uCwZeCgWHd W3jHPwXTzY3DeJEWUkQPrHj9BjsjpexkwQOrF2PL5M2Z+M+htTMEcq5EVQSRvw== 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=1709166273; 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=Nqr++lQLqne/xURadxtowdFlxGsqF1wWrfD6d0jRwYc=; b=Wj5I3hm17Ccgw4RSvcbxS/r6yuTtY6L0H1vA5rWP96XgQVeTMcT3ZNu42W/frmFaj8qJcC X1lF6P9orAbMXZjARpZYIpqp3XPlHmBCAVE37VBFDtPr3bOocjSL4FuC1v4iL6LBHLcQjO cD2AvDM+vahd1n7E9+ku+e2UTMfGijIw/pFabSiEgPWQy3fGLx/dbHTqX0OgwjZc0CrnaH cMlFdG9N9K7VnE29J7VWMauIjh8csuZ+tfFIc1b+5hII/IZtG03vCqEMVfqQvwfIwqCztM SYhalKjevdsbp8GVk4JwdelbcrJGVuDcUh44zQf8DrAzJ5teKwnrpB1lBmBkjQ== 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 4TlX6900jJzJny; Thu, 29 Feb 2024 00:24:33 +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 41T0OWSL096299; Thu, 29 Feb 2024 00:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41T0OWos096296; Thu, 29 Feb 2024 00:24:32 GMT (envelope-from git) Date: Thu, 29 Feb 2024 00:24:32 GMT Message-Id: <202402290024.41T0OWos096296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 38595c9d739b - stable/14 - linux_pwd_onexec: do not abort image activation if emul path does not exist 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 38595c9d739bf69ff1270e575b1cbdcfe47284a7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=38595c9d739bf69ff1270e575b1cbdcfe47284a7 commit 38595c9d739bf69ff1270e575b1cbdcfe47284a7 Author: Konstantin Belousov AuthorDate: 2024-02-10 05:02:18 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-29 00:24:06 +0000 linux_pwd_onexec: do not abort image activation if emul path does not exist (cherry picked from commit 99fa799a19abeb70b1034f65407c276b64709bdc) --- sys/compat/linux/linux_util.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index 020eb57ea68e..e0c010cb5e48 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -79,22 +79,14 @@ int linux_pwd_onexec(struct thread *td) { struct nameidata nd; - struct pwd *pwd; int error; NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path); error = namei(&nd); if (error != 0) { - /* - * Do not bother if we are in chroot or jail. - */ - pwd = pwd_hold(td); - if (pwd->pwd_rdir != rootvnode) { - pwd_drop(pwd); - return (0); - } - pwd_drop(pwd); - return (error); + /* Do not prevent execution if altroot is non-existent. */ + pwd_altroot(td, NULL); + return (0); } NDFREE_PNBUF(&nd); pwd_altroot(td, nd.ni_vp);