diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 2649e0472dfe..586ece78f783 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -5303,6 +5303,9 @@ static int bpf_map_get_info_by_fd(struct file *file, if (info.hash_size != SHA256_DIGEST_SIZE) return -EINVAL; + if (!READ_ONCE(map->frozen)) + return -EPERM; + err = map->ops->map_get_hash(map, SHA256_DIGEST_SIZE, map->sha); if (err != 0) return err;