detect inability to write to index != 0 of bpf map array
(this is a test for a kernel bug)
Bug: 240347583
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0cad47113a83dbd837cccc5229ef52b605cda203
(cherry picked from commit aba9024849)
Merged-In: I0cad47113a83dbd837cccc5229ef52b605cda203
This commit is contained in:
parent
04da9002f4
commit
ead9d83423
1 changed files with 9 additions and 0 deletions
|
|
@ -199,6 +199,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