]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/net: Add sk_bind_sendto_listen and sk_connect_zero_addr
authorJoanne Koong <joannelkoong@gmail.com>
Mon, 22 Aug 2022 18:10:23 +0000 (11:10 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Aug 2022 02:30:09 +0000 (19:30 -0700)
commite0fc213b3871e02cee8a99ad13659f28f115f869
tree73ff51aa3bc284c611e346b14f4ebe8b90f251b8
parentf97df01a9010bb35bb7800678202244bb5b68be3
selftests/net: Add sk_bind_sendto_listen and sk_connect_zero_addr

This patch adds 2 new tests: sk_bind_sendto_listen and
sk_connect_zero_addr.

The sk_bind_sendto_listen test exercises the path where a socket's
rcv saddr changes after it has been added to the binding tables,
and then a listen() on the socket is invoked. The listen() should
succeed.

The sk_bind_sendto_listen test is copied over from one of syzbot's
tests: https://syzkaller.appspot.com/x/repro.c?x=1673a38df00000

The sk_connect_zero_addr test exercises the path where the socket was
never previously added to the binding tables and it gets assigned a
saddr upon a connect() to address 0.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/.gitignore
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/sk_bind_sendto_listen.c [new file with mode: 0644]
tools/testing/selftests/net/sk_connect_zero_addr.c [new file with mode: 0644]