Merge "detect inability to write to index != 0 of bpf map array" am: 515bf77a8a
am: 199dce675c
am: 730471caac
am: 91bb1c9f5e
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2168142 Change-Id: Ib3c8b5454cc761c34b9c79c4c7547445c1c1e375 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
d89a930475
1 changed files with 9 additions and 0 deletions
|
@ -275,6 +275,15 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
int key = 1;
|
||||
int value = 123;
|
||||
android::base::unique_fd map(
|
||||
android::bpf::createMap(BPF_MAP_TYPE_ARRAY, sizeof(key), sizeof(value), 2, 0));
|
||||
if (android::bpf::writeToMapEntry(map, &key, &value, BPF_ANY)) {
|
||||
ALOGE("Critical kernel bug - failure to write into index 1 of 2 element bpf map array.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (android::base::SetProperty("bpf.progs_loaded", "1") == false) {
|
||||
ALOGE("Failed to set bpf.progs_loaded property");
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue