| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Bug: 19220800
Change-Id: Ie75c640183c4a41a499556fefb4f824a134a5fb1
|
|
|
|
| |
Change-Id: I95291e2febf7b497c1d9f37fd7fa9acdd21e86a4
|
|
|
|
|
|
|
| |
And remove the test for FD_ZERO fortification, which never made much
sense anyway.
Change-Id: Id1009c5298d461fa4722189e8ecaf22f0c529536
|
|
|
|
|
|
| |
Bug: 18067305
Change-Id: Ia1ecacf47eddecc9bc58aaac779e0c218f463179
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Broke the build.
In file included from frameworks/rs/cpu_ref/rsCpuCore.cpp:36:
system/core/include/cutils/properties.h:118:1: error: unknown attribute '__artificial__' ignored [-Werror,-Wunknown-attributes]
__BIONIC_FORTIFY_INLINE
^
bionic/libc/include/sys/cdefs.h:537:110: note: expanded from macro '__BIONIC_FORTIFY_INLINE'
#define __BIONIC_FORTIFY_INLINE extern __inline__ __always_inline __attribute__((gnu_inline)) __attribute__((__artificial__))
^
1 error generated.
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libRSCpuRef_intermediates/rsCpuCore.o] Error 1
This reverts commit 9b543ffeac216189cc8125f7624da9a8cbcbe2e4.
Change-Id: I6a1198747505dcb402b722887c1bfbc3a628a8b8
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise the gcc compiler warning doesn't show up.
Delete some unittests. These unittests no longer compile cleanly
using -Wall -Werror, and rewriting them to compile cleanly
isn't feasible.
Bug: 17784968
Change-Id: I9bbdc7b6a1c2ac75754f5d0f90782e0dfae66721
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR_GET_DUMPABLE is used by an application to indicate whether or
not core dumps / PTRACE_ATTACH should work.
Security sensitive applications often set PR_SET_DUMPABLE to 0 to
disable core dumps, to avoid leaking sensitive memory to persistent
storage. Similarly, they also set PR_SET_DUMPABLE to zero to prevent
PTRACE_ATTACH from working, again to avoid leaking the contents
of sensitive memory.
Honor PR_GET_DUMPABLE when connecting to debuggerd. If an application
has said it doesn't want its memory dumped, then we shouldn't
ask debuggerd to dump memory on its behalf.
FORTIFY_SOURCE tests: Modify the fortify_source tests to set
PR_SET_DUMPABLE=0. This reduces the total runtime of
/data/nativetest/bionic-unit-tests/bionic-unit-tests32 from approx
53 seconds to 25 seconds. There's no need to connect to debuggerd
when running these tests.
Bug: 16513137
Change-Id: Idc7857b089f3545758f4d9b436b783d580fb653f
|
|
|
|
|
|
|
|
| |
I've also switched some tests to be positive rather than negative,
because !defined is slightly harder to reason about and there are
only two cases: bionic and glibc.
Change-Id: I8d3ac40420ca5aead3e88c69cf293f267273c8ef
|
|
|
|
|
|
| |
I'll raise a bug for the FD_ISSET fortification; we should do better too.
Change-Id: Id2bf277890ad06b010dc952e270d746714c2bea7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add tests for the above.
Add the fortify implementations of __stpcpy_chk and __stpncpy_chk.
Modify the strncpy test to cover more cases and use this template for
stpncpy.
Add all of the fortify test cases.
Bug: 13746695
Change-Id: I8c0f0d4991a878b8e8734fff12c8b73b07fdd344
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to be able to generate a list of tests for cts, the same set of
tests must exist across all platforms. This CL adds empty tests where a
test was conditionally compiled out.
This CL creates a single library libBionicTests that includes all of
the tests found in bionic-unit-tests-static.
Also fix a few missing include files in some test files.
Tested by running and compiling the tests for every platform and
verifying the same number of tests are on each platform.
Change-Id: I9989d4bfebb0f9c409a0ce7e87169299eac605a2
|
|
|
|
|
|
|
|
|
|
| |
Previously, FORTIFY_SOURCE used single macros to define these standard
functions for use with clang. This can cause conflicts with other macros used
to call these functions, particularly when those macros expand the number of
arguments to the function. This change wraps our macro definitions, so that
expansion properly takes place for programmer arguments first.
Change-Id: I55929b1fd2a643b9d14a17631c4bcab3b0b712cf
|
|
|
|
| |
Change-Id: Ic7de163fe121db13e00560adb257331bc709814d
|
|
|
|
|
|
|
|
| |
This change reverts
* fb3f956d075676c0438f2ee2bf3a5be659dfc04b.
* 65c99de2cb7a569ea17ca35e2f8f1e033421864b
Change-Id: Id5774eeede41130579115cf67a72ee914f2b47d5
|
|
|
|
| |
Change-Id: I3d7b4ec86d04efb865117ce7629a2e26917f3331
|
|
|
|
|
|
|
|
| |
Make sure the buffer we're dealing with has enough room.
Might as well check for memory issues while we're here,
even though I don't imagine they'll happen in practice.
Change-Id: I0ae1f0f06aca9ceb91e58c70183bb14e275b92b5
|
|
|
|
| |
Change-Id: Ia3f21ce1f0ed9236527fe44d36ccb7de6bf63113
|
|
|
|
|
|
|
|
|
|
|
| |
Add FORTIFY_SOURCE checks for the following macros:
* FD_CLR
* FD_ISSET
* FD_SET
Bug: 11047121
Change-Id: I3c5952136aec9eff3288b91b1318677ff971525c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
malloc and family were not declared with __attribute__((alloc_size)).
This was (sometimes) preventing FORTIFY_SOURCE related functions
from knowing the size of the buffer it's dealing with, inhibiting
FORTIFY_SOURCE protections.
Add __attribute__((alloc_size))
Information about the alloc_size attribute can be found
at http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
Change-Id: Ia2f0a445f0170a7325f69259b5e7fb35a9f14921
|
|
|
|
|
|
|
|
|
| |
Fortify calls to recv() and recvfrom().
We use __bos0 to match glibc's behavior, and because I haven't
tested using __bos.
Change-Id: Iad6ae96551a89af17a9c347b80cdefcf2020c505
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I accidentally did a signed comparison of the size_t values passed in
for three of the _chk functions. Changing them to unsigned compares.
Add three new tests to verify this failure is fixed.
Bug: 10691831
Merge from internal master.
(cherry-picked from 883ef2499c2ff76605f73b1240f719ca6282e554)
Change-Id: Id9a96b549435f5d9b61dc132cf1082e0e30889f5
|
|
|
|
|
|
|
| |
This change detects programs reading beyond the end of "src" when
calling strncpy.
Change-Id: Ie1b42de923385d62552b22c27b2d4713ab77ee03
|
|
|
|
|
|
|
|
| |
* bzero
* umask
* strlcat
Change-Id: I65065208e0b8b37e10f6a266d5305de8fa9e59fc
|
|
Get rid of a lot of the duplication in the various FORTIFY_SOURCE
tests. Instead, we build 4 separate static libraries, with
4 different compile time options, and link them into the final test
binary.
Change-Id: Idb0b7cccc8dd837adb037bf4ddfe8942ae138230
|