diff options
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r-- | kernel/bpf/verifier.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 6a86723c5b64..4016774d5cca 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c | |||
@@ -1276,6 +1276,14 @@ static int check_map_func_compatibility(struct bpf_map *map, int func_id) | |||
1276 | func_id != BPF_FUNC_current_task_under_cgroup) | 1276 | func_id != BPF_FUNC_current_task_under_cgroup) |
1277 | goto error; | 1277 | goto error; |
1278 | break; | 1278 | break; |
1279 | /* devmap returns a pointer to a live net_device ifindex that we cannot | ||
1280 | * allow to be modified from bpf side. So do not allow lookup elements | ||
1281 | * for now. | ||
1282 | */ | ||
1283 | case BPF_MAP_TYPE_DEVMAP: | ||
1284 | if (func_id == BPF_FUNC_map_lookup_elem) | ||
1285 | goto error; | ||
1286 | break; | ||
1279 | case BPF_MAP_TYPE_ARRAY_OF_MAPS: | 1287 | case BPF_MAP_TYPE_ARRAY_OF_MAPS: |
1280 | case BPF_MAP_TYPE_HASH_OF_MAPS: | 1288 | case BPF_MAP_TYPE_HASH_OF_MAPS: |
1281 | if (func_id != BPF_FUNC_map_lookup_elem) | 1289 | if (func_id != BPF_FUNC_map_lookup_elem) |