mbedtls/tests
Gilles Peskine 6667a78c9b Add test for mbedtls_net_poll beyond FD_SETSIZE
mbedtls_net_poll() and mbedtls_net_recv_timeout() rely on select(),
which represents sets of file descriptors through the fd_set type.
This type cannot hold file descriptors larger than FD_SETSIZE. Make
sure that these functions identify this failure code.

Without a proper range check of the file descriptor in the
mbedtls_net_xxx function, this test fails when running with UBSan:
```
net_poll beyond FD_SETSIZE ........................................ source/library/net_sockets.c:482:9: runtime error: index 16 out of bounds for type '__fd_mask [16]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/library/net_sockets.c:482:9 in
```
This is a non-regression test for
https://github.com/ARMmbed/mbedtls/issues/4169 .

The implementation of this test is specific to Unix-like platforms.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-02-25 15:56:48 +01:00
..
.jenkins
configs
data_files Merge pull request #3698 from darrenkrahn/development 2021-01-17 18:06:18 +00:00
docker/bionic
git-scripts
include/test Fix some C function documentation in the test framework 2021-02-23 20:36:07 +01:00
scripts Merge pull request #4110 from gilles-peskine-arm/psa-external-random-in-mbedtls 2021-02-22 14:47:29 +00:00
src Fix copypasta for the type of a variable 2021-02-23 20:36:07 +01:00
suites Add test for mbedtls_net_poll beyond FD_SETSIZE 2021-02-25 15:56:48 +01:00
.gitignore
CMakeLists.txt New test suite: net 2021-02-24 18:37:46 +01:00
compat-in-docker.sh
compat.sh
context-info.sh
Descriptions.txt
make-in-docker.sh
Makefile Explain the explicit dependency on instrument_record_status.h 2021-01-25 13:46:14 +01:00
ssl-opt-in-docker.sh
ssl-opt.sh Merge pull request #4136 from daverodgman/ssl-opt-gnutls-priority 2021-02-16 14:37:51 +00:00