Merge "Set sehandle in voldFuzzer" am: c1572fe8cf
am: b43fe97e5a
am: 0d069ca15a
am: f15652879e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2492755 Change-Id: I4a06d795d1b0bba6587b7a76310cdab519f6462f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
1b09a317df
1 changed files with 12 additions and 0 deletions
|
@ -14,15 +14,27 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <fuzzbinder/libbinder_driver.h>
|
||||
|
||||
#include "VoldNativeService.h"
|
||||
#include "sehandle.h"
|
||||
|
||||
using ::android::fuzzService;
|
||||
using ::android::sp;
|
||||
|
||||
struct selabel_handle* sehandle;
|
||||
|
||||
extern "C" int LLVMFuzzerInitialize(int argc, char argv) {
|
||||
sehandle = selinux_android_file_context_handle();
|
||||
if (!sehandle) {
|
||||
LOG(ERROR) << "Failed to get SELinux file contexts handle in voldFuzzer!";
|
||||
exit(1);
|
||||
}
|
||||
selinux_android_set_sehandle(sehandle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
auto voldService = sp<android::vold::VoldNativeService>::make();
|
||||
fuzzService(voldService, FuzzedDataProvider(data, size));
|
||||
|
|
Loading…
Reference in a new issue