From nobody Thu Feb 23 13:34:41 2023 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 4PMvC61WTvz3tkQJ for ; Thu, 23 Feb 2023 13:34:42 +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 4PMvC56Hvvz4Gbv for ; Thu, 23 Feb 2023 13:34:41 +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=1677159281; 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=Q8XVdpgUs+9ZVTOzDVV5+4qp1w5toNHp9EILIu2J6XA=; b=hWPMw2GODyicc5m6KMZQ/5oc3NsxiDQLjColQfPI+wwvx5IyHHdetFcKAGhkBSlztD/p53 no+Nj+xrGPekIUzW3opS4Nhc5E7OufA8rx1TO34+CCe/pCTftbSlrQNjSCHd5QFy7ngGNw mdS1yE+jWHBj2rom170lQ0KoQweudsp1l9lLsJLdW1TnU7m33pxNQm33xHhPqoFpecyvL5 95nb1xQ1wBZ6ZDZgTCL0SVtpOT16uWDH+iKndo466FrZKA3DbRsNnY3fMDIwrhtwTD/+oH cHD+7lzhjZ8XJXegJxJ/21Yao7h4mnm8eLeULu8LNSy7C8sKiA8dp+fjGvMxVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677159281; a=rsa-sha256; cv=none; b=fFpyhGr7qgp61leowlWNMWr1mQWEReYpLxusXsQR/yF5wZzMm5dgKik89EqgpKmrnLvGQ1 EpgjYrJ8b1GMPN0sn2ERlmK0tN6WkKfbY6mk849jqcMZ2B73q+LI+ZSy9pvrU1WhRcUGTI A8utEPv15zpTYygoiP/eNz2Q7FSGzNcWDxuL81FXoOW0iuMurmVfKbDjgd+LnSZb4Oz6Ii utcbEcyxEr07cHXR+OgfkoLmN6vYaCyOkdmBn6E5jH+/0VF88kkQOhLFuU+SWKwYhOfjjZ dltprM2KgETUc2iCKB5FV6GFqCSQi8DwtXPI/om4MHaDvAC4hvK0TCaCnlrj7g== 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 4PMvC55GXCzkJy for ; Thu, 23 Feb 2023 13:34:41 +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 31NDYfGi007903 for ; Thu, 23 Feb 2023 13:34:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 31NDYfUU007902 for bugs@FreeBSD.org; Thu, 23 Feb 2023 13:34:41 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 269780] O_RESOLVE_BENEATH succeeds on ".." on "/" Date: Thu, 23 Feb 2023 13:34:41 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dev@sunfishcode.online 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269780 Bug ID: 269780 Summary: O_RESOLVE_BENEATH succeeds on ".." on "/" Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: dev@sunfishcode.online Thanks for adding the O_RESOLVE_BENEATH flag [0]. I do have one report of surprising behavior with it. It seems that opening = ".." with a base fd referencing "/" succeeds. This is understandable, because ".= ." in the root directory refers to the root directory, and indeed it's not out= side the base fd in that case. However, use cases for O_RESOLVE_BENEATH would be better served by having an open of ".." with a base fd of the root directory fail. If one has path str= ings coming from an untrusted source, one wouldn't want the source to be able to tell where the base is in the overall filesystem namespace. If opening ".."= at the top level succeeds, that reveals that the base directory is in fact the root directory. For comparison, Linux's openat2's RESOLVE_BENEATH flag fails on ".." at the root. [0]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D248335 --=20 You are receiving this mail because: You are the assignee for the bug.=