8000 Improve fuzzing coverage further by ctz · Pull Request #2267 · rustls/rustls · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve fuzzing coverage further #2267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 16, 2024
Merged

Improve fuzzing coverage further #2267

merged 3 commits into from
Dec 16, 2024

Conversation

ctz
Copy link
Member
@ctz ctz commented Dec 10, 2024

Before this PR the client and server fuzzers were pretty limited. Both of them suffered from using real cryptography: fuzzers (obviously) cannot make progress in the face of this, and perform badly if the fuzzed program is non-deterministic, so they would never be able to complete a handshake. The server one was even worse than that: it didn't have any server auth key, so the handshake would be instantly aborted after client hello handling.

This PR introduces a fuzzing-only CryptoProvider that is completely deterministic, and doesn't do any cryptography. The theory of this is fuzzing should be able to access more of the handshake. The corpus for these now contains a whole handshake, so the fuzzers start out in a more advanced position.

To quantify that, here are measurements of coverage in src/server or src/client using the base corpus (that is, files that are checked into the repo.)

Before this PR:

  • client: 22.02%
  • server: 9.53%

After this PR:

  • client: 40.98%
  • server: 45.41%

After this PR, with 5 minutes fuzzing:

  • client: 45.75%
  • server: 52.48%

There's still future work to do here: no support for QUIC, client auth, etc.

Copy link
rustls-benchmarking bot commented Dec 10, 2024

Benchmark results

Instruction counts

Significant differences

There are no significant instruction count differences

Other differences

Click to expand
Scenario Baseline Candidate Diff Threshold
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 8583459 8561945 -21514 (-0.25%) 0.97%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_server 10703425 10681366 -22059 (-0.21%) 0.83%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_server 10451624 10437045 -14579 (-0.14%) 1.32%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 3079947 3076257 -3690 (-0.12%) 0.23%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 8572904 8582981 10077 (0.12%) 0.74%
handshake_no_resume_ring_1.3_ecdsap256_aes_client 3623120 3620947 -2173 (-0.06%) 0.24%
handshake_no_resume_ring_1.3_ecdsap256_chacha_client 3622542 3624352 1810 (0.05%) 0.25%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_server 10732572 10736551 3979 (0.04%) 1.02%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 1176633 1176522 -111 (-0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 1174232 1174331 99 (0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 3082351 3082571 220 (0.01%) 0.26%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 2073608 2073700 92 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_server 28964393 28964746 353 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_server 30419979 30420274 295 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_server 28962501 28962238 -263 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_server 30422498 30422769 271 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_client 1932277 1932262 -15 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_client 28175173 28175373 200 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_server 28886044 28885840 -204 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_chacha_server 1613406 1613396 -10 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_client 28204947 28204800 -147 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_client 27837598 27837458 -140 (-0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_client 1717621 1717614 -7 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_server 30380191 30380078 -113 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_server 28886060 28885957 -103 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_server 28883747 28883845 98 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 2076640 2076647 7 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_client 27777940 27778027 87 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_client 27784713 27784800 87 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_aes_server 1612033 1612028 -5 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_client 27780391 27780467 76 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_client 28208853 28208781 -72 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_server 7566522 7566504 -18 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_client 28178827 28178877 50 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_client 28201791 28201832 41 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_server 28964445 28964403 -42 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_client 27839957 27839917 -40 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_client 35182529 35182481 -48 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_server 30377250 30377282 32 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_server 30379924 30379952 28 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_server 30422786 30422759 -27 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_client 28171951 28171972 21 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_client 27844404 27844421 17 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 46464556 46464567 11 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_client 58245687 58245678 -9 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_server 46470684 46470691 7 (0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_server 46487103 46487096 -7 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 58240730 58240723 -7 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_client 92673025 92673015 -10 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 80648884 80648876 -8 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 92704732 92704724 -8 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 46456935 46456939 4 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_server 46477532 46477536 4 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_client 58338939 58338934 -5 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_server 46467805 46467808 3 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 58243606 58243603 -3 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_client 92710963 92710967 4 (0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_server 46389596 46389598 2 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_server 80661861 80661858 -3 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_client 58181208 58181210 2 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 92706965 92706962 -3 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_client 92674859 92674861 2 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_server 46423830 46423829 -1 (-0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_client 58225377 58225376 -1 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_server 80535651 80535650 -1 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_server 80554934 80554935 1 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_client 92663958 92663957 -1 (-0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_aes_client 40279773 40279773 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_server 42062468 42062468 0 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_client 1925520 1925520 0 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_client 4206559 4206559 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_client 40577420 40577420 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_client 40499230 40499230 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_aes_server 41602988 41602988 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_server 42064828 42064828 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_client 40573420 40573420 0 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_server 3870153 3870153 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_server 41486829 41486829 0 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_client 58331796 58331796 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_client 2655829 2655829 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_client 40275722 40275722 0 (0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_client 58342690 58342690 0 (0.00%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_server 11292368 11292368 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_server 41966678 41966678 0 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 80641262 80641262 0 (0.00%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_server 4695630 4695630 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_server 41964128 41964128 0 (0.00%) 0.20%
handshake_session_id_ring_1.2_rsa_aes_server 4231150 4231150 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_client 40178459 40178459 0 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_client 3864565 3864565 0 (0.00%) 0.20%
handshake_session_id_ring_1.2_rsa_aes_client 4228449 4228449 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_server 41605089 41605089 0 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_server 80540451 80540451 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_client 40272779 40272779 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_server 42065018 42065018 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_client 40495969 40495969 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_server 11430794 11430794 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_client 2661696 2661696 0 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_server 5020394 5020394 0 (0.00%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_client 4488873 4488873 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_client 40185453 40185453 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_server 41966488 41966488 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_client 35180574 35180574 0 (0.00%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_client 2563534 2563534 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_client 40570159 40570159 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_server 41484728 41484728 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_server 41486781 41486781 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_server 7564362 7564362 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_server 11424839 11424839 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_client 40503230 40503230 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_client 40181402 40181402 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_server 41605041 41605041 0 (0.00%) 0.20%

Wall-time

Significant differences

There are no significant wall-time differences

Other differences

Click to expand
Scenario Baseline Candidate Diff Threshold
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes 4.51 ms 4.41 ms -0.10 ms (-2.13%) 3.83%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes 5.15 ms 5.05 ms -0.10 ms (-2.03%) 3.47%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes 5.23 ms 5.13 ms -0.10 ms (-1.85%) 3.68%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes 5.08 ms 4.99 ms -0.09 ms (-1.77%) 3.93%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha 1.10 ms 1.09 ms -0.02 ms (-1.48%) 3.23%
transfer_no_resume_ring_1.3_ecdsap256_aes 6.35 ms 6.27 ms -0.09 ms (-1.38%) 2.93%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes 460.10 µs 454.20 µs -5.90 µs (-1.28%) 2.96%
transfer_no_resume_ring_1.2_rsa_aes 6.77 ms 6.69 ms -0.08 ms (-1.24%) 2.28%
transfer_no_resume_ring_1.3_rsa_aes 6.84 ms 6.76 ms -0.08 ms (-1.23%) 2.66%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 458.23 µs 452.63 µs -5.59 µs (-1.22%) 2.71%
handshake_no_resume_ring_1.3_ecdsap256_chacha 501.72 µs 496.10 µs -5.62 µs (-1.12%) 2.10%
handshake_no_resume_ring_1.3_ecdsap256_aes 504.17 µs 499.47 µs -4.70 µs (-0.93%) 2.08%
transfer_no_resume_ring_1.3_ecdsap384_aes 9.45 ms 9.36 ms -0.09 ms (-0.92%) 1.94%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha 5.14 ms 5.09 ms -0.04 ms (-0.79%) 1.24%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes 1.06 ms 1.06 ms -0.01 ms (-0.78%) 2.24%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha 4.92 ms 4.89 ms -0.04 ms (-0.77%) 1.00%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes 4.31 ms 4.28 ms -0.03 ms (-0.74%) 1.09%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes 4.51 ms 4.48 ms -0.03 ms (-0.72%) 1.11%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha 4.99 ms 4.95 ms -0.04 ms (-0.71%) 1.09%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 12.97 ms 12.88 ms -0.09 ms (-0.70%) 1.57%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha 13.62 ms 13.53 ms -0.09 ms (-0.69%) 1.27%
handshake_session_id_aws_lc_rs_1.3_rsa_aes 4.96 ms 4.93 ms -0.03 ms (-0.66%) 1.00%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha 4.27 ms 4.25 ms -0.03 ms (-0.66%) 1.00%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes 5.03 ms 4.99 ms -0.03 ms (-0.65%) 1.00%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 13.69 ms 13.61 ms -0.09 ms (-0.63%) 1.38%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha 4.48 ms 4.45 ms -0.03 ms (-0.62%) 1.09%
transfer_no_resume_ring_1.3_rsa_chacha 13.49 ms 13.41 ms -0.08 ms (-0.62%) 1.35%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha 5.19 ms 5.16 ms -0.03 ms (-0.62%) 1.00%
transfer_no_resume_ring_1.3_ecdsap256_chacha 13.00 ms 12.92 ms -0.08 ms (-0.61%) 1.47%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes 5.22 ms 5.19 ms -0.03 ms (-0.59%) 1.00%
handshake_tickets_aws_lc_rs_1.3_rsa_aes 5.15 ms 5.12 ms -0.03 ms (-0.56%) 1.00%
transfer_no_resume_ring_1.3_ecdsap384_chacha 16.10 ms 16.01 ms -0.09 ms (-0.54%) 1.03%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes 1.09 ms 1.09 ms -0.00 ms (-0.45%) 2.36%
handshake_tickets_ring_1.2_rsa_aes 1.61 ms 1.60 ms -0.01 ms (-0.43%) 1.29%
handshake_no_resume_ring_1.2_rsa_aes 990.95 µs 987.20 µs -3.75 µs (-0.38%) 1.13%
handshake_no_resume_ring_1.3_rsa_chacha 993.62 µs 989.96 µs -3.66 µs (-0.37%) 1.00%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 1.17 ms 1.17 ms -0.00 ms (-0.35%) 1.14%
handshake_no_resume_ring_1.3_rsa_aes 993.53 µs 990.11 µs -3.42 µs (-0.34%) 1.00%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes 1.17 ms 1.17 ms -0.00 ms (-0.32%) 1.12%
handshake_tickets_ring_1.3_ecdsap256_chacha 6.36 ms 6.34 ms -0.02 ms (-0.26%) 1.00%
handshake_session_id_ring_1.3_ecdsap256_chacha 6.29 ms 6.27 ms -0.02 ms (-0.26%) 1.00%
handshake_session_id_ring_1.3_ecdsap256_aes 6.34 ms 6.32 ms -0.02 ms (-0.24%) 1.00%
handshake_tickets_ring_1.3_ecdsap256_aes 6.41 ms 6.39 ms -0.02 ms (-0.24%) 1.00%
handshake_session_id_ring_1.3_rsa_aes 6.83 ms 6.82 ms -0.02 ms (-0.24%) 1.00%
handshake_tickets_ring_1.3_rsa_chacha 6.85 ms 6.83 ms -0.02 ms (-0.23%) 1.00%
handshake_session_id_ring_1.3_rsa_chacha 6.78 ms 6.76 ms -0.02 ms (-0.22%) 1.00%
handshake_session_id_ring_1.2_rsa_aes 1.52 ms 1.52 ms -0.00 ms (-0.21%) 1.03%
handshake_tickets_ring_1.3_rsa_aes 6.90 ms 6.89 ms -0.01 ms (-0.20%) 1.00%
handshake_tickets_ring_1.3_ecdsap384_aes 9.49 ms 9.48 ms -0.02 ms (-0.19%) 1.00%
handshake_session_id_aws_lc_rs_1.2_rsa_aes 1.59 ms 1.59 ms -0.00 ms (-0.17%) 1.56%
handshake_session_id_ring_1.3_ecdsap384_aes 9.42 ms 9.41 ms -0.02 ms (-0.17%) 1.00%
handshake_tickets_ring_1.3_ecdsap384_chacha 9.45 ms 9.43 ms -0.02 ms (-0.17%) 1.00%
handshake_session_id_ring_1.3_ecdsap384_chacha 9.38 ms 9.36 ms -0.01 ms (-0.15%) 1.00%
handshake_no_resume_ring_1.3_ecdsap384_aes 3.60 ms 3.59 ms -0.00 ms (-0.13%) 1.00%
handshake_no_resume_ring_1.3_ecdsap384_chacha 3.60 ms 3.59 ms -0.00 ms (-0.13%) 1.00%
handshake_tickets_aws_lc_rs_1.2_rsa_aes 1.77 ms 1.77 ms -0.00 ms (-0.11%) 1.53%

Additional information

Historical results

Checkout details:

Copy link
codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.58%. Comparing base (00a3ddb) to head (1b7a274).
Report is 23 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2267   +/-   ##
=======================================
  Coverage   94.58%   94.58%           
=======================================
  Files         104      104           
  Lines       24025    24025           
=======================================
  Hits        22725    22725           
  Misses       1300     1300           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ctz ctz force-pushed the jbp-improve-fuzzing-coverage-2 branch 2 times, most recently from ac09b45 to d342431 Compare December 10, 2024 18:05
@ctz ctz marked this pull request as ready for review December 10, 2024 18:17
Copy link
Member
@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

Should we also consider digging into Deterministic Simulation Testing, maybe with Antithesis? (See https://turso.tech/blog/introducing-limbo-a-complete-rewrite-of-sqlite-in-rust#can-we-match-sqlite-s-world-famous-reliability-.)

This aids manual evaluation of how deep these get.
@ctz ctz force-pushed the jbp-improve-fuzzing-coverage-2 branch from d342431 to 53ad23d Compare December 11, 2024 12:51

fs::write(
"../fuzz/corpus/unbuffered/tls12-server.bin",
[&[0u8], &transcript.server_wrote[..]].concat(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: are the [..] suffixes necessary for these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah Concat only works for slices of slices or slice of str I think? At least removing it complains:

error[E0308]: mismatched types
  --> rustls-fuzzing-provider/tests/smoke.rs:20:18
   |
20 |         [&[0u8], transcript.server_wrote].concat(),
   |                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `&[u8; 1]`, found `Vec<u8>`
   |
   = note: expected reference `&[u8; 1]`
                 found struct `Vec<u8>`

[[0u8].as_slice(), transcript.server_wrote.as_slice()].concat(), is an alternative formulation with more words but less punctuation -- any preference?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the punctuation for its conciseness over the words.

ctz added 2 commits December 11, 2024 13:33
This is intended to be a deterministic and cryptography-free
CryptoProvider, so that fuzzing can reach further into the library.

Things like HMAC and hashing ignore input and produces fixed output.

Signing produces fixed output, verification accepts the same fixed
signature which allows clients to accept the certificate in the
corpus file, and should allow libfuzzer to explore branches around
there.

There is a test that checks this can talk to itself, and outputs
transcripts into the fuzzing corpus.

This is used by the client and server fuzzing harnesses.
This means fuzzing starts at a successful full handshake.
@ctz ctz force-pushed the jbp-improve-fuzzing-coverage-2 branch from 53ad23d to 1b7a274 Compare December 11, 2024 13:33
Copy link
Member
@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 👍

@cpu
Copy link
Member
cpu commented Dec 11, 2024

Should we also consider digging into Deterministic Simulation Testing, maybe with Antithesis? (See https://turso.tech/blog/introducing-limbo-a-complete-rewrite-of-sqlite-in-rust#can-we-match-sqlite-s-world-famous-reliability-.)

I was looking at Antithesis last night. It seems really cool but AFAICT it's proprietary & only available to paying customers?

@djc
Copy link
Member
djc commented Dec 11, 2024

Should we also consider digging into Deterministic Simulation Testing, maybe with Antithesis? (See https://turso.tech/blog/introducing-limbo-a-complete-rewrite-of-sqlite-in-rust#can-we-match-sqlite-s-world-famous-reliability-.)

I was looking at Antithesis last night. It seems really cool but AFAICT it's proprietary & only available to paying customers?

A single core would be 7k annually which might be manageable at the current funding rate, or at least good for some experiments? But also I wouldn't be surprised if we can get some sweet sponsorship if we do the integration work & publish a blog post about the process/findings.

@ctz
Copy link
Member Author
ctz commented Dec 16, 2024

I think this gets us closer to being able to do model checking and/or deterministic simulation testing, thanks to removing a large chunk of non-determinism. I think we'd also need to control for time, but we have the interface to do that now. However, I think the model/simulator would be pretty complex if it covered the whole library's APIs. But we could start with a simpler model, such as "data written into one side's io::Write appears from the other side's io::Read" which could be modeled/simulated with the cursor interface to Vec<u8>.

@ctz ctz added this pull request to the merge queue Dec 16, 2024
Merged via the queue into main with commit b620906 Dec 16, 2024
60 checks passed
@ctz ctz deleted the jbp-improve-fuzzing-coverage-2 branch December 16, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0