Commit graph

15994 commits

Author SHA1 Message Date
Yi Kong
71417caa92 Merge "Implement getifaddrs(3)/freeifaddrs(3)." 2015-12-22 17:11:59 +00:00
Dimitry Ivanov
be7c7fe218 Merge "linker: implement shared namespaces" 2015-12-21 23:10:49 +00:00
Dimitry Ivanov
7331fe18d7 linker: implement shared namespaces
Shared namespaces clone the list of loaded native
libraries from the caller namespace. This allows
classloaders for bundled apps to share already loaded
libraries with default namespace.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I8949d45937fdb38e1f586ff0679003adac0d9dad
(cherry picked from commit e78deef364)
2015-12-19 23:38:27 -08:00
Elliott Hughes
0945ed5cc5 Implement getifaddrs(3)/freeifaddrs(3).
Time to dust off the old libcore implementation from gingerbread and add it
to bionic. Unlike the original, this actually looks at both RTM_NEWLINK and
RTM_NEWADDR.

Bug: http://b/26238832
Change-Id: I7bb4b432deb766065b66b9c9ff36ed68249aba82
2015-12-19 14:49:09 -08:00
Elliott Hughes
4afd635be1 Merge "Improve the 32-bit ABI documentation." 2015-12-19 21:47:07 +00:00
Elliott Hughes
59fc2e8557 Improve the 32-bit ABI documentation.
Change-Id: Ie5bfc8d6f7f3946100f653de0e006072e56e18d6
2015-12-19 09:36:16 -08:00
Tom Cherry
dd57119ced Merge "Reset access to system properties on reinitialization" 2015-12-17 17:54:05 +00:00
Elliott Hughes
7cb3c4af13 Merge "sem_timedwait with a null timeout doesn't mean "forever"." 2015-12-17 01:15:15 +00:00
Dimitry Ivanov
d4f86aed42 Merge "linker: add dlvsym(3)" 2015-12-17 00:40:13 +00:00
Christopher Ferris
27032a39dd Merge "Fix missing parentheses." 2015-12-17 00:30:59 +00:00
Christopher Ferris
0b13f29b2c Fix missing parentheses.
The BIONIC_ROUND_UP_POWER_OF_2 macro did not have parentheses around
the whole expression. This lead to the wrong value being computed when
used as part of a mathematical expression such as this:

  value = BIONIC_ROUND_UP_POWER_OF_2(value) - 1;

This only happens on 64 bit abis.

Change-Id: I6f8afbdaf16fe64a88fa0246d074b3534c9159c1
2015-12-16 16:11:04 -08:00
Christopher Ferris
9f20db1c94 Merge "Fix bug in dlmalloc's version of calloc." 2015-12-17 00:06:03 +00:00
Dimitry Ivanov
9cf99cbad8 linker: add dlvsym(3)
This changes implements dlvsym - dlsym for versioned symbols.

Bug: http://b/22865643
Change-Id: Ic90a60d512104261a1416c43f9100f0d88e3b46f
2015-12-16 15:24:13 -08:00
Elliott Hughes
dd586f2ebd sem_timedwait with a null timeout doesn't mean "forever".
It actually means "crash immediately". Well, it's an error. And callers are
much more likely to realize their mistake if we crash immediately rather
than return EINVAL. Historically, glibc has crashed and bionic -- before
the recent changes -- returned EINVAL, so this is a behavior change.

Change-Id: I0c2373a6703b20b8a97aacc1e66368a5885e8c51
2015-12-16 15:15:58 -08:00
Christopher Ferris
ad33ebead8 Fix bug in dlmalloc's version of calloc.
Under some circumstances, doing a calloc will make sure that the memory
returned will be zero up to the size of the requested size. However, if
there is more usable size than the requested size, that extra part
of the allocation will not be zeroed. This change fixes it so that the
entire usable memory is always zeroed.

Change-Id: I8a66d6767c074023c4ba3568bf2705e1886740fc
2015-12-16 14:48:03 -08:00
Dimitry Ivanov
d3e5301a75 Merge "Revert "Revert "Remove remaining ndk_cruft from LP64 platforms""" 2015-12-16 19:06:09 +00:00
Dimitry Ivanov
bc2e88a85d Revert "Revert "Remove remaining ndk_cruft from LP64 platforms""
This reverts commit 23af25b747.

Bug: http://b/26164862
Change-Id: I201bf49530f33f8ba6a1a35b79723afb9e84c7a5
2015-12-16 19:02:04 +00:00
Elliott Hughes
4d57e669dc Merge "Add a few missing pthread tests." 2015-12-15 01:38:24 +00:00
Dimitry Ivanov
52a05f3ce7 Merge "Revert "Remove remaining ndk_cruft from LP64 platforms"" 2015-12-15 01:36:19 +00:00
Elliott Hughes
d31d4c1cc6 Add a few missing pthread tests.
This seems to be all that's tested by system/extras/tests/bionic that isn't
already better tested here.

Change-Id: Id0aa985cefd4047a6007ba9804f541069d9e92ed
2015-12-14 17:35:10 -08:00
Dimitry Ivanov
23af25b747 Revert "Remove remaining ndk_cruft from LP64 platforms"
This reverts commit b1d0a2ae77.

Change-Id: I1da06be0b78a4f2a4cad7e4a19a3ee755f55a813
2015-12-15 01:34:14 +00:00
Dimitry Ivanov
b34ae08cc6 Merge "Remove remaining ndk_cruft from LP64 platforms" 2015-12-14 23:55:55 +00:00
Dimitry Ivanov
b1d0a2ae77 Remove remaining ndk_cruft from LP64 platforms
This change removes endpwent, dlmalloc_inspect_all, dlmalloc_trim
from lp64 libc.so. It also removed necessety of having brillo
version scripts for lp64 platforms.

Bug: http://b/26164862
Change-Id: I4e9b38907bb1dc410f0eb6d2f5d5944fe713da51
2015-12-14 15:49:28 -08:00
Dimitry Ivanov
881673cb45 Merge changes Iaee1b711,Ia3dd0761
* changes:
  Generate libc version-script for brillo
  Revert "Don't verify version scripts on 32-bit Brillo"
2015-12-14 22:53:06 +00:00
Dimitry Ivanov
585e959849 Generate libc version-script for brillo
Brillo doesn't use the ndk cruft, so we need
separate set of version scripts. Added new "nobrillo"
tag to mark such symbols in *.map.txt files.

Bug: http://b/26164862
Change-Id: Iaee1b7119f75b68c2971679fc32817e6df29fd94
2015-12-14 14:23:06 -08:00
Dimitry Ivanov
a3dd076126 Revert "Don't verify version scripts on 32-bit Brillo"
This reverts commit 31951b7f0d.

Bug: http://b/26164862
2015-12-14 14:19:53 -08:00
Elliott Hughes
162a8524ea Merge "Fix personality test for mips32r6" 2015-12-14 15:59:29 +00:00
Lazar Trsic
61cf963efe Fix personality test for mips32r6
When personality syscall is executed on mips64, for a 32bit process,
sys_32_personality() is called, which converts PER_LINUX32 -> PER_LINUX.
Change expected value when mips32 is a second architecture.

For more information see:
https://www.linux-mips.org/archives/linux-mips/2015-08/msg00421.html
https://www.linux-mips.org/archives/linux-mips/2015-11/msg00093.html

Change-Id: I8c9062f536ad6e513f0ac585da3568d80e5fa1b4
2015-12-14 12:29:53 +01:00
Dan Willemsen
a7ff3964ab Merge "Don't verify version scripts on 32-bit Brillo" 2015-12-12 02:29:29 +00:00
Dan Willemsen
31951b7f0d Don't verify version scripts on 32-bit Brillo
Brillo doesn't use the ndk cruft, so the same version scripts do not
apply. Until we have brillo-specific version scripts, just disable the
version script check.

Bug: 26164862
Change-Id: I682860ec1c5b36014c7a6cf24da43df553e9dc9f
2015-12-11 16:52:08 -08:00
Dimitry Ivanov
52e2db647c Merge "Remove __bionic_libgcc_unwind_symbols from version script" 2015-12-11 19:41:33 +00:00
Dimitry Ivanov
2f019872dc Remove __bionic_libgcc_unwind_symbols from version script
Bug: http://b/26004476
Change-Id: Iaa468de4cbcc94e88badc5cde0f4421c710c1f38
2015-12-11 11:30:48 -08:00
Tom Cherry
b417169d80 Reset access to system properties on reinitialization
Treat subsequent calls to __system_properties_init() as a
reinitialization of system properties and revoke access to prop files
that have been previously mapped but that the process's current context
does not have access to.  Additionally reset the no_access_ flag in
case permissions have loosened and previously unaccessible files can now
be accessed.

This is meant to work around an issue that setcon() does not revoke
mmap() mappings, so we must manually revoke them after a successful
setcon() call.

Bug 26114086

Change-Id: I4d690abb6817283ca64ac26ea4c1dad398a98fbc
2015-12-11 11:16:21 -08:00
Dimitry Ivanov
0bc3977537 Merge "Move dlsym and dladdr implementation to linker.cpp" 2015-12-11 01:26:17 +00:00
Dimitry Ivanov
4a2c5aa30c Move dlsym and dladdr implementation to linker.cpp
Bug: http://b/25716705
Bug: http://b/22865643
Change-Id: If22fc1eda219f676b5fcc06490f7901d21d1749c
2015-12-10 16:24:57 -08:00
Tom Cherry
e46ded5ce1 Merge "Do not set properties in bionic_systrace" 2015-12-10 23:05:15 +00:00
Tom Cherry
46e2eadad2 Do not set properties in bionic_systrace
Currently, if the debug.atrace.tags.enableflags property is not found,
it is set to a safe value such that a pointer to this property can be
stored for later access.  This may result in selinux denials because not
all processes write permissions for this property or permission to
connect to the property write socket at all.

Change I6d953c0c281fd72ad3eba8a479fd258023579b5b writes this property to
a safe value upon boot, which greatly decreases the cases in which this
property will not be accessible and removes the need to write it here.
This commit removes this write.

Bug 26115803

Change-Id: Ief72c5f731d3a1231b5080eb531fa0a491a8b1d1
2015-12-10 13:33:37 -08:00
Dimitry Ivanov
cb025e55f7 Merge "Revert "Add /odm/lib to shared lib search path"" 2015-12-10 20:17:02 +00:00
Dimitry Ivanov
9d8632e1a7 Merge "constexpr constructor for atfork_list_t" 2015-12-10 17:39:48 +00:00
Dimitry Ivanov
39801757c3 Merge "Add permitted_when_isolated_path to linker namespaces" 2015-12-10 04:34:38 +00:00
Elliott Hughes
6500f51c0e Merge "Fix -fstack-protector-strong for x86." 2015-12-10 02:33:34 +00:00
Dimitry Ivanov
284ae3559e Add permitted_when_isolated_path to linker namespaces
The permitted_when_isolated_path is a way to white-list
directories not present in search-path. It is ignored for
not isolated namespaces.

Bug: http://b/25853516
Bug: http://b/22548808
Change-Id: Ib1538037268eea69323ea49968a34a4a1d1938a5
2015-12-09 13:54:01 -08:00
Dimitry Ivanov
5a3ab3422d Merge "Revert "Ensure that readlink has access to /proc/self/fd"" 2015-12-09 21:50:54 +00:00
Dimitry Ivanov
db43526581 Revert "Ensure that readlink has access to /proc/self/fd"
This reverts commit 4e50d0247b.

Bug: http://b/24912743
Change-Id: I5d32c670f0e16aec9c74add143158e919a301673
2015-12-09 19:36:47 +00:00
Dimitry Ivanov
40728bccbc Revert "Add /odm/lib to shared lib search path"
This reverts commit f74b041cce.

Bug: 25654402
Change-Id: I77386ea3655868d7cd1a8130afbc95e70549389e
2015-12-09 19:35:02 +00:00
Dan Willemsen
df196131f3 Merge "libm: Use LOCAL_SRC_FILES_EXCLUDE_{arch}" 2015-12-08 23:41:24 +00:00
Todd Kjos
5736959094 Merge "bionic: Build Breakage" 2015-12-08 21:46:17 +00:00
Mark Salyzyn
9da687e2f4 bionic: Build Breakage
Bug: 23668800
Change-Id: Ic7cf5864d3f5881e6f7105a49ecf62b1bc4a604c
2015-12-08 13:42:41 -08:00
Elliott Hughes
6c54ddd20f Fix -fstack-protector-strong for x86.
We need to ensure %gs:20 is set up early enough for -fstack-protector-strong
on x86, and that __set_tls doesn't get stack protector checks because it's a
prerequisite for them. x86 devices/emulators won't boot without this.

Bug: http://b/26073874
Change-Id: Icf0d34294648cc0c8cb406a3617befe0d45c525a
2015-12-08 12:48:42 -08:00
Dimitry Ivanov
89a50fe1eb constexpr constructor for atfork_list_t
Bug: http://b/26026986
Change-Id: Iad95383a23f81eea776bebce641c555d26547b77
2015-12-08 11:40:51 -08:00