summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGianluca Borello <g.borello@gmail.com>2017-01-09 10:19:46 -0800
committerDavid S. Miller <davem@davemloft.net>2017-01-09 16:56:26 -0500
commitdbcfe5f76dd5266b8f308b5a8f9ef52f74b2d6e7 (patch)
tree168eb4e0a8d5c5267b315afebad855f5c2d3be57 /drivers
parentf3a3e248f3f7cd9a4bed334022704d7e7fc781bf (diff)
downloadop-kernel-dev-dbcfe5f76dd5266b8f308b5a8f9ef52f74b2d6e7.zip
op-kernel-dev-dbcfe5f76dd5266b8f308b5a8f9ef52f74b2d6e7.tar.gz
bpf: split check_mem_access logic for map values
Move the logic to check memory accesses to a PTR_TO_MAP_VALUE_ADJ from check_mem_access() to a separate helper check_map_access_adj(). This enables to use those checks in other parts of the verifier as well, where boundaries on PTR_TO_MAP_VALUE_ADJ might need to be checked, for example when checking helper function arguments. The same thing is already happening for other types such as PTR_TO_PACKET and its check_packet_access() helper. The code has been copied verbatim, with the only difference of removing the "off += reg->max_value" statement and moving the sum into the call statement to check_map_access(), as that was only needed due to the earlier common check_map_access() call. Signed-off-by: Gianluca Borello <g.borello@gmail.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud