Page MenuHomeFreeBSD

net80211: reduce stack usage for ieee80211_ioctl*() methods
ClosedPublic

Authored by avos on Jan 23 2016, 5:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 1:37 AM
Unknown Object (File)
Tue, Apr 30, 1:32 AM
Unknown Object (File)
Sat, Apr 20, 3:10 PM
Unknown Object (File)
Mon, Apr 8, 10:56 PM
Unknown Object (File)
Mar 11 2024, 6:28 AM
Unknown Object (File)
Jan 31 2024, 6:24 AM
Unknown Object (File)
Dec 22 2023, 10:46 PM
Unknown Object (File)
Dec 12 2023, 7:02 PM
Subscribers

Details

Summary
  • Use malloc(9) for ieee80211req_wpaie2 (518 bytes, used in ieee80211_ioctl_getwpaie()) and ieee80211_scan_req (128 bytes, used in setmlme_assoc_adhoc() and ieee80211_ioctl_scanreq()) structures.
  • Drop __noinline workarounds; stack overflow is not reproducible with recent compilers.
Test Plan

Tested with Clang 3.7.1, GCC 4.2.1 (from 9.3-RELEASE) and 4.9.4 (with -fstack-usage flag)
Stats from GCC 4.9.4:
ieee80211_ioctl.c:254:1:get_scan_space 8 static
ieee80211_ioctl.c:755:1:dummy_ioctl_get 4 static
ieee80211_ioctl.c:1830:1:findchannel 48 static
ieee80211_ioctl.c:2577:1:dummy_ioctl_set 4 static
ieee80211_ioctl.c:263:1:get_scan_result 64 dynamic,bounded
ieee80211_ioctl.c:377:1:get_sta_info 56 dynamic,bounded
ieee80211_ioctl.c:2404:1:ieee80211_scanreq 72 dynamic,bounded
ieee80211_ioctl.c:363:1:get_sta_space 4 static
ieee80211_ioctl.c:622:1:getappie.isra.8 24 dynamic,bounded
ieee80211_ioctl.c:2222:1:setappie.isra.17 40 dynamic,bounded
ieee80211_ioctl.c:1492:1:mlmelookup 24 dynamic,bounded
ieee80211_ioctl.c:1916:1:setcurchan 32 dynamic,bounded
ieee80211_ioctl.c:1251:1:mlmedebug 28 dynamic,bounded
ieee80211_ioctl.c:1292:1:domlme 24 dynamic,bounded
ieee80211_ioctl.c:3292:1:ieee80211_ioctl 188 dynamic,bounded

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avos retitled this revision from to net80211: reduce stack usage for ieee80211_ioctl*() methods.
avos updated this object.
avos edited the test plan for this revision. (Show Details)
avos added a reviewer: adrian.
avos set the repository for this revision to rS FreeBSD src repository - subversion.
adrian edited edge metadata.

looks fine!

sys/net80211/ieee80211_ioctl.c
925 ↗(On Diff #12623)

Just a as a note - I'd rather you just commit this duplicate code removal as a separate commit, rather than part of the memory allocation tidyup.

This revision is now accepted and ready to land.Jan 24 2016, 5:04 AM
This revision was automatically updated to reflect the committed changes.