From nobody Thu Feb 22 07:09:44 2024 X-Original-To: jail@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 4TgPQx0WQZz5C3pm for ; Thu, 22 Feb 2024 07:09:45 +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 4TgPQw5mbPz4NRg for ; Thu, 22 Feb 2024 07:09:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708585784; 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=983zoVspZsZG3mDP85ghx+NPMALa9z+u7/YcAPUAm4A=; b=U6XCkRXGjejWNMOKnYkMDm9+OCYMgwCyhual82h6JnxOVmJC9wj5PJNRM8N2mM0ipvyfTC B1c7p4PpLNRVUdBK5ixAG2Nef4K+jgyScFKkWloy/5Fj3T1VOdqlo9kMmxhz+k2qisK09X QNN//UkWXepvFIacBno7zH0oayubeLc3yza5iR6BCKa1iWHD/cAfcOhpH3Aj9uAS7XOXYv tcvfyMTBIAyTkY0RC92JgRseWYvcnHCnX0U0dDsQmFRb0uVbB3SMN0BWsZm32TOk0Sn4Ah P1J+zGp27NSEZE3radem7dQJyPbCeyjIxNMCguJxYFB41umgHUVG4HA2RbT69g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708585784; a=rsa-sha256; cv=none; b=Dh77Zqhm9e3HIMIpeZg1aOgodCulb3pXrIeC5i8rYCo6cWb9+ZtEGDJfzHYSQBWXnN2GER Yl1tguSNoTd9f5RShNigr1zrZWbSLNM0iU02E3WpAtoXrOYH2acruTeUXTxPyxZDdYRTLV YjDG51aaDcie/0StrZoTxVts5OBOUGma4flmoY+duOv4mEiRC1AU9WCLhG5MXMn8K/LaGN SCzFYbmvzlv+rq2J53IfCE4z86ObO43RVv2u2+CTtBwGTmjZdHgRQguqDjg4mbyzZYkrjd VZW4WZU1p8IOrTG2imK8jFStpiriy1mT4sfUCTbf9eW7Rz5fE4Ctx3G2d+OQMg== 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 4TgPQw4knzzM8R for ; Thu, 22 Feb 2024 07:09:44 +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 41M79iaJ069025 for ; Thu, 22 Feb 2024 07:09:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41M79io0069024 for jail@FreeBSD.org; Thu, 22 Feb 2024 07:09:44 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: jail@FreeBSD.org Subject: [Bug 277210] jail(8): exec.clean retrieves PWD from user info (can cause services to crash on jail start-up) Date: Thu, 22 Feb 2024 07:09:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: johannes.kunde@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: jail@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277210 --- Comment #6 from johannes.kunde@gmail.com --- (In reply to Jamie Gritton from comment #5) > While it does make sense to root from the jail's root under exec.clean, i= t unfortunately clashes with a decade of current practice. I get the idea. I believe it runs contrary to what most people expect to be= the outcome, which would be a behavior consistent with the host system. A servi= ce running inside a jail with a user other than root most likely doesn't want = to start at /root. > It seems reasonable that if a user is specified (even directly like -U ro= ot), then it would still chdir to its home, but in the absence of a user, s= tarting in "/" would in fact be the most expected outcome. That sounds reasonable. I think one of the main problems is also the lack of information when the problem occurs unexpectedly in the wild. All I got printed out from an exte= rnal library, which caused the issue in my case, was this line: > Feb 12 20:20:39 myjail myservice[9364]: 2024/02/12 20:20:39 stat .: permi= ssion denied Starting from there, it's almost impossible to have a clue what's going on. I don't know if there is any good chance to generate helpful output at runt= ime, but some hints in the manpage would help as well. --=20 You are receiving this mail because: You are the assignee for the bug.=