]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mptcp: account memory allocation in mptcp_nl_cmd_add_addr() to user
authorThomas Haller <thaller@redhat.com>
Tue, 6 Sep 2022 20:55:43 +0000 (22:55 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 15 Sep 2022 10:01:02 +0000 (12:01 +0200)
Now that non-root users can configure MPTCP endpoints, account
the memory allocation to the user.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/mptcp/pm_netlink.c

index afc98adf274661bd1bfc9a00ff0251b459325e66..9813ed0fde9bd815b77ca734532c36778d34f4fd 100644 (file)
@@ -1327,7 +1327,7 @@ static int mptcp_nl_cmd_add_addr(struct sk_buff *skb, struct genl_info *info)
                return -EINVAL;
        }
 
-       entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+       entry = kmalloc(sizeof(*entry), GFP_KERNEL_ACCOUNT);
        if (!entry) {
                GENL_SET_ERR_MSG(info, "can't allocate addr");
                return -ENOMEM;