Alexei Starovoitov bb7f0f989c bpf: fix integer overflows
There were various issues related to the limited size of integers used in
the verifier:
 - `off + size` overflow in __check_map_access()
 - `off + reg->off` overflow in check_mem_access()
 - `off + reg->var_off.value` overflow or 32-bit truncation of
   `reg->var_off.value` in check_mem_access()
 - 32-bit truncation in check_stack_boundary()

Make sure that any integer math cannot overflow by not allowing
pointer math with large values.

Also reduce the scope of "scalar op scalar" tracking.

Fixes: f1174f77b50c ("bpf/verifier: rework value tracking")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2017-12-21 02:15:41 +01:00
..
2017-11-30 13:37:29 +01:00
2017-11-15 10:56:56 -08:00
2017-12-21 02:15:41 +01:00
2017-11-15 20:30:12 -08:00
2017-12-15 13:35:36 -05:00
2017-11-15 14:54:53 -08:00
2017-12-14 18:21:33 -08:00
2017-11-20 21:50:24 -10:00
2017-11-16 13:06:27 -08:00