Invalid access modes aren't properly handled in FreeBSD, so feeding in a valid like -1 won't result in a failed call. Fix: Patch attached with submission follows: How-To-Repeat: access("/", -1);
Just as a note: I need to add something to the manpage for all affected system calls for this; mknodat and a few other system calls will need manpage updates .. need to evaluate all of the system calls to get a full list of everything affected. Thanks! -Garrett
On Fri, Apr 18, 2014 at 10:18 AM, Garrett Cooper <yaneurabeya@gmail.com> wrote: > Just as a note: I need to add something to the manpage for all > affected system calls for this; mknodat and a few other system calls > will need manpage updates .. need to evaluate all of the system calls > to get a full list of everything affected. And one more thing: fixing this will make FreeBSD more POSIX compliant with this system call ( http://pubs.opengroup.org/onlinepubs/009695299/functions/access.html ), will match the behavior on Linux and NetBSD at least: The access() function may fail if: [EINVAL]The value of the amode argument is invalid. Thanks! -Garrett
A commit references this bug: Author: ngie Date: Mon Sep 15 18:41:51 UTC 2014 New revision: 271639 URL: http://svnweb.freebsd.org/changeset/base/271639 Log: Validate the mode argument in access, eaccess, and faccessat for optional POSIX compliance and to improve compatibility with Linux and NetBSD The issue was identified with lib/libc/sys/t_access:access_inval from NetBSD Update the manpage accordingly PR: 181155 Reviewed by: jilles (code), jmmv (code), wblock (manpage), wollman (code) MFC after: 4 weeks Phabric: D678 (code), D786 (manpage) Sponsored by: EMC / Isilon Storage Division Changes: user/ngie/add-pjdfstest/lib/libc/sys/access.2 user/ngie/add-pjdfstest/sys/kern/vfs_syscalls.c
A commit references this bug: Author: ngie Date: Mon Sep 15 18:43:57 UTC 2014 New revision: 271640 URL: http://svnweb.freebsd.org/changeset/base/271640 Log: Bump .Dd for the content change done in r271639 PR: 181155 Sponsored by: EMC / Isilon Storage Division Changes: user/ngie/add-pjdfstest/lib/libc/sys/access.2
A commit references this bug: Author: ngie Date: Tue Sep 16 00:56:48 UTC 2014 New revision: 271655 URL: http://svnweb.freebsd.org/changeset/base/271655 Log: Validate the mode argument in access, eaccess, and faccessat for optional POSIX compliance and to improve compatibility with Linux and NetBSD The issue was identified with lib/libc/sys/t_access:access_inval from NetBSD Update the manpage accordingly PR: 181155 Reviewed by: jilles (code), jmmv (code), wblock (manpage), wollman (code) MFC after: 4 weeks Phabric: D678 (code), D786 (manpage) Sponsored by: EMC / Isilon Storage Division Changes: head/lib/libc/sys/access.2 head/sys/kern/vfs_syscalls.c
A commit references this bug: Author: ngie Date: Tue Sep 16 00:59:08 UTC 2014 New revision: 271656 URL: http://svnweb.freebsd.org/changeset/base/271656 Log: Bump .Dd for the content change done to access(2) in r271655 PR: 181155 Sponsored by: EMC / Isilon Storage Division Changes: head/lib/libc/sys/access.2
A commit references this bug: Author: ngie Date: Tue Sep 16 00:59:57 UTC 2014 New revision: 271657 URL: http://svnweb.freebsd.org/changeset/base/271657 Log: Bump __FreeBSD_version for the change made in r271655 PR: 181155 Sponsored by: EMC / Isilon Storage Division Changes: head/sys/sys/param.h
It is likely inappropriate to MFC this, since it might break applications without much benefit for existing applications.
jilles requested for this commit to not be MFCed, and I agree. Marking the issue resolved.