bionic/libc/arch-arm
Nick Kralevich 35778253a5 Fix "faccessat ignores flags"
The kernel system call faccessat() does not have any flags arguments,
so passing flags to the kernel is currently ignored.

Fix the kernel system call so that no flags argument is passed in.

Ensure that we don't support AT_SYMLINK_NOFOLLOW. This non-POSIX
(http://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html)
flag is a glibc extension, and has non-intuitive, error prone behavior.

For example, consider the following code:

  symlink("foo.is.dangling", "foo");
  if (faccessat(AT_FDCWD, "foo", R_OK, AT_SYMLINK_NOFOLLOW) == 0) {
    int fd = openat(AT_FDCWD, "foo", O_RDONLY | O_NOFOLLOW);
  }

The faccessat() call in glibc will return true, but an attempt to
open the dangling symlink will end up failing. GLIBC documents this
as returning the access mode of the symlink itself, which will
always return true for any symlink on Linux.

Some further discussions of this are at:

  * http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003617.html
  * http://permalink.gmane.org/gmane.linux.lib.musl.general/6952

AT_SYMLINK_NOFOLLOW seems broken by design. I suspect this is why this
function was never added to POSIX. (note that "access" is pretty much
broken by design too, since it introduces a race condition between
check and action). We shouldn't support this until it's clearly
documented by POSIX or we can have it produce intuitive results.

Don't support AT_EACCESS for now. Implementing it is complicated, and
pretty much useless on Android, since we don't have setuid binaries.
See http://git.musl-libc.org/cgit/musl/commit/?id=0a05eace163cee9b08571d2ff9d90f5e82d9c228
for how an implementation might look.

Bug: 18867827
Change-Id: I25b86c5020f3152ffa3ac3047f6c4152908d0e04
2015-02-24 13:40:43 -08:00
..
bionic Move the generic arm memcmp.S into the generic directory. 2014-12-15 11:06:34 -08:00
cortex-a7 libc/arm: add cortex-a7 cpu variant 2013-03-23 01:38:22 -07:00
cortex-a8 libc/arm: add cortex-a8 cpu variant 2013-05-15 20:13:28 -07:00
cortex-a9 Clean up <stdlib.h> slightly. 2015-01-26 14:28:41 -08:00
cortex-a15 Clean up <stdlib.h> slightly. 2015-01-26 14:28:41 -08:00
denver Move the generic arm memcmp.S into the generic directory. 2014-12-15 11:06:34 -08:00
generic Clean up <stdlib.h> slightly. 2015-01-26 14:28:41 -08:00
include/machine Add ARM_IRELATIVE relocation 2015-01-08 22:22:27 -08:00
krait Clean up <stdlib.h> slightly. 2015-01-26 14:28:41 -08:00
syscalls Fix "faccessat ignores flags" 2015-02-24 13:40:43 -08:00
arm.mk Fix memchr overflow. 2015-02-14 13:21:22 -08:00