Exploit databaseDownload repository ZIP
GH-cc64c111644d9f76a3f77b0cdaed584e
satheesh575555/system_bt_aosp_10_r33_cve-2021-0316
Sources for CVE-2021-0316
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files26
satheesh575555/system_bt_aosp_10_r33_cve-2021-0316Revision d291fc085ab3
- ↑..Parent directory
- bluetooth_a2dp_sink_binder_server.cc
- bluetooth_a2dp_sink_binder_server.h
- bluetooth_a2dp_source_binder_server.cc
- bluetooth_a2dp_source_binder_server.h
- bluetooth_avrcp_control_binder_server.cc
- bluetooth_avrcp_control_binder_server.h
- bluetooth_avrcp_target_binder_server.cc
- bluetooth_avrcp_target_binder_server.h
- bluetooth_binder_server.cc
- bluetooth_binder_server.h
- bluetooth_gatt_client_binder_server.cc
- bluetooth_gatt_client_binder_server.h
- bluetooth_gatt_server_binder_server.cc
- bluetooth_gatt_server_binder_server.h
- bluetooth_le_advertiser_binder_server.cc
- bluetooth_le_advertiser_binder_server.h
- bluetooth_le_scanner_binder_server.cc
- bluetooth_le_scanner_binder_server.h
- bluetooth_low_energy_binder_server.cc
- bluetooth_low_energy_binder_server.h
- interface_with_instances_base.cc
- interface_with_instances_base.h
- ipc_handler_binder.cc
- ipc_handler_binder.h
- remote_callback_list.h
- remote_callback_map.h
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
service/ipc/binder/ipc_handler_binder.cc
Text · 2,547 bytes//
// Copyright 2015 Google, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "service/ipc/binder/ipc_handler_binder.h"
#include <base/bind.h>
#include <base/logging.h>
#include <base/message_loop/message_loop.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
#include "service/ipc/binder/bluetooth_binder_server.h"
using android::defaultServiceManager;
using android::sp;
using android::status_t;
using android::String8;
using android::String16;
namespace ipc {
std::string kServiceName = "bluetooth-service";
IPCHandlerBinder::IPCHandlerBinder(bluetooth::Adapter* adapter,
IPCManager::Delegate* delegate)
: IPCHandler(adapter, delegate) {}
IPCHandlerBinder::~IPCHandlerBinder() {}
bool IPCHandlerBinder::Run() {
CHECK(adapter());
// Register the IBluetooth service with the Android ServiceManager.
android::sp<binder::BluetoothBinderServer> bt_server =
new binder::BluetoothBinderServer(adapter());
status_t status = defaultServiceManager()->addService(
String16(String8(kServiceName.c_str())), bt_server);
if (status != android::NO_ERROR) {
LOG(ERROR) << "Failed to register Bluetooth service with ServiceManager";
return false;
}
// Notify the delegate. We do this in the message loop to avoid reentrancy.
if (delegate()) {
base::MessageLoop::current()->task_runner()->PostTask(
FROM_HERE, base::Bind(&IPCHandlerBinder::NotifyStarted, this));
}
android::ProcessState::self()->startThreadPool();
return true;
}
void IPCHandlerBinder::Stop() {
// TODO(armansito): There are several methods in android::IPCThreadState that
// are related to shutting down the threadpool, however I haven't been able to
// make them shut things down cleanly. Figure out the right way to stop the
// Binder IPC here.
}
void IPCHandlerBinder::NotifyStarted() {
if (delegate()) delegate()->OnIPCHandlerStarted(IPCManager::TYPE_BINDER);
}
} // namespace ipc