12843 Commits

Author SHA1 Message Date
Elliott Hughes
aa916c8db8 am c5999c1e: Merge "Clean up SEEK_SET definitions."
* commit 'c5999c1e0382c40286cc631c6a53e7781bc03154':
  Clean up SEEK_SET definitions.
2015-02-03 01:25:23 +00:00
Elliott Hughes
c5999c1e03 Merge "Clean up SEEK_SET definitions." 2015-02-03 01:21:17 +00:00
Yabin Cui
86fc96f733 Switch pthread_mutex_t from bionic atomics to <stdatomic.h>.
Bug: 17574456
Change-Id: I5ce3d3dc07e804e9ce55c42920f47531b56e04de
2015-02-02 15:00:01 -08:00
Nick Kralevich
4c8a50ba5d am 0cb8abc6: am d80ec661: Merge "Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support"
* commit '0cb8abc6207d7484ecbc9698064c1f24b9b668d5':
  Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support
2015-02-02 22:10:53 +00:00
Nick Kralevich
0cb8abc620 am d80ec661: Merge "Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support"
* commit 'd80ec66121b5af96c6b3d07ba34353b3d517f5b3':
  Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support
2015-02-02 22:07:35 +00:00
Nick Kralevich
d80ec66121 Merge "Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support" 2015-02-02 22:03:41 +00:00
Elliott Hughes
1ed337dbdf Clean up SEEK_SET definitions.
If we lose the #ifndef, the compiler will tell us if the definitions
of SEEK_SET and friends ever get out of sync.

Change-Id: I357cabec7c9cd451c604342344f210bba20fb6bc
2015-02-02 14:02:09 -08:00
Nick Kralevich
3cbc6c627f Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support
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
2015-02-02 13:17:17 -08:00
Elliott Hughes
671b7eb288 am 815fc9bc: am c57b5c50: Merge "Small logging cleanup."
* commit '815fc9bc9ecf96dd478c0800fdb9c4e9200320be':
  Small logging cleanup.
2015-02-02 20:54:27 +00:00
Elliott Hughes
815fc9bc9e am c57b5c50: Merge "Small logging cleanup."
* commit 'c57b5c5094f915ff975a256e086d58e2e7cfedf1':
  Small logging cleanup.
2015-02-02 20:46:39 +00:00
Elliott Hughes
c57b5c5094 Merge "Small logging cleanup." 2015-02-02 20:36:29 +00:00
Elliott Hughes
42084a2653 Small logging cleanup.
Don't send the trailing NUL bytes to the logger, call strlen if we already
know the length, or cast more specifically than we need to.

Change-Id: I68c9388a22bddea49120a1022dda8db8991360c1
2015-02-02 12:24:46 -08:00
Elliott Hughes
c8820e61d1 am 6c1252de: am 530aaecc: Merge "Explicitly check that the reason fortify tests abort is fortify."
* commit '6c1252decba273087411cd9e480d0422eabec6ef':
  Explicitly check that the reason fortify tests abort is fortify.
2015-02-02 19:40:41 +00:00
Elliott Hughes
6c1252decb am 530aaecc: Merge "Explicitly check that the reason fortify tests abort is fortify."
* commit '530aaeccd875f708918f59cd5ff8b076c156adab':
  Explicitly check that the reason fortify tests abort is fortify.
2015-02-02 19:32:44 +00:00
Elliott Hughes
530aaeccd8 Merge "Explicitly check that the reason fortify tests abort is fortify." 2015-02-02 19:25:58 +00:00
Elliott Hughes
d036e94bb3 Explicitly check that the reason fortify tests abort is fortify.
Change-Id: I95291e2febf7b497c1d9f37fd7fa9acdd21e86a4
2015-02-02 11:18:58 -08:00
Elliott Hughes
2e02769aa1 am 5f7819d6: am 7f0f30c6: Merge "Fix clang build."
* commit '5f7819d6f1b2cb706d818e3083d45337e35d386b':
  Fix clang build.
2015-02-02 18:50:43 +00:00
Elliott Hughes
5f7819d6f1 am 7f0f30c6: Merge "Fix clang build."
* commit '7f0f30c6e20c1bf04bec05077eef2d779e7a32df':
  Fix clang build.
2015-02-02 18:36:22 +00:00
Elliott Hughes
7f0f30c6e2 Merge "Fix clang build." 2015-02-02 18:23:28 +00:00
Elliott Hughes
30fbf5f44c Fix clang build.
Change-Id: I863137b5d35602267b4ef3a74399cf394c9994d6
2015-02-02 10:21:39 -08:00
Neil Fuller
575bceb281 am 0a302e01: am d514d9bb: Merge "Fixes to the update-tzdata.py tool"
* commit '0a302e0174da4432da4a6ad5ce126dc27e4a86de':
  Fixes to the update-tzdata.py tool
2015-02-02 18:03:11 +00:00
Elliott Hughes
5372b83eab am 20f2e4f7: am 5940f98a: Merge "Fortify poll and ppoll."
* commit '20f2e4f7ad9d9f816be13f6509e602d4344a018d':
  Fortify poll and ppoll.
2015-02-02 18:03:10 +00:00
Neil Fuller
0a302e0174 am d514d9bb: Merge "Fixes to the update-tzdata.py tool"
* commit 'd514d9bbae354da72fcb43349f0157378e52004d':
  Fixes to the update-tzdata.py tool
2015-02-02 17:57:22 +00:00
Elliott Hughes
20f2e4f7ad am 5940f98a: Merge "Fortify poll and ppoll."
* commit '5940f98a35d64f9ca249536bb8cdcdbfe43e9bc3':
  Fortify poll and ppoll.
2015-02-02 17:57:21 +00:00
Neil Fuller
4177bd8d16 Fixes to the update-tzdata.py tool
We build one too many times. Creating a missing directory
is sufficient.

The tz2icu needs some files in the CWD. Added symlinks.

Bug: 19230091
(cherry-pick of commit 0662c3e5b33840e19f4c14b85bf619c33b3a0d0f)
Change-Id: Ie21d848f1b776ec745473b9122e003fdf0acf105
2015-02-02 17:53:19 +00:00
Neil Fuller
d514d9bbae Merge "Fixes to the update-tzdata.py tool" 2015-02-02 17:52:48 +00:00
Elliott Hughes
5940f98a35 Merge "Fortify poll and ppoll." 2015-02-02 17:51:50 +00:00
Neil Fuller
0662c3e5b3 Fixes to the update-tzdata.py tool
We build one too many times. Creating a missing directory
is sufficient.

The tz2icu needs some files in the CWD. Added symlinks.

Bug: 19230091
Change-Id: I58f9817af68b229f48139e56503f50a2b6dbb4fe
2015-02-02 17:42:41 +00:00
Elliott Hughes
4674e3899a Fortify poll and ppoll.
And remove the test for FD_ZERO fortification, which never made much
sense anyway.

Change-Id: Id1009c5298d461fa4722189e8ecaf22f0c529536
2015-02-02 09:15:19 -08:00
Neil Fuller
700eb048fb Update tzdata to tzdata2015a
Time Zone Data v. 2015a (Released 2015-01-29)
http://www.iana.org/time-zones/repository/releases/tzdata2015a.tar.gz

Information from NEWS:

Release 2015a - 2015-01-29 22:35:20 -0800

  Changes affecting future time stamps

    The Mexican state of Quintana Roo, represented by America/Cancun,
    will shift from Central Time with DST to Eastern Time without DST
    on 2015-02-01 at 02:00.  (Thanks to Steffen Thorsen and Gwillim Law.)

    Chile will not change clocks in April or thereafter; its new standard time
    will be its old daylight saving time.  This affects America/Santiago,
    Pacific/Easter, and Antarctica/Palmer.  (Thanks to Juan Correa.)

    New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
    (Thanks to Tim Parenti.)

  Changes affecting past time stamps

    Iceland observed DST in 1919 and 1921, and its 1939 fallback
    transition was Oct. 29, not Nov. 29.  Remove incorrect data from
    Shanks about time in Iceland between 1837 and 1908.

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
    and Asia/Muscat.

  Changes affecting code

    tzalloc now scrubs time zone abbreviations compatibly with the way
    that tzset always has, by replacing invalid bytes with '_' and by
    shortening too-long abbreviations.

    tzselect ports to POSIX awk implementations, no longer mishandles
    POSIX TZ settings when GNU awk is used, and reports POSIX TZ
    settings to the user.  (Thanks to Stefan Kuhn.)

  Changes affecting build procedure

    'make check' now checks for links to links in the data.
    One such link (for Africa/Asmera) has been fixed.
    (Thanks to Stephen Colebourne for pointing out the problem.)

  Changes affecting commentary

    The leapseconds file commentary now mentions the expiration date.
    (Problem reported by Martin Burnicki.)

    Update Mexican Library of Congress URL.

Bug: 19212588
Change-Id: Idc07ac862901500d4a1dbd0f4aadcfd0aa9d10b8
2015-02-02 11:32:10 +00:00
Elliott Hughes
a5d743a6bf am 9843afd6: am ffbda83b: Merge "Add the fortify tests back into the glibc tests."
* commit '9843afd62982516974fdc3c4481d36007527825a':
  Add the fortify tests back into the glibc tests.
2015-02-02 06:07:15 +00:00
Elliott Hughes
9843afd629 am ffbda83b: Merge "Add the fortify tests back into the glibc tests."
* commit 'ffbda83b302e3c3970135013d2bb92402e040fe5':
  Add the fortify tests back into the glibc tests.
2015-02-02 06:01:10 +00:00
Elliott Hughes
ffbda83b30 Merge "Add the fortify tests back into the glibc tests." 2015-02-02 05:56:27 +00:00
Elliott Hughes
b6e3e800d2 Add the fortify tests back into the glibc tests.
Change-Id: I4426d0c7c1bfe3b0028a674f72d1c3b9d883d6af
2015-01-31 21:32:10 -08:00
Elliott Hughes
9b96dd6b17 am d2d63740: am 21cdd22f: Merge "Include <malloc.h> for struct mallinfo."
* commit 'd2d63740b78459a414e293efdb16e7a9ac089d5c':
  Include <malloc.h> for struct mallinfo.
2015-01-31 07:49:25 +00:00
Elliott Hughes
a26423f22c am fd10c019: am 09c33824: Merge "Break two incorrect transitive includes."
* commit 'fd10c019fab50c06f391b6a765b0904ce477d3b7':
  Break two incorrect transitive includes.
2015-01-31 07:49:24 +00:00
Elliott Hughes
d2d63740b7 am 21cdd22f: Merge "Include <malloc.h> for struct mallinfo."
* commit '21cdd22f035efd50902b7780fc6ea53bd1684357':
  Include <malloc.h> for struct mallinfo.
2015-01-31 06:21:34 +00:00
Elliott Hughes
fd10c019fa am 09c33824: Merge "Break two incorrect transitive includes."
* commit '09c3382433ae94ada45780312a2a9fd082ad1478':
  Break two incorrect transitive includes.
2015-01-31 06:21:33 +00:00
Elliott Hughes
21cdd22f03 Merge "Include <malloc.h> for struct mallinfo." 2015-01-31 04:37:11 +00:00
Elliott Hughes
cb0e70389e Include <malloc.h> for struct mallinfo.
GCC doesn't seem to care, but clang does.

Change-Id: I9884820339a9e6f142862928c357f1a538184ae0
2015-01-30 20:33:31 -08:00
Elliott Hughes
09c3382433 Merge "Break two incorrect transitive includes." 2015-01-31 04:18:10 +00:00
Dan Albert
3c68e1946a am 18dd2f3b: am 94335cc8: Merge "Put back inline definitions if using an old API."
* commit '18dd2f3b918af8233dc63ad6efa780a26c8ae79c':
  Put back inline definitions if using an old API.
2015-01-30 21:16:35 +00:00
Elliott Hughes
0772f933a4 am 6cf2cf8b: am 542b94d9: Merge "Remove unused CONFIG_SECONDS."
* commit '6cf2cf8bf26b99b7318791c75cbccfd95893b04e':
  Remove unused CONFIG_SECONDS.
2015-01-30 21:16:34 +00:00
Dan Albert
18dd2f3b91 am 94335cc8: Merge "Put back inline definitions if using an old API."
* commit '94335cc8e2f32638d9e38741ddabfd19a38e0840':
  Put back inline definitions if using an old API.
2015-01-30 19:44:02 +00:00
Elliott Hughes
6cf2cf8bf2 am 542b94d9: Merge "Remove unused CONFIG_SECONDS."
* commit '542b94d9bf7eb3838b0582c02d7a1bf2e270af5a':
  Remove unused CONFIG_SECONDS.
2015-01-30 19:44:01 +00:00
Dan Albert
94335cc8e2 Merge "Put back inline definitions if using an old API." 2015-01-30 17:18:49 +00:00
Elliott Hughes
542b94d9bf Merge "Remove unused CONFIG_SECONDS." 2015-01-30 06:21:55 +00:00
Elliott Hughes
4dcfccff8d Remove unused CONFIG_SECONDS.
Bug: https://code.google.com/p/android/issues/detail?id=65951
Change-Id: I8ae7057c68e16618de6dd06cf052426c6cad8a3d
2015-01-29 21:47:37 -08:00
Elliott Hughes
5038b19cef Break two incorrect transitive includes.
Change-Id: I95519caa5258cf5c6b8053f1c7e08ade2a824e49
2015-01-29 20:12:13 -08:00
Dan Albert
466dbe4444 Put back inline definitions if using an old API.
All these inlines were turned in to out of line definitions in L.
This brings us a step closer to being able to just use the current
bionic headers for the NDK, rather than having many old versions of
them.

Change-Id: Ie010bc727d78d3742abc577c70f6578db2e68625
2015-01-29 17:30:40 -08:00