openwrt/package/network/services/hostapd/patches
Mark Mentovai 398cbb76fa
hostapd: allow hostapd under ujail to communicate with hostapd_cli
When procd-ujail is available, 1f78538387 runs hostapd as user
"network", with only limited additional capabilities (CAP_NET_ADMIN and
CAP_NET_RAW).

hostapd_cli (CONFIG_PACKAGE_hostapd-utils) communicates with hostapd
over a named UNIX-domain socket. hostapd_cli is responsible for creating
this socket at /tmp/wpa_ctrl_$pid_$counter. Since it typically runs as
root, this endpoint is normally created with uid root, gid root, mode
0755. As a result, hostapd running as uid network is able to receive
control messages sent through this interface, but is not able to respond
to them. If debug-level logging is enabled (CONFIG_WPA_MSG_MIN_PRIORITY
<= 2 at build, and log_level <= 2 in /etc/config/wireless wifi-device),
this message will appear from hostapd:

CTRL: sendto failed: Permission denied

As a fix, hostapd_cli should create the socket node in the filesystem
with uid network, gid network, mode 0770. This borrows the presently
Android-only strategy already in hostapd intended to solve the same
problem on Android.

If procd-ujail is not available and hostapd falls back to running as
root, it will still be able to read from and write to the socket even if
the node in the filesystem has been restricted to the network user and
group. This matches the logic in
package/network/services/hostapd/files/wpad.init, which sets the uid and
gid of /var/run/hostapd to network regardless of whether procd-ujail is
available.

As it appears that the "network" user and group are statically allocated
uid 101 and gid 101, respectively, per
package/base-files/files/etc/passwd and USERID in
package/network/services/hostapd/Makefile, this patch also uses a
constant 101 for the uid and gid.

Signed-off-by: Mark Mentovai <mark@moxienet.com>
[refreshed patch]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-23 18:53:31 +00:00
..
001-wolfssl-init-RNG-with-ECC-key.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
011-mesh-use-deterministic-channel-on-channel-switch.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
020-mesh-make-forwarding-configurable.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
021-fix-sta-add-after-previous-connection.patch hostapd: fix adding back stations after a missed deauth/disassoc 2021-05-26 11:48:14 +02:00
022-hostapd-fix-use-of-uninitialized-stack-variables.patch hostapd: fix uninitialized stack variable on CSA 2021-07-12 13:34:08 +02:00
023-ndisc_snoop-call-dl_list_del-before-freeing-ipv6-add.patch hostapd: fix a segfault on sta disconnect with proxy arp enabled 2021-07-28 05:55:11 +02:00
030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch hostapd: make proxyarp work with libnl-tiny 2021-07-28 05:55:11 +02:00
100-daemonize_fix.patch hostapd: update to latest Git hostap_2_9-1238-gdd2daf0848ed 2020-05-21 08:18:01 +02:00
200-multicall.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
300-noscan.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
301-mesh-noscan.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
310-rescan_immediately.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
320-optional_rfkill.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
330-nl80211_fix_set_freq.patch hostapd: refresh patches 2021-08-28 01:31:15 +02:00
340-reload_freq_change.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
341-mesh-ctrl-iface-channel-switch.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
350-nl80211_del_beacon_bss.patch hostapd: refresh patches 2021-08-28 01:31:15 +02:00
360-ctrl_iface_reload.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
370-ap_sta_support.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
380-disable_ctrl_iface_mib.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
381-hostapd_cli_UNKNOWN-COMMAND.patch hostapd: update to latest Git hostap_2_9-1238-gdd2daf0848ed 2020-05-21 08:18:01 +02:00
390-wpa_ie_cap_workaround.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
400-wps_single_auth_enc_type.patch hostapd: update to latest Git hostap_2_9-1238-gdd2daf0848ed 2020-05-21 08:18:01 +02:00
410-limit_debug_messages.patch hostapd: update to latest Git hostap_2_9-1238-gdd2daf0848ed 2020-05-21 08:18:01 +02:00
420-indicate-features.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
430-hostapd_cli_ifdef.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
431-wpa_cli_ifdef.patch hostapd: unconditionally enable ap/mesh for wpa-cli 2020-01-28 14:38:43 +01:00
432-missing-typedef.patch hostapd: fix compilation error in wext backend 2016-06-15 19:10:32 +02:00
450-scan_wait.patch hostapd: update to latest Git hostap_2_9-1238-gdd2daf0848ed 2020-05-21 08:18:01 +02:00
460-wpa_supplicant-add-new-config-params-to-be-used-with.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
461-driver_nl80211-use-new-parameters-during-ibss-join.patch hostapd: refresh patches 2021-08-28 01:31:15 +02:00
463-add-mcast_rate-to-11s.patch hostapd: refresh patches 2021-08-28 01:31:15 +02:00
464-fix-mesh-obss-check.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
470-survey_data_fallback.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
500-lto-jobserver-support.patch hostapd: update to version 2021-05-21 2021-05-26 11:48:14 +02:00
599-wpa_supplicant-fix-warnings.patch hostapd: declare struct wpa_bss early 2019-09-19 23:43:27 +02:00
600-ubus_support.patch hostapd: fix use after free bugs 2021-11-19 21:58:12 +01:00
610-hostapd_cli_ujail_permission.patch hostapd: allow hostapd under ujail to communicate with hostapd_cli 2021-11-23 18:53:31 +00:00
700-wifi-reload.patch hostapd: refresh patches 2021-08-28 01:31:15 +02:00
710-vlan_no_bridge.patch hostapd: fix bringing up vlan interfaces with the no-bridge option 2021-06-04 20:36:42 +02:00
711-wds_bridge_force.patch hostapd: fix up patches after the last commit 2021-10-21 12:37:23 +02:00
720-ACS-fix-channel-100-frequency.patch hostapd: ACS: fix channel 100 frequency 2021-05-26 23:12:09 +02:00
720-iface_max_num_sta.patch hostapd: fix up patches after the last commit 2021-10-21 12:37:23 +02:00
730-ft_iface.patch hostapd: fix up patches after the last commit 2021-10-21 12:37:23 +02:00
740-snoop_iface.patch hostapd: fix up patches after the last commit 2021-10-21 12:37:23 +02:00
741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch hostapd: fix Proxy-ARP with Hotspot 2.0 disabled 2021-08-28 01:31:15 +02:00
750-qos_map_set_without_interworking.patch hostapd: support qos_map_set without CONFIG_INTERWORKING 2021-11-04 11:50:51 +01:00