diff options
author | Tom Cherry <tomcherry@google.com> | 2017-05-01 17:10:09 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2017-05-01 17:22:49 -0700 |
commit | e7656b7200d934d6f77df422d6d3dee469230dea (patch) | |
tree | 9ef0aa7484486d201006d9dfd6f9deb03db0fc1b /init/descriptors.cpp | |
parent | 6a8314c8bfa4a182ddf560609ebb514ec30b32bf (diff) | |
download | system_core-e7656b7200d934d6f77df422d6d3dee469230dea.tar.gz system_core-e7656b7200d934d6f77df422d6d3dee469230dea.tar.bz2 system_core-e7656b7200d934d6f77df422d6d3dee469230dea.zip |
ueventd: do not reference init's sehandle
Init exposes a global 'sehandle' that ueventd references as part of
devices.cpp and util.cpp. This is particularly dangerous in
device_init() in which both uevent and init write to this global.
This change creates a separate local copy for devices.cpp and puts
restrictions on where init.h can be included to make sure the global
used by init is not reference by non-init code. Future changes to
init should remove this global.
Test: Boot bullhead
Change-Id: Ifefa9e1932e9d647d06cca2618f5c8e5a7a85460
Diffstat (limited to 'init/descriptors.cpp')
-rw-r--r-- | init/descriptors.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/init/descriptors.cpp b/init/descriptors.cpp index bc6bc8dca..b2142ca99 100644 --- a/init/descriptors.cpp +++ b/init/descriptors.cpp @@ -80,7 +80,7 @@ int SocketInfo::Create(const std::string& context) const { int flags = ((type() == "stream" ? SOCK_STREAM : (type() == "dgram" ? SOCK_DGRAM : SOCK_SEQPACKET))); - return create_socket(name().c_str(), flags, perm(), uid(), gid(), context.c_str()); + return create_socket(name().c_str(), flags, perm(), uid(), gid(), context.c_str(), sehandle); } const std::string SocketInfo::key() const { |