From 30d7b962baa3cf741542e02c8fd9311b422df2fb Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 8 Jun 2014 22:53:06 +0200 Subject: [PATCH] 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 --- .../0044-no_user_ns_in_net/ieee802154.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 patches/collateral-evolutions/network/0044-no_user_ns_in_net/ieee802154.patch 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; + } -- 2.30.2