]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/net: psock_fanout seg faults in sock_fanout_read_ring()
authorShuah Khan <shuahkh@osg.samsung.com>
Tue, 11 Nov 2014 17:04:13 +0000 (10:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Nov 2014 02:43:34 +0000 (21:43 -0500)
commitf3767662493e21b1c6110da7c7a2d97d1301d900
tree563432a5328a8ebdfeffce9167a6bd8619ac93c1
parent1d378dd82c951ff08d6f00699271e312e756804e
selftests/net: psock_fanout seg faults in sock_fanout_read_ring()

The while loop in sock_fanout_read_ring() checks mmap region
bounds after access, causing it to segfault. Fix it to check
count before accessing header->tp_status. This problem can be
reproduced consistently when the test in run as follows:

    make -C tools/testing/selftests TARGETS=net run_tests
    or
    make run_tests from tools/testing/selftests
    or
    make run_test from tools/testing/selftests/net

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/psock_fanout.c