From: Hauke Mehrtens Date: Sun, 8 Jun 2014 20:53:06 +0000 (+0200) Subject: backports: do not access user_ns on struct net X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=30d7b962baa3cf741542e02c8fd9311b422df2fb;p=openwrt%2Fstaging%2Fblogic.git backports: do not access user_ns on struct net The ieee802154 subsystem wants to access user_ns on struct net, but this member was added in kernel 3.8, check the general capabilities instead. Signed-off-by: Hauke Mehrtens --- diff --git a/patches/collateral-evolutions/network/0044-no_user_ns_in_net/ieee802154.patch b/patches/collateral-evolutions/network/0044-no_user_ns_in_net/ieee802154.patch new file mode 100644 index 000000000000..d5f951b98ff0 --- /dev/null +++ b/patches/collateral-evolutions/network/0044-no_user_ns_in_net/ieee802154.patch @@ -0,0 +1,30 @@ +--- a/net/ieee802154/dgram.c ++++ b/net/ieee802154/dgram.c +@@ -483,8 +483,13 @@ static int dgram_setsockopt(struct sock + ro->want_ack = !!val; + break; + case WPAN_SECURITY: ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + if (!ns_capable(net->user_ns, CAP_NET_ADMIN) && + !ns_capable(net->user_ns, CAP_NET_RAW)) { ++#else ++ if (!capable(CAP_NET_ADMIN) && ++ !capable(CAP_NET_RAW)) { ++#endif + err = -EPERM; + break; + } +@@ -507,8 +512,13 @@ static int dgram_setsockopt(struct sock + } + break; + case WPAN_SECURITY_LEVEL: ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + if (!ns_capable(net->user_ns, CAP_NET_ADMIN) && + !ns_capable(net->user_ns, CAP_NET_RAW)) { ++#else ++ if (!capable(CAP_NET_ADMIN) && ++ !capable(CAP_NET_RAW)) { ++#endif + err = -EPERM; + break; + }