From nobody Thu Feb 22 01:32:06 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 4TgFxL5Yp3z5BmXD; Thu, 22 Feb 2024 01:32:06 +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 4TgFxL56fcz4kRJ; Thu, 22 Feb 2024 01:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708565526; 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=fZasIXO8yrxggtCqMhTlitxkrz8DKhot5fzsxK87wBw=; b=hI0/OqM3hbnI2xU0F0yOrvfLuSXOIO056SMWrVD5C8bEMXo4yIEjJ72kwA8FsSfuXJSOyp dgdj4PiYSYP/FvRGEpFxphnE+4reL07ofA0AJEAT+pOOFB9bFgmc0nD6yQaHQt7I2lhYcV pYFC1A0Fg9caG1Sismd1CNfkcEXsALFz52ozRJ0WkkkF2pked+nSqTTRm4eBo9MFywx/i2 MjF/efv7EpeYEMce6mFh8Yx9Ti7Gln2IUTaw29TsnjTYvuHns7xGpwrTQoGHzvoGaOYCit xMMpaUt5RzWgqQPE9Sm9yMhcJaQbLBKGPma3tbZWHaVjlV8AbGoD38i/c6S9oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708565526; 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=fZasIXO8yrxggtCqMhTlitxkrz8DKhot5fzsxK87wBw=; b=TvcSszvo/bgrQCvcoL0qJz5Xwbu1uJPQk33wsEcLxbX0VQStGUdqqPWS/HGEuv5bPByGg9 jvAT3pRN+4mhyUaNXi0/wo3vg3PFcgb/DlQHFzPn9sn5bIc7KYkzdaP2jXGpaexl+DBeW1 O2s5sHIojf5dnb++mgnm1yKWuOoZ53U9GnxDmEsNtaMpFPUgYQGfM1Npqbmfy2yUi3bXnn ZnbNB9OkFnkKq33F8ScQgTxvmasisLgU2E4oH1CsFUP15C3YAkKBiCTVCsFbHDOYFLuAnP cfKDbJP2wP9Kr1kqWTLhnh6vtRqghMdvr2KES84M0uZN+etCQI6N/6XoqQCUog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708565526; a=rsa-sha256; cv=none; b=qANhTIfZjQp5OUK5uzrQnZSi/YmpC1MzOTQzaf4TiUJMithkHiK7cfjecOsLoudhpEUVp/ SFKDts2UGRAbdOSqfK2IHjIsPPEv/bTwaMGLerrxosITL9I0/0qCsYAIlwhqfaQs17GZ1D R9RKE4pxxVjWgqfa+xQz4AZXuXG5WkeFTT+mbvmtxeS7+IAvbC/d+qx4Ekm7ImibkgjiAh 1WhYRYx6rXqpmAMYceGiQ2BZ0tV1gsg+gde0AS1QE0FyaKAOrj9BsRTknkGWauBUbj/4BC kGMTATRVzk6P5WoSwf+9PeVLTRKRugU7hNoiRe/pWh4ocCIOSpea87bgGMdYHw== 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 4TgFxL4B34z1Qxc; Thu, 22 Feb 2024 01:32:06 +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 41M1W6Ma007148; Thu, 22 Feb 2024 01:32:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41M1W6ib007145; Thu, 22 Feb 2024 01:32:06 GMT (envelope-from git) Date: Thu, 22 Feb 2024 01:32:06 GMT Message-Id: <202402220132.41M1W6ib007145@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: 99fa799a19ab - main - 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/main X-Git-Reftype: branch X-Git-Commit: 99fa799a19abeb70b1034f65407c276b64709bdc Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=99fa799a19abeb70b1034f65407c276b64709bdc commit 99fa799a19abeb70b1034f65407c276b64709bdc Author: Konstantin Belousov AuthorDate: 2024-02-10 05:02:18 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-22 01:31:39 +0000 linux_pwd_onexec: do not abort image activation if emul path does not exist Instead clear the altroot, if any. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43833 --- 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);