2020-01-17 21:05:03 +08:00
|
|
|
# Copyright 2019 Google LLC
|
2019-03-19 00:21:48 +08:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
2022-01-28 17:38:27 +08:00
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
2019-03-19 00:21:48 +08:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2020-02-28 01:23:44 +08:00
|
|
|
load("//sandboxed_api/bazel:build_defs.bzl", "sapi_platform_copts")
|
|
|
|
|
2022-07-18 22:43:53 +08:00
|
|
|
_DEFAULT_VISIBILITY = [
|
2020-11-20 00:37:15 +08:00
|
|
|
"//security/bedebox:__subpackages__",
|
2022-07-18 22:43:53 +08:00
|
|
|
"//sandboxed_api:__subpackages__",
|
|
|
|
]
|
|
|
|
|
2022-11-29 01:55:23 +08:00
|
|
|
package(
|
|
|
|
default_visibility = _DEFAULT_VISIBILITY,
|
|
|
|
)
|
2022-07-18 22:43:53 +08:00
|
|
|
|
|
|
|
package_group(
|
|
|
|
name = "minielf_users",
|
|
|
|
packages = [
|
|
|
|
"//buzz/diffractor/sandbox/...", # mbonadei@ and ossu@ (alternatively rtc-diffractor-eng@)
|
|
|
|
],
|
|
|
|
)
|
2019-03-19 00:21:48 +08:00
|
|
|
|
2022-02-03 23:09:37 +08:00
|
|
|
licenses(["notice"])
|
2019-03-19 00:21:48 +08:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "bpf_helper",
|
|
|
|
srcs = ["bpf_helper.c"],
|
|
|
|
hdrs = ["bpf_helper.h"],
|
2019-05-09 20:21:11 +08:00
|
|
|
copts = sapi_platform_copts([
|
|
|
|
]),
|
2019-06-27 18:43:10 +08:00
|
|
|
visibility = ["//visibility:public"],
|
2019-03-19 00:21:48 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "minielf",
|
|
|
|
srcs = ["minielf.cc"],
|
|
|
|
hdrs = ["minielf.h"],
|
2019-05-09 20:21:11 +08:00
|
|
|
copts = sapi_platform_copts(),
|
2022-07-18 22:43:53 +08:00
|
|
|
visibility = _DEFAULT_VISIBILITY + [":minielf_users"],
|
2019-03-19 00:21:48 +08:00
|
|
|
deps = [
|
2021-01-14 01:25:25 +08:00
|
|
|
"//sandboxed_api:config",
|
2019-03-19 00:21:48 +08:00
|
|
|
"//sandboxed_api/sandbox2:util",
|
|
|
|
"//sandboxed_api/util:raw_logging",
|
|
|
|
"//sandboxed_api/util:status",
|
2021-01-14 01:25:25 +08:00
|
|
|
"//sandboxed_api/util:strerror",
|
2019-03-19 00:21:48 +08:00
|
|
|
"@com_google_absl//absl/base:endian",
|
2020-02-28 01:23:44 +08:00
|
|
|
"@com_google_absl//absl/status",
|
2020-09-02 23:46:48 +08:00
|
|
|
"@com_google_absl//absl/status:statusor",
|
2019-03-19 00:21:48 +08:00
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "minielf_test",
|
|
|
|
srcs = ["minielf_test.cc"],
|
2019-05-09 20:21:11 +08:00
|
|
|
copts = sapi_platform_copts(),
|
2019-03-19 00:21:48 +08:00
|
|
|
data = [
|
|
|
|
":testdata/chrome_grte_header",
|
|
|
|
":testdata/hello_world",
|
|
|
|
],
|
|
|
|
features = ["-dynamic_link_test_srcs"], # see go/dynamic_link_test_srcs
|
|
|
|
deps = [
|
|
|
|
":maps_parser",
|
|
|
|
":minielf",
|
2021-01-14 01:25:25 +08:00
|
|
|
"//sandboxed_api:testing",
|
|
|
|
"//sandboxed_api/util:file_helpers",
|
2019-03-19 00:21:48 +08:00
|
|
|
"//sandboxed_api/util:status_matchers",
|
2020-12-11 16:47:58 +08:00
|
|
|
"@com_google_absl//absl/algorithm:container",
|
2019-03-19 00:21:48 +08:00
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-11-30 21:20:42 +08:00
|
|
|
cc_library(
|
|
|
|
name = "syscall_trap",
|
|
|
|
srcs = ["syscall_trap.cc"],
|
|
|
|
hdrs = ["syscall_trap.h"],
|
|
|
|
copts = sapi_platform_copts(),
|
|
|
|
deps = [
|
|
|
|
"//sandboxed_api:config",
|
|
|
|
"@com_google_absl//absl/log:check",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-03-19 00:21:48 +08:00
|
|
|
cc_library(
|
|
|
|
name = "maps_parser",
|
|
|
|
srcs = ["maps_parser.cc"],
|
|
|
|
hdrs = ["maps_parser.h"],
|
2019-05-09 20:21:11 +08:00
|
|
|
copts = sapi_platform_copts(),
|
2019-03-19 00:21:48 +08:00
|
|
|
deps = [
|
2020-02-28 01:23:44 +08:00
|
|
|
"@com_google_absl//absl/status",
|
2020-09-02 23:46:48 +08:00
|
|
|
"@com_google_absl//absl/status:statusor",
|
2019-03-19 00:21:48 +08:00
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "maps_parser_test",
|
|
|
|
srcs = ["maps_parser_test.cc"],
|
2019-05-09 20:21:11 +08:00
|
|
|
copts = sapi_platform_copts(),
|
2019-03-19 00:21:48 +08:00
|
|
|
deps = [
|
|
|
|
":maps_parser",
|
|
|
|
"//sandboxed_api/util:status_matchers",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|