public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] bpf, x86: add support for indirect jumps
@ 2025-11-19  8:35 Dan Carpenter
  2025-11-19 11:20 ` Anton Protopopov
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2025-11-19  8:35 UTC (permalink / raw)
  To: Anton Protopopov; +Cc: bpf

Hello Anton Protopopov,

Commit 493d9e0d6083 ("bpf, x86: add support for indirect jumps") from
Nov 5, 2025 (linux-next), leads to the following Smatch static
checker warning:

	kernel/bpf/verifier.c:17907 copy_insn_array()
	error: 'value' dereferencing possible ERR_PTR()

kernel/bpf/verifier.c
    17898 static int copy_insn_array(struct bpf_map *map, u32 start, u32 end, u32 *items)
    17899 {
    17900         struct bpf_insn_array_value *value;
    17901         u32 i;
    17902 
    17903         for (i = start; i <= end; i++) {
    17904                 value = map->ops->map_lookup_elem(map, &i);
    17905                 if (!value)
    17906                         return -EINVAL;
--> 17907                 items[i - start] = value->xlated_off;

->map_lookup_elem() returns error pointers on error and it returns NULL
(I guess if there isn't an error but the element is not found).

    17908         }
    17909         return 0;
    17910 }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-19 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19  8:35 [bug report] bpf, x86: add support for indirect jumps Dan Carpenter
2025-11-19 11:20 ` Anton Protopopov
2025-11-19 12:48   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox