Skip to contentSkip to conversation

backports: genetlink: add define for GENL_UNS_ADMIN_PERM

PATCH Superseded Arend van Spriel 3 participants 3 messages May 15, 2016 – May 17, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backports: genetlink: add define for GENL_UNS_ADMIN_PERM

Since commit 5ed071ec9992 ("nl80211: Allow privileged operations from user namespaces") the definition GENL_UNS_ADMIN_PERM is used by nl80211.c. Add definition if not defined by target kernel.

---
Tried to add uapi/linux/genetlink.h, but ended up in inclusion issues that I did not look into further so instead added the definition in already existing net/genetlink.h in backport. Feel free to fix otherwise if that is preferred.

Regards,
Arend

---
 backport/backport-include/net/genetlink.h | 4 ++++
 1 file changed, 4 insertions(+)
backport/backport-include/net/genetlink.h +4 -0
index 2e0bb3e..49661bb 100644
@@ -154,4 +154,8 @@ backport_genlmsg_multicast_allns(struct genl_family *family,
 #endif /* < 4.4 */
 #endif /* < 3.13 */
 
+#ifndef GENL_UNS_ADMIN_PERM
+#define GENL_UNS_ADMIN_PERM	0x10
+#endif
+
 #endif /* __BACKPORT_NET_GENETLINK_H */
Signature · 4 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#1 lore raw
Quoted 3 lines · Arend van Spriel

Since commit 5ed071ec9992 ("nl80211: Allow privileged operations from user namespaces") the definition GENL_UNS_ADMIN_PERM is used by nl80211.c. Add definition if not defined by target kernel.

NACK, this patch is really bad and breaks all security properties since older kernels will not know anything about the flag 0x10, they will assume that no permission checks are required.

The only sane thing to do is to
#define GENL_UNS_ADMIN_PERM GENL_ADMIN_PERM

and not get the user-namespace-awareness on kernels that didn't know about the flag already.

johannes

--
To unsubscribe from this list: send the line "unsubscribe backports" in

#2 lore raw
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Arend van Spriel

Since commit 5ed071ec9992 ("nl80211: Allow privileged operations from user namespaces") the definition GENL_UNS_ADMIN_PERM is used by nl80211.c. Add definition if not defined by target kernel.

NACK, this patch is really bad and breaks all security properties since older kernels will not know anything about the flag 0x10, they will assume that no permission checks are required.

Obviously been cutting to many corners here.

Quoted 5 lines

The only sane thing to do is to
#define GENL_UNS_ADMIN_PERM GENL_ADMIN_PERM

and not get the user-namespace-awareness on kernels that didn't know about the flag already.

Will send a v2 using your suggestion.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in