Skip to content

Fix wolfIP fenrir issues#46

Merged
danielinux merged 1 commit intowolfSSL:masterfrom
aidangarske:fix-fenrirwolfip
Feb 25, 2026
Merged

Fix wolfIP fenrir issues#46
danielinux merged 1 commit intowolfSSL:masterfrom
aidangarske:fix-fenrirwolfip

Conversation

@aidangarske
Copy link
Member

@aidangarske aidangarske commented Feb 24, 2026

No description provided.

@aidangarske aidangarske self-assigned this Feb 24, 2026
Copilot AI review requested due to automatic review settings February 24, 2026 21:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses multiple security and reliability issues identified in the wolfIP network stack implementation, focusing on input validation, checksum verification, and buffer overflow prevention.

Changes:

  • Added checksum validation for IP, TCP, and UDP packets to prevent accepting corrupted data
  • Implemented retry limits and bounds checking to prevent infinite loops and buffer overflows
  • Fixed macro definitions and removed duplicate code in socket binding operations

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/wolfip_debug.c Added bounds check to prevent buffer underflow when computing UDP payload print length
src/wolfip.c Added transport/IP checksum validation, TCP retry limits with backoff clamping, timer heap bounds check, fixed IS_IP_BCAST macro, removed duplicate bind code, and relaxed ICMP frame length check
src/wolfesp.c Added underflow guard for ESP replay window sequence number calculation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

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

Please add unit tests parsing valid/invalid checksum for IP, UDP, TCP

Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

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

some of the existing unit tests might be injecting packets with invalid/zeroed checksum and might need some rework

@aidangarske aidangarske force-pushed the fix-fenrirwolfip branch 2 times, most recently from 18a93cb to 4946ad3 Compare February 25, 2026 02:57
Copilot AI review requested due to automatic review settings February 25, 2026 03:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/test/unit/unit.c:1177

  • The test declares a payload array of 4 bytes but then attempts to insert 8 bytes from it at line 1177. This causes undefined behavior due to reading beyond array bounds. The payload array should be declared with 8 elements to match the original intent of the test, or the insertion length at line 1177 should be reduced to 4 bytes. Given the test name suggests checking behavior when position plus length is less than or equal to head, using a 4-byte array and 4-byte insertion would still be valid.
    uint8_t payload[4] = {1,2,3,4};
    uint32_t head_before;

    queue_init(&q, data, sizeof(data), 0);
    ck_assert_int_eq(queue_insert(&q, payload, 0, 8), 0);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 25, 2026 03:35
@aidangarske aidangarske marked this pull request as ready for review February 25, 2026 03:36
@aidangarske aidangarske requested review from danielinux and removed request for Copilot February 25, 2026 03:36
Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

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

LGTM,. please squash into one commit

@danielinux danielinux merged commit 3201467 into wolfSSL:master Feb 25, 2026
19 checks passed
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.

4 participants