OSDN Git Service

bionic: prevent root processes from calling __system_property_add
authorColin Cross <ccross@android.com>
Sun, 16 Jun 2013 17:19:16 +0000 (10:19 -0700)
committerGreg Hackmann <ghackmann@google.com>
Tue, 25 Jun 2013 20:34:36 +0000 (13:34 -0700)
commitfc761f8cc0dca78ac4ace20f701554704a6c14d5
treec6c1704d6ff1db461f6e05eca5f008d4ca876fb9
parentbe30c7a78a1cf4adc8ec9bbdf17e85186fdb05b2
bionic: prevent root processes from calling __system_property_add

If a root process other than init calls __system_property_add, which
it should never do, it will break the design assumption that there is
only one mutator.

Pass O_EXCL to open() in map_prop_region_rw to ensure that only one
process ever has the property pages open for write.

Change-Id: I8233bfe0beaa40a5003ad53b98c661536b15f6b7
libc/bionic/system_properties.c