public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* re: bpf: allow bpf programs to tail-call other bpf programs
@ 2015-05-23 17:33 Dan Carpenter
  2015-05-26 16:01 ` Alexei Starovoitov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-05-23 17:33 UTC (permalink / raw)
  To: kernel-janitors

Hello Alexei Starovoitov,

This is a semi-automatic email about new static checker warnings.

The patch 04fd61ab36ec: "bpf: allow bpf programs to tail-call other 
bpf programs" from May 19, 2015, leads to the following Smatch 
complaint:

kernel/bpf/verifier.c:921 check_call()
	 error: we previously assumed 'map' could be null (see line 911)

kernel/bpf/verifier.c
   910	
   911		if (map && map->map_type = BPF_MAP_TYPE_PROG_ARRAY &&
                    ^^^
Patch introduces a check for NULL.

   912		    func_id != BPF_FUNC_tail_call)
   913			/* prog_array map type needs extra care:
   914			 * only allow to pass it into bpf_tail_call() for now.
   915			 * bpf_map_delete_elem() can be allowed in the future,
   916			 * while bpf_map_update_elem() must only be done via syscall
   917			 */
   918			return -EINVAL;
   919	
   920		if (func_id = BPF_FUNC_tail_call &&
   921		    map->map_type != BPF_MAP_TYPE_PROG_ARRAY)
                    ^^^^^^^^^^^^^
New unchecked dereference.

   922			/* don't allow any other map type to be passed into
   923			 * bpf_tail_call()

regards,
dan carpenter

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

end of thread, other threads:[~2015-05-26 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-23 17:33 bpf: allow bpf programs to tail-call other bpf programs Dan Carpenter
2015-05-26 16:01 ` Alexei Starovoitov
2015-05-26 16:16 ` Daniel Borkmann
2015-05-26 16:30 ` Alexei Starovoitov

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