summaryrefslogtreecommitdiffstats
path: root/net/mpls/internal.h
diff options
context:
space:
mode:
authorRobert Shearman <rshearma@brocade.com>2015-06-05 18:54:45 +0100
committerDavid S. Miller <davem@davemloft.net>2015-06-07 19:37:27 -0700
commit25cc8f0763c972911b1a65099cd10d9f8a45a7b0 (patch)
treee50c9fa03a8a7cebad169217faafae8f7996a090 /net/mpls/internal.h
parente51000db4c880165eab06ec0990605f24e75203f (diff)
downloadlinux-25cc8f0763c972911b1a65099cd10d9f8a45a7b0.tar.gz
linux-25cc8f0763c972911b1a65099cd10d9f8a45a7b0.tar.bz2
linux-25cc8f0763c972911b1a65099cd10d9f8a45a7b0.zip
mpls: fix possible use after free of device
The mpls device is used in an RCU read context without a lock being held. As the memory is freed without waiting for the RCU grace period to elapse, the freed memory could still be in use. Address this by using kfree_rcu to free the memory for the mpls device after the RCU grace period has elapsed. Fixes: 03c57747a702 ("mpls: Per-device MPLS state") Signed-off-by: Robert Shearman <rshearma@brocade.com> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mpls/internal.h')
-rw-r--r--net/mpls/internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mpls/internal.h b/net/mpls/internal.h
index b064c345042c..8cabeb5a1cb9 100644
--- a/net/mpls/internal.h
+++ b/net/mpls/internal.h
@@ -16,6 +16,7 @@ struct mpls_dev {
int input_enabled;
struct ctl_table_header *sysctl;
+ struct rcu_head rcu;
};
struct sk_buff;