Commit graph

6 commits

Author SHA1 Message Date
Josh Gao
54e502e66a Revert "Temporarily disable FdsanTest.vfork."
This reverts commit b4cbff351f.

Bug: http://b/156400255
Test: none
Change-Id: I3a936542ccff8989b4671f3e03dd9d1d5559d6ff
2020-05-18 12:59:38 -07:00
Josh Gao
b4cbff351f Temporarily disable FdsanTest.vfork.
Bug: http://b/156400255
Test: none
Change-Id: I48e09e0ea84742933bea88d009f8ff0bffacfdc3
2020-05-12 15:17:02 -07:00
Josh Gao
65fb2a7f03 fdsan: don't do anything when vforked.
Bug: http://b/153926671
Test: 32/64-bit bionic-unit-tests on blueline, x86_64 emulator
Change-Id: Id351a993e396774b68239edfef83d9e81205290b
2020-05-07 20:18:40 -07:00
Josh Gao
7266e91f62 Move unique_fd fdsan tests into bionic.
EXPECT_DEATH requires special handling to work with fdsan, because of
our fork detection. Instead of duplicating the EXPECT_FDSAN_DEATH macro
in the libbase tests as well, move the unique_fd fdsan tests here.

Test: bionic_unit_tests
Change-Id: Ia7b65d4560601d5a78d143aced887a6773b401c0
2018-08-09 01:09:08 +00:00
Josh Gao
08b7a4008f fdsan: improve errors some more.
Add handling for all 4 cases of failure of exchange_owner_tag. Also,
mask off and sign extend the type byte of the owner tag, and add a
test for that.

Test: bionic_unit_tests
Change-Id: Ic7c49f0ee5498623f05c49b5b4cd055db48a4b9f
2018-08-03 15:03:41 -07:00
Josh Gao
f6e5b58260 Introduce api to track fd ownership in libc.
Add two functions to allow objects that own a file descriptor to
enforce that only they can close their file descriptor.

Use them in FILE* and DIR*.

Bug: http://b/110100358
Test: bionic_unit_tests
Test: aosp/master boots without errors
Test: treehugger
Change-Id: Iecd6e8b26c62217271e0822dc3d2d7888b091a45
2018-07-19 14:28:54 -07:00