[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211207005142.1688204-17-eric.dumazet@gmail.com>
Date: Mon, 6 Dec 2021 16:51:41 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: netdev <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: [PATCH net-next 16/17] audit: add netns refcount tracker to struct audit_reply
From: Eric Dumazet <edumazet@...gle.com>
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
kernel/audit.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index 27013414847678af4283484feab2461e3d9c67ed..493365899d205c12338323b5a6ca6a30609a3d6a 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -207,6 +207,7 @@ struct audit_buffer {
struct audit_reply {
__u32 portid;
struct net *net;
+ netns_tracker ns_tracker;
struct sk_buff *skb;
};
@@ -938,7 +939,7 @@ static void audit_free_reply(struct audit_reply *reply)
kfree_skb(reply->skb);
if (reply->net)
- put_net(reply->net);
+ put_net_track(reply->net, &reply->ns_tracker);
kfree(reply);
}
@@ -982,7 +983,8 @@ static void audit_send_reply(struct sk_buff *request_skb, int seq, int type, int
reply->skb = audit_make_reply(seq, type, done, multi, payload, size);
if (!reply->skb)
goto err;
- reply->net = get_net(sock_net(NETLINK_CB(request_skb).sk));
+ reply->net = get_net_track(sock_net(NETLINK_CB(request_skb).sk),
+ &reply->ns_tracker, GFP_KERNEL);
reply->portid = NETLINK_CB(request_skb).portid;
tsk = kthread_run(audit_send_reply_thread, reply, "audit_send_reply");
--
2.34.1.400.ga245620fadb-goog
Powered by blists - more mailing lists