-
Notifications
You must be signed in to change notification settings - Fork 325
Open
Open
Copy link
Labels
0. type: bugThis is a bugThis is a bug
Milestone
Description
There is a dnsmasq instance running on port 54 to handle WAN DNS requests. To correctly route them, the outgoing socket should use setsockopt(SO_MARK) set using the libpacketmark.so preload library. However, setting SO_MARK requires CAP_NET_RAW (or CAP_NET_ADMIN).
dnsmasq does the right thing and drops the capability unless they are needed. As gluon-wan-dnsmasq does not use DHCP, etc. it doesn't actually keep the required capability. As such, the libpacketmark.so setsockopt fails with -EPERM and the wrong routing table may be used (in upstream gluon this will affect IPv6, in the parker fork it also affects IPv4).
Possible solutions:
- Use network namespaces (likely infeasible in the short term)
- Use VRFs instead of packet marking for routing purposes
- Make dnsmasq keep the privileges:
- Simple workaround is to pass a dummy
--enable-ubus=gluon-wan-dnsmasqparameter, as the capabilities are kept then - Patching dnsmasq could be an option
- A hook in libpacketmark.so to set the capabilities seems like it would be very fragile at best
- Simple workaround is to pass a dummy
Metadata
Metadata
Assignees
Labels
0. type: bugThis is a bugThis is a bug