diff options
author | Sami Tolvanen <samitolvanen@google.com> | 2015-03-05 00:02:28 +0000 |
---|---|---|
committer | Sami Tolvanen <samitolvanen@google.com> | 2015-03-05 00:44:12 +0000 |
commit | 86cddf40741024961839dbbcfa005e908314e681 (patch) | |
tree | 5eb986b4db6a0128ff54df99942449b83bae3662 /fs_mgr | |
parent | 291ce5b82d8a504be69132f1827e20041833c488 (diff) | |
download | system_core-86cddf40741024961839dbbcfa005e908314e681.zip system_core-86cddf40741024961839dbbcfa005e908314e681.tar.gz system_core-86cddf40741024961839dbbcfa005e908314e681.tar.bz2 |
Do not call libcutils property_set in init through libfs_mgr
Both init and libcutils define a property_set function. The init
version sets the property directly while libcutils simply calls
__system_property_set, which sends a message to init to set the
property.
Since libfs_mgr is statically linked to libcutils, any calls to
property_set end up sending a message to init and waiting for a
response. When libfs_mgr is further statically linked to init,
this leads to init sending a message to itself when property_set
is called in fs_mgr.
Because send_prop_msg in bionic only waits for a response for
250ms, this does not cause a deadlock. However, using libcutils
to set a property in the init process is hardly a good idea.
This change removes the property_set call from fs_mgr_verity.c.
If this property is required later, it should be set elsewhere.
Change-Id: I6a28cccb1ccce960841af20a4b20c32d424b5524
Diffstat (limited to 'fs_mgr')
-rw-r--r-- | fs_mgr/fs_mgr_verity.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/fs_mgr/fs_mgr_verity.c b/fs_mgr/fs_mgr_verity.c index 028791c..20d9015 100644 --- a/fs_mgr/fs_mgr_verity.c +++ b/fs_mgr/fs_mgr_verity.c @@ -381,27 +381,6 @@ static int test_access(char *device) { return -1; } -static int set_verified_property(char *name) { - int ret; - char *key; - ret = asprintf(&key, "partition.%s.verified", name); - if (ret < 0) { - ERROR("Error formatting verified property\n"); - return ret; - } - ret = PROP_NAME_MAX - strlen(key); - if (ret < 0) { - ERROR("Verified property name is too long\n"); - free(key); - return -1; - } - ret = property_set(key, "1"); - if (ret < 0) - ERROR("Error setting verified property %s: %d\n", key, ret); - free(key); - return ret; -} - static int check_verity_restart(const char *fname) { char buffer[VERITY_KMSG_BUFSIZE + 1]; @@ -774,12 +753,7 @@ int fs_mgr_setup_verity(struct fstab_rec *fstab) { goto out; } - if (mode == VERITY_MODE_LOGGING) { - retval = FS_MGR_SETUP_VERITY_SUCCESS; - } else { - // set the property indicating that the partition is verified - retval = set_verified_property(mount_point); - } + retval = FS_MGR_SETUP_VERITY_SUCCESS; out: if (fd != -1) { |