--- x/include/net/net_namespace.h +++ y/include/net/net_namespace.h @@ -339,6 +339,7 @@ static inline void __netns_tracker_alloc bool refcounted, gfp_t gfp) { + get_net(net); #ifdef CONFIG_NET_NS_REFCNT_TRACKER ref_tracker_alloc(refcounted ? &net->refcnt_tracker : &net->notrefcnt_tracker, @@ -360,6 +361,7 @@ static inline void __netns_tracker_free( ref_tracker_free(refcounted ? &net->refcnt_tracker : &net->notrefcnt_tracker, tracker); #endif + put_net(net); } static inline struct net *get_net_track(struct net *net,