summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/netdev-times.py
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2019-08-23 09:54:09 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-06 10:18:11 +0200
commit1f1d46fe5cc0a5bc1421158fd2fec29852999fe3 (patch)
tree250c04853ed80778c6749ba0b98cbab359ffd37f /tools/perf/scripts/python/netdev-times.py
parent77529c247cc212aea4600e8c552a063abf5f91e4 (diff)
dm table: fix invalid memory accesses with too high sector number
commit 1cfd5d3399e87167b7f9157ef99daa0e959f395d upstream. If the sector number is too high, dm_table_find_target() should return a pointer to a zeroed dm_target structure (the caller should test it with dm_target_is_valid). However, for some table sizes, the code in dm_table_find_target() that performs btree lookup will access out of bound memory structures. Fix this bug by testing the sector number at the beginning of dm_table_find_target(). Also, add an "inline" keyword to the function dm_table_get_size() because this is a hot path. Fixes: 512875bd9661 ("dm: table detect io beyond device") Cc: stable@vger.kernel.org Reported-by: Zhang Tao <kontais@zoho.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/netdev-times.py')
0 files changed, 0 insertions, 0 deletions