From nobody Sat Oct 9 19:32:05 2021 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 2C91D12DEA7D; Sat, 9 Oct 2021 19: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 4HRZvB0bLlz4TF3; Sat, 9 Oct 2021 19:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 E9B6E20385; Sat, 9 Oct 2021 19:32:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 199JW5XE097483; Sat, 9 Oct 2021 19:32:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 199JW55r097482; Sat, 9 Oct 2021 19:32:05 GMT (envelope-from git) Date: Sat, 9 Oct 2021 19:32:05 GMT Message-Id: <202110091932.199JW55r097482@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: 5fb54d2fc845 - main - readlinkat(2): allow O_PATH fd 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: 5fb54d2fc845464ea809e6a1a69380693943cf51 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5fb54d2fc845464ea809e6a1a69380693943cf51 commit 5fb54d2fc845464ea809e6a1a69380693943cf51 Author: Konstantin Belousov AuthorDate: 2021-10-09 05:12:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-09 19:31:37 +0000 readlinkat(2): allow O_PATH fd PR: 258856 Reported by: ashish Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32390 --- lib/libc/sys/open.2 | 5 +++-- sys/kern/vfs_syscalls.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 5a6f161291f6..da42c238a151 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd May 6, 2021 +.Dd October 9, 2021 .Dt OPEN 2 .Os .Sh NAME @@ -327,7 +327,7 @@ and others. The other functionality of the returned file descriptor is limited to the descriptor-level operations. It can be used for -.Bl -tag -width SCM_RIGHTS -offset indent -compact +.Bl -tag -width readlinkat(2) -offset indent -compact .It Xr fcntl 2 but advisory locking is not allowed .It Xr dup 2 @@ -346,6 +346,7 @@ message .It Xr kqueue 2 using for .Dv EVFILT_VNODE +.It Xr readlinkat 2 .El But operations like .Xr read 2 , diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index bd496db50e99..1b355eea7d6a 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2640,8 +2640,8 @@ kern_readlinkat(struct thread *td, int fd, const char *path, if (count > IOSIZE_MAX) return (EINVAL); - NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, - pathseg, path, fd, td); + NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1 | + EMPTYPATH, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error);