HostAPd is a rather complex application and running with full root privileges introduces possible security risks. It can be limited to use only the needed capabilities (cap_net_admin,cap_net_raw+ei) instead through the filecaps USE flag.
How can it be limited to just have the privileges it needs? Just adding a use flag does not do anything, and from what I can read, there does not seem to be a way to compile hostapd to work like this. Can you please give me a link to more info on how to build hostapd this way? (Or a patch for the ebuild if you already have it running locally)
This is how it runs on android from what I know. I got the flags from android's https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/client/site_tests/security_SuidBinaries/baseline.fscap Unfortunately I can't test it on my current Gentoo hardened set up (no hardware). More on the make process here -> https://android.googlesource.com/platform/external/wpa_supplicant_8/ I'll be able to help more on this in a couple of months where I'll return to my lab. Thanks for your time.
Okay, I have taken a look there, but nothing I can find in there seems to point in the right direction. Closing for now - please feel free to reopen when you get time later on :-)