Skip to content

vwifi: zero-initialize station_info in connect paths#93

Open
ga13234624 wants to merge 1 commit into
sysprog21:mainfrom
ga13234624:fix-vwifi-bug
Open

vwifi: zero-initialize station_info in connect paths#93
ga13234624 wants to merge 1 commit into
sysprog21:mainfrom
ga13234624:fix-vwifi-bug

Conversation

@ga13234624

Copy link
Copy Markdown

Both vwifi_virtio_mgmt_rx_connect_request() and vwifi_connect_routine() allocated struct station_info with kmalloc(), leaving the ->filled bitmap and other members uninitialized. cfg80211 inspects ->filled to decide which fields are valid, so passing garbage there causes it to read uninitialized members, leading to a kernel panic.

Use kzalloc() in both call sites to ensure all fields start zeroed. The explicitly assigned assoc_req_ies/assoc_req_ies_len are unaffected, as they are read unconditionally rather than gated by ->filled.

Both vwifi_virtio_mgmt_rx_connect_request() and vwifi_connect_routine()
allocated struct station_info with kmalloc(), leaving the ->filled
bitmap and other members uninitialized. cfg80211 inspects ->filled to
decide which fields are valid, so passing garbage there causes it to
read uninitialized members, leading to a kernel panic.

Use kzalloc() in both call sites to ensure all fields start zeroed.
The explicitly assigned assoc_req_ies/assoc_req_ies_len are unaffected,
as they are read unconditionally rather than gated by ->filled.
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