Commit Graph

5877 Commits

Author SHA1 Message Date
Yabin Cui
70ad54d8c0 am 2d988187: am 11829be3: Merge "Add test about pthread_mutex_t owner tid limit."
* commit '2d988187712f52773b89421d139b266c8b58f769':
  Add test about pthread_mutex_t owner tid limit.
2015-02-03 22:40:46 +00:00
Yabin Cui
11829be3e1 Merge "Add test about pthread_mutex_t owner tid limit." 2015-02-03 22:28:56 +00:00
Nick Kralevich
3ce62609f2 am 72c3071d: am f00f484c: Merge "Ensure raw fchmod/fchmodat syscalls are hidden."
* commit '72c3071d548ee3bf3711abf13dce25042ccc3cea':
  Ensure raw fchmod/fchmodat syscalls are hidden.
2015-02-03 20:32:59 +00:00
Yabin Cui
140f3678f0 Add test about pthread_mutex_t owner tid limit.
Bug: 19216648
Change-Id: I7b12955bdcad31c13bf8ec2740ff88ba15223ec0
2015-02-03 12:20:46 -08:00
Nick Kralevich
00490ae3f3 Ensure raw fchmod/fchmodat syscalls are hidden.
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
2015-02-03 12:10:30 -08:00
Neil Fuller
d3ef8fbdf7 am 700eb048: Update tzdata to tzdata2015a
* commit '700eb048fb6df8805245097d73a87384108fdf67':
  Update tzdata to tzdata2015a
2015-02-03 15:00:18 +00:00
Hans Boehm
da3a449043 am 0cddad0f: am d57bf449: Merge "Switch pthread_mutex_t from bionic atomics to <stdatomic.h>."
* commit '0cddad0fd17274575abe2e25484c909def51d7e3':
  Switch pthread_mutex_t from bionic atomics to <stdatomic.h>.
2015-02-03 02:53:31 +00:00
Hans Boehm
d57bf449fe Merge "Switch pthread_mutex_t from bionic atomics to <stdatomic.h>." 2015-02-03 02:42:53 +00:00
Elliott Hughes
ea31751e4b am aa916c8d: am c5999c1e: Merge "Clean up SEEK_SET definitions."
* commit 'aa916c8db85b01389b929f060f232b3e06448e79':
  Clean up SEEK_SET definitions.
2015-02-03 01:31:08 +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
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
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
2e02769aa1 am 5f7819d6: am 7f0f30c6: Merge "Fix clang build."
* commit '5f7819d6f1b2cb706d818e3083d45337e35d386b':
  Fix clang build.
2015-02-02 18:50:43 +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
d514d9bbae Merge "Fixes to the update-tzdata.py tool" 2015-02-02 17:52:48 +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
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
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
94335cc8e2 Merge "Put back inline definitions if using an old API." 2015-01-30 17:18:49 +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
Dan Albert
36aad393db am c9af0e9a: am cd1959b0: Merge "Add primitive CPPLINT.cfg."
* commit 'c9af0e9a2d215b60a128643b6bdddd671e33864b':
  Add primitive CPPLINT.cfg.
2015-01-29 22:06:28 +00:00
Dan Albert
cd1959b0c5 Merge "Add primitive CPPLINT.cfg." 2015-01-29 21:54:55 +00:00
Yabin Cui
f63ae0553e am 508d5579: am 782aa39f: Merge "Rewrite __cxa_guard.cpp with <stdatomic.h>."
* commit '508d5579cd0d3723662755ab418ac3085e9f30cd':
  Rewrite __cxa_guard.cpp with <stdatomic.h>.
2015-01-29 20:35:44 +00:00
Dan Albert
6ac4dd8ba9 Add primitive CPPLINT.cfg.
We'll add more things to this as we discover other warnings we don't
care about.

Change-Id: I408f688827cab0f74e055d8f1778069163663f0b
2015-01-29 11:41:59 -08:00
Yabin Cui
6a3ff01cd4 Rewrite __cxa_guard.cpp with <stdatomic.h>.
Bug: 19180923
Change-Id: If4912d01db43c72ef12f4b04270ddb5d76d09462
2015-01-29 11:19:15 -08:00
Elliott Hughes
dbfcf000c0 am e40b4eb3: am 7f17aea2: Merge "Add missing includes."
* commit 'e40b4eb35a6f8ae5c286f53abb920b452b7b6792':
  Add missing includes.
2015-01-29 03:33:42 +00:00
Elliott Hughes
05fc1d7050 Add missing includes.
Change-Id: Ibf549266a19a67eb9158d341a69dddfb654be669
2015-01-28 19:23:11 -08:00
Elliott Hughes
4f2e2a9d70 am 8661b092: am a9c3d056: Merge "Modify MIPS64 stat structure to match a generic one in AOSP."
* commit '8661b092fe24c6b56426e07c6f02f5d83daae172':
  Modify MIPS64 stat structure to match a generic one in AOSP.
2015-01-29 01:42:06 +00:00
Elliott Hughes
a9c3d0569f Merge "Modify MIPS64 stat structure to match a generic one in AOSP." 2015-01-29 01:31:59 +00:00
Raghu Gandham
86d2feef9f Modify MIPS64 stat structure to match a generic one in AOSP.
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
2015-01-28 16:12:17 -08:00
Yabin Cui
c6438cd4b0 am 3c95c887: am 9e82c4be: Merge "Switch pthread_once_t to stdatomic.h."
* commit '3c95c887820018cff06039e1dc35afe585e661c1':
  Switch pthread_once_t to stdatomic.h.
2015-01-28 21:27:32 +00:00
Yabin Cui
80e6d6d825 Switch pthread_once_t to stdatomic.h.
Bug: 17574610

Change-Id: I653f2aa4b5b38dbdaffe4a6c3deccfe6ad3b0e74
2015-01-27 19:49:12 -08:00
Elliott Hughes
63c74b2c22 am 6c55034a: am 86d98962: Merge "Fix mips build."
* commit '6c55034a1d24caa82cb7e5a6c0ca71e9697c0f12':
  Fix mips build.
2015-01-27 19:51:12 +00:00
Elliott Hughes
e6099098a5 Fix mips build.
Move various mips-only things into the arch-mips directory. As soon as mips
writes assembler replacements, we can remove these.

Change-Id: Ia7308559bc361f5c8df3e1d456b381865e060b93
2015-01-27 11:09:27 -08:00