--- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -1763,7 +1763,7 @@ static int btf_enum_check_member(struct struct_size = struct_type->size; bytes_offset = BITS_ROUNDDOWN_BYTES(struct_bits_off); - if (struct_size - bytes_offset < sizeof(int)) { + if (struct_size - bytes_offset < member_type->size) { btf_verifier_log_member(env, struct_type, member, "Member exceeds struct_size"); return -EINVAL;