From owner-svn-src-head@freebsd.org Tue Dec 11 02:48:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66406131427A; Tue, 11 Dec 2018 02:48:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C1547DCD1; Tue, 11 Dec 2018 02:48:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF6E828FC7; Tue, 11 Dec 2018 02:48:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBB2mnir043032; Tue, 11 Dec 2018 02:48:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBB2mnEL043030; Tue, 11 Dec 2018 02:48:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812110248.wBB2mnEL043030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Dec 2018 02:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341809 - in head: lib/libc/sys sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern X-SVN-Commit-Revision: 341809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C1547DCD1 X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2018 02:48:50 -0000 Author: kib Date: Tue Dec 11 02:48:49 2018 New Revision: 341809 URL: https://svnweb.freebsd.org/changeset/base/341809 Log: Remove special case handling for getfhat(fd, NULL, handle). There is no reason for it to behave differently from openat(fd, NULL). Also the handling did not worked because the substituted path was from the system address space, causing EFAULT. Submitted by: Jack Halford MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18501 Modified: head/lib/libc/sys/getfh.2 head/sys/kern/vfs_syscalls.c Modified: head/lib/libc/sys/getfh.2 ============================================================================== --- head/lib/libc/sys/getfh.2 Tue Dec 11 02:16:27 2018 (r341808) +++ head/lib/libc/sys/getfh.2 Tue Dec 11 02:48:49 2018 (r341809) @@ -29,7 +29,7 @@ .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd December 7, 2018 +.Dd December 11, 2018 .Dt GETFH 2 .Os .Sh NAME @@ -76,12 +76,12 @@ and .Fn lgetfh except when the .Fa path -specifies a relative or NULL path, or the +specifies a relative path, or the .Dv AT_BENEATH flag is provided. For .Fn getfhat -and relative or NULL +and relative .Fa path , the status is retrieved from a file relative to the directory associated with the file descriptor Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Dec 11 02:16:27 2018 (r341808) +++ head/sys/kern/vfs_syscalls.c Tue Dec 11 02:48:49 2018 (r341809) @@ -4196,8 +4196,8 @@ sys_getfhat(struct thread *td, struct getfhat_args *ua if ((uap->flags & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0) return (EINVAL); - return (kern_getfhat(td, uap->flags, uap->fd, uap->path ? uap->path : ".", - UIO_USERSPACE, uap->fhp)); + return (kern_getfhat(td, uap->flags, uap->fd, uap->path, UIO_USERSPACE, + uap->fhp)); } static int