Skip to content

RtlJaguarDevice: validate radiotap header length and read it_len as le16#38

Merged
josephnef merged 1 commit into
masterfrom
hardening/radiotap-itlen-bounds
May 23, 2026
Merged

RtlJaguarDevice: validate radiotap header length and read it_len as le16#38
josephnef merged 1 commit into
masterfrom
hardening/radiotap-itlen-bounds

Conversation

@josephnef
Copy link
Copy Markdown
Collaborator

Summary

Follow-up hardening on top of PR #31. Two concerns the PR #31 guard didn't cover:

  1. packet[2] was dereferenced with no check that length is large enough to hold the radiotap header. Bail early if length < sizeof(struct ieee80211_radiotap_header).
  2. The radiotap it_len field is __le16 at bytes 2-3, not a single byte. Use get_unaligned_le16() to match Radiotap.c:215 and the IEEE80211_RADIOTAP_TX_FLAGS reader four lines down in the same function.

Threat model: the only caller of send_packet is txdemo with a hardcoded local beacon, so this is defensive hardening, not a deployed-system bug.

Test plan

  • cmake build clean (WiFiDriver + WiFiDriverDemo + WiFiDriverTxDemo)
  • txdemo smoke run on RTL8812AU still emits the beacon (no behavioural change expected — the normal beacon path has length well above sizeof(ieee80211_radiotap_header) and it_len = 0x0d)

Two concerns left over from PR #31:

1. packet[2] was dereferenced with no check that length is large enough
   to hold the radiotap header. Bail early if length is smaller than
   sizeof(struct ieee80211_radiotap_header).

2. The radiotap it_len field is __le16 at bytes 2-3, not a single byte.
   Use get_unaligned_le16() to match Radiotap.c:215 and the
   IEEE80211_RADIOTAP_TX_FLAGS reader four lines down.

Only caller is txdemo with a hardcoded local beacon, so this is
defensive hardening rather than a deployed-system bug.
@josephnef josephnef merged commit 7239a68 into master May 23, 2026
5 checks passed
@josephnef josephnef deleted the hardening/radiotap-itlen-bounds branch May 23, 2026 13:10
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.

1 participant