xref: /aosp_15_r20/frameworks/native/libs/binder/tests/unit_fuzzers/Android.bp (revision 38e8c45f13ce32b0dcecb25141ffecaf386fa17f)
1//
2// Copyright (C) 2020 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "frameworks_native_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["frameworks_native_license"],
24}
25
26cc_defaults {
27    name: "binder_fuzz_defaults",
28    host_supported: true,
29    cflags: [
30        "-Wall",
31        "-Werror",
32    ],
33    target: {
34        android: {
35            shared_libs: [
36                "libcutils",
37                "libutils",
38                "libbase",
39                "libbinder",
40            ],
41        },
42        host: {
43            static_libs: [
44                "libcutils",
45                "liblog",
46                "libutils",
47                "libbase",
48                "libbinder",
49            ],
50        },
51        darwin: {
52            enabled: false,
53        },
54    },
55    fuzz_config: {
56        cc: [
57            "[email protected]",
58            "[email protected]",
59        ],
60        componentid: 32456,
61        description: "The fuzzer targets the APIs of libbinder",
62        vector: "local_no_privileges_required",
63        service_privilege: "privileged",
64        users: "multi_user",
65        fuzzed_code_usage: "shipped",
66    },
67}
68
69cc_fuzz {
70    name: "binder_binderFuzz",
71    defaults: ["binder_fuzz_defaults"],
72    srcs: ["BinderFuzz.cpp"],
73}
74
75cc_fuzz {
76    name: "binder_bpBinderFuzz",
77    defaults: ["binder_fuzz_defaults"],
78    srcs: ["BpBinderFuzz.cpp"],
79}
80
81cc_fuzz {
82    name: "binder_persistableBundleFuzz",
83    defaults: ["binder_fuzz_defaults"],
84    srcs: ["PersistableBundleFuzz.cpp"],
85}
86
87cc_fuzz {
88    name: "binder_stabilityFuzz",
89    defaults: ["binder_fuzz_defaults"],
90    srcs: ["StabilityFuzz.cpp"],
91}
92
93cc_fuzz {
94    name: "binder_statusFuzz",
95    defaults: ["binder_fuzz_defaults"],
96    srcs: ["StatusFuzz.cpp"],
97}
98
99cc_fuzz {
100    name: "binder_textOutputFuzz",
101    defaults: ["binder_fuzz_defaults"],
102    srcs: ["TextOutputFuzz.cpp"],
103}
104
105cc_fuzz {
106    name: "binder_bufferedTextOutputFuzz",
107    include_dirs: [
108        "frameworks/native/libs/binder",
109    ],
110    defaults: ["binder_fuzz_defaults"],
111    srcs: ["BufferedTextOutputFuzz.cpp"],
112}
113
114cc_fuzz {
115    name: "binder_memoryDealerFuzz",
116    defaults: ["binder_fuzz_defaults"],
117    srcs: ["MemoryDealerFuzz.cpp"],
118}
119
120cc_fuzz {
121    name: "binder_recordedTransactionFileFuzz",
122    defaults: ["binder_fuzz_defaults"],
123    srcs: ["RecordedTransactionFileFuzz.cpp"],
124    corpus: [
125        "recorded_transaction_corpus/*",
126    ],
127}
128
129cc_fuzz {
130    name: "binder_recordedTransactionFuzz",
131    defaults: ["binder_fuzz_defaults"],
132    srcs: ["RecordedTransactionFuzz.cpp"],
133    target: {
134        android: {
135            shared_libs: [
136                "libcutils",
137                "libutils",
138                "libbase",
139                "libbinder",
140            ],
141            static_libs: ["libbinder_random_parcel"],
142        },
143        host: {
144            static_libs: [
145                "libcutils",
146                "liblog",
147                "libutils",
148                "libbase",
149                "libbinder",
150                "libbinder_random_parcel",
151            ],
152        },
153        darwin: {
154            enabled: false,
155        },
156    },
157}
158