Re: [PATCH bpf-next v2 4/9] bpf: Replace PTR_TO_XXX_OR_NULL with PTR_TO_XXX | PTR_MAYBE_NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 16, 2021 at 4:32 PM Hao Luo <haoluo@xxxxxxxxxx> wrote:
> -       switch (ptr_reg->type) {
> -       case PTR_TO_MAP_VALUE_OR_NULL:
> -               verbose(env, "R%d pointer arithmetic on %s prohibited, null-check it first\n",
> -                       dst, reg_type_str[ptr_reg->type]);
> +       if (ptr_reg->type & PTR_MAYBE_NULL) {
> +               verbose(env, "R%d (of type %s) may be null, null-check it first\n",
> +                       dst, reg_type_str(env, ptr_reg->type));
>                 return -EACCES;

I manually fixed the merge conflict in bpf_verifier.h, since
the verifier log improvement patchset went in first.

Also reverted to the original message in the above hunk while applying,
since it says 'may be null' twice and breaks test_verifier tests
which were not updated by this patch.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux