| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Use same string functions for all MIPS architectures.
Bug: 21555893
(cherry picked from commit 38f2eaa07b0ad2e01a40607d3a0ac240ff53abbf)
Change-Id: I94521f023d0bb136a4672782148a9f6e77cc6f1e
|
|
|
|
|
|
| |
Bug: http://b/21858067
Change-Id: Iaa83a5e17cfff796aed4f641d0d14427614d9399
(cherry picked from commit b1304935b64ffcd59cd787cc9ac83a2d14dc587b)
|
|
|
|
|
|
| |
Bug: http://b/21857154
Change-Id: Ie1fb63f54c6c527b8c1172e8f6ce48f23fca9b41
(cherry picked from commit 469b418784a01c759a2ddd889437d6e6c18b256e)
|
|
|
|
|
|
| |
Bug: http://b/21761353
Change-Id: Ic8ef3f241d62d2a4271fbc783c8af50257bac498
(cherry picked from commit be57a40d2973739c4fb0aa1cfb0014f34aeec2bd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support O_PATH file descriptors when handling fgetxattr and fsetxattr.
This avoids requiring file read access to pull extended attributes.
This is needed to support O_PATH file descriptors when calling
SELinux's fgetfilecon() call. In particular, this allows the querying
and setting of SELinux file context by using something like the following
code:
int dirfd = open("/path/to/dir", O_DIRECTORY);
int fd = openat(dirfd, "file", O_PATH | O_NOFOLLOW);
char *context;
fgetfilecon(fd, &context);
This change was motivated by a comment in
https://android-review.googlesource.com/#/c/152680/1/toys/posix/ls.c
(cherrypicked from commit 2825f10b7f61558c264231a536cf3affc0d84204)
Change-Id: Ic0cdf9f9dd0e35a63b44a4c4a08400020041eddf
|
|
|
|
|
|
| |
Bug: 19358804
Change-Id: I38a53ad64c81d0eefdd1d24599e769fd8a477a56
(cherry picked from commit 40a8f214a5264efe5feaaffd55cea67fb87d097b)
|
|
|
|
|
| |
Bug: http://b/20339788
Change-Id: I2a8c7881f90a05ca768cb9b4c2f8b07c74c64469
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This doesn't affect code like Chrome that correctly ignores EINTR on
close, makes code that tries TEMP_FAILURE_RETRY work (where before it might
have closed a different fd and appeared to succeed, or had a bogus EBADF),
and makes "goto fail" code work (instead of mistakenly assuming that EINTR
means that the close failed).
Who loses? Anyone actively trying to detect that they caught a signal while
in close(2). I don't think those people exist, and I think they have better
alternatives available.
Bug: https://code.google.com/p/chromium/issues/detail?id=269623
Bug: http://b/20501816
Change-Id: I11e2f66532fe5d1b0082b2433212e24bdda8219b
|
|
|
|
|
|
| |
These should be in libcutils instead.
Change-Id: Ibbc94755e6da61bf9ce2c8f9a047a082bb9bce24
|
|
|
|
| |
Change-Id: Ib94c0abb6fc85126ecc5ed3f1962b2b8b90b9952
|
|
|
|
|
|
| |
Spotted while debugging the strace 4.10 upgrade.
Change-Id: I1af1be9c9440151f55f74a835e1df71529b0e4fe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Build was broken by:
https://android-review.googlesource.com/133834
Use <unistd.h> to get syscall().
Remove <asm/unistd.h>, it gets included through <sys/syscall.h>.
Change-Id: Id762f6dea5f9538c19b79cdd46deda978efd50fe
|
|
|
|
|
|
|
|
|
| |
The overflow's actually in the generic C implementation of memchr.
While I'm here, let's switch our generic memrchr to the OpenBSD version too.
Bug: https://code.google.com/p/android/issues/detail?id=147048
Change-Id: I296ae06a1ee196d2c77c95a22f11ee4d658962da
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In https://android-review.googlesource.com/#/c/127908/5/libc/SYSCALLS.TXT@116
Elliott said:
for LP64 these will be hidden. for LP32 we were cowards and left
them all public for compatibility (though i don't think we ever
dremeled to see whether it was needed). we don't have an easy
way to recognize additions, though, so we can't prevent adding
new turds.
Add a mechanism to prevent the adding of new turds, and use that
mechanism on the fchmod/fchmodat system calls.
Bug: 19233951
Change-Id: I98f98345970b631a379f348df57858f9fc3d57c0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many libc functions have an option to not follow symbolic
links. This is useful to avoid security sensitive code
from inadvertantly following attacker supplied symlinks
and taking inappropriate action on files it shouldn't.
For example, open() has O_NOFOLLOW, chown() has
lchown(), stat() has lstat(), etc.
There is no such equivalent function for chmod(), such as lchmod().
To address this, POSIX introduced fchmodat(AT_SYMLINK_NOFOLLOW),
which is intended to provide a way to perform a chmod operation
which doesn't follow symlinks.
Currently, the Linux kernel doesn't implement AT_SYMLINK_NOFOLLOW.
In GLIBC, attempting to use the AT_SYMLINK_NOFOLLOW flag causes
fchmodat to return ENOTSUP. Details are in "man fchmodat".
Bionic currently differs from GLIBC in that AT_SYMLINK_NOFOLLOW
is silently ignored and treated as if the flag wasn't present.
This patch provides a userspace implementation of
AT_SYMLINK_NOFOLLOW for bionic. Using open(O_PATH | O_NOFOLLOW),
we can provide a way to atomically change the permissions on
files without worrying about race conditions.
As part of this change, we add support for fchmod on O_PATH
file descriptors, because it's relatively straight forward
and could be useful in the future.
The basic idea behind this implementation comes from
https://sourceware.org/bugzilla/show_bug.cgi?id=14578 , specifically
comment #10.
Change-Id: I1eba0cdb2c509d9193ceecf28f13118188a3cfa7
|
|
|
|
|
|
|
|
|
| |
The kernel version of the stat structure is used during the syscalls. After the syscall,
the kernel stat structure is converted to match the generic one. Eventually we would like
the generic stat structure and related syscalls be added to MIPS64 kernel, removing the
thunks added to AOSP.
Change-Id: I7764e80278c1cc8254754c3531ec2dda7544a8ec
|
|
|
|
|
|
|
| |
Move various mips-only things into the arch-mips directory. As soon as mips
writes assembler replacements, we can remove these.
Change-Id: Ia7308559bc361f5c8df3e1d456b381865e060b93
|
|
|
|
|
|
|
| |
Interestingly, this mostly involves cleaning up our implementation of
various <string.h> functions.
Change-Id: Ifaef49b5cb997134f7bc0cc31bdac844bdb9e089
|
|
|
|
|
|
|
|
| |
Sgidefs.h is needed by strace.
Replaced now-duplicate arch-mips64/include directory
by symlink to arch-mips/include.
Change-Id: I7808602cfa452eca3ffbdb94903f4c5bdb33efa3
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: 18489947
Change-Id: I2e834d68bc10ca5fc7ebde047b517a3074179475
|
| |
| |
| |
| |
| | |
Bug: 16918359
Change-Id: I9033a7d178d431ddb09f1cfa6e4bf95ae02346e9
|
| |
| |
| |
| |
| |
| |
| | |
Imagination already did the work to make the contents of these directories
identical. Let's take advantage of that fact.
Change-Id: Ib101ba39041fb500c9c618fa2020e72aa2ccd9c2
|
| |
| |
| |
| |
| | |
Bug: 18546535
Change-Id: I479e003deab21e31eb5caa5393067ed1dc558387
|
|/
|
|
| |
Change-Id: Idcd13413520dd503bc9cf782553675313e500a83
|
|
|
|
|
|
|
|
| |
They'd drifted slightly which led to a compilation error in toybox,
which was assuming pid_t was defined. arm and arm64 were picking it
up via <endian.h> but x86 wasn't.
Change-Id: I58401e6c0066959dfc3b305b020876aaf7074bbf
|
|
|
|
| |
Change-Id: I687ff4ead6c5e81db44782bf851cb84f87bfe085
|
|
|
|
| |
Change-Id: If98b832ee32f6dcd9f5d7ae21c601c210adfad6b
|
|
|
|
| |
Change-Id: Ica1670e6d3d1b6b0c64df93720efa65586e67727
|
|
|
|
|
|
| |
Not very useful, but helps building stuff like toybox out of the box.
Change-Id: I110e39030452bd093a84278e019c5752d293718d
|
|
|
|
|
|
|
|
|
|
|
| |
Add the missing prototypes, fix the existing prototypes to use clockid_t
rather than int, fix clock_nanosleep's failure behavior, and add simple
tests.
Bug: 17644443
Bug: https://code.google.com/p/android/issues/detail?id=77372
Change-Id: I03fba369939403918abcabae9551a7123953d780
Signed-off-by: Haruki Hasegawa <h6a.h4i.0@gmail.com>
|
|
|
|
|
|
| |
__get_sp.S doesn't exist
Change-Id: Id84f8904c8022c683263a317a18fabeb50fed992
|
|
|
|
|
|
| |
Group things appropriately and name each group.
Change-Id: I0da45eb0ccde19c31d5e984d0e6eb3dad26630dc
|
|
|
|
|
|
|
| |
(cherry-pick of 00008263782e484020420c606f7d145fe7d0a4d8.)
Bug: 12449798
Change-Id: I07cbf3f670a0d1304b68148325a774f266b5c433
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The use of the .hidden directive to avoid going via the PLT for
__set_errno had the side-effect of actually making __set_errno
hidden (which is odd because assembler directives don't usually
affect symbols defined in a different file --- you can't even
create a weak reference to a symbol that's defined in a different
file).
This change switches the system call stubs over to a new always-hidden
__set_errno_internal and has a visible __set_errno on LP32 just for
binary compatibility with old NDK apps.
(cherry-pick of 7efad83d430f4d824f2aaa75edea5106f6ff8aae.)
Bug: 17423135
Change-Id: I6b6d7a05dda85f923d22e5ffd169a91e23499b7b
|
|
|
|
|
|
| |
This reverts commit e880c736d6c1d947f6309d5f1f63c74e8345c6a6.
Change-Id: Ide83e442eb5dbfef5298a15bc602c3fe1dda1862
|
|
|
|
|
|
|
| |
We want __libc_fini to be called after all the destructors.
Bug: 14611536
Change-Id: Ibb83a94436795ec178fd605fa531ac29608f4a3e
|
|
|
|
|
|
| |
The seventh argument for syscall is passed in a register, not on the stack
Change-Id: Idb69fac77d1f710cff5a3ab4ae1259feb61ae69d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)
It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.
This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.
Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Change-Id: I1d4dbffe7bc7bda1d353c3a295dbf68d29f63158
|
|
|
|
|
|
|
|
|
|
| |
Also remove declaration.
The only user is compiler-rt, and they can replace that call with one to
syscall(2). compiler-rt doesn't currently build on mips64 anyway.
Bug: 11156955
Change-Id: Ieae0ba49c8e7aa50253401fc1d7c2d17bc867d39
|
|
|
|
|
| |
Bug: 16872067
Change-Id: I2b622f252c21ce1b344c040f828ab3f4bf9b6c0a
|
|
|
|
|
|
|
| |
This fixes the build after the -Bsymbolic change.
Bug: 16853291
Change-Id: I989c9fec3c32e0289ea257a3bd2b7fd2709b6ce2
|
|
|
|
|
|
|
|
| |
We're getting cold feet on this one... let's put it back.
This reverts commit 210331d9762037afb9b5ed8413079c6f65872df9.
Change-Id: I6b0d3c2b1dbf7f1dc9566979a91b7504c2189269
|
|
|
|
| |
Change-Id: I1e5e50444a1b5a430ba5b5d9b8b1d91219af5e92
|
|
|
|
|
|
|
|
|
|
|
| |
Save and restore floating point registers via 64-bit
load/stores when possible. Use assembler's builtin macro
ops to generate pairs of 32-bit load/stores on Mips I cpus.
Some cpus or FR modes have only 16 even-numbered dp fp regs.
This is exposed by _MIPS_FPSET, defined by existing compilers.
Change-Id: I7f617a3ffea8da41c402ef3a68ab32c91d3d7622
|
|
|
|
| |
Change-Id: I5f43380b88d776a8bb607b47dbbc5db5a2fe6163
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In practice, with this implementation we never need to make a system call.
We get the main thread's tid (which is the same as our pid) back from
the set_tid_address system call we have to make during initialization.
A new pthread will have the same pid as its parent, and a fork child's
main (and only) thread will have a pid equal to its tid, which we get for
free from the kernel before clone returns.
The only time we'd actually have to make a getpid system call now is if
we take a signal during fork and the signal handler calls getpid. (That,
or we call getpid in the dynamic linker while it's still dealing with its
own relocations and hasn't even set up the main thread yet.)
Bug: 15387103
Change-Id: I6d4718ed0a5c912fc75b5f738c49a023dbed5189
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: 11156955
Change-Id: I07b596d85e4bd6347d488d1a92c8d0a00b5ef3b3
|