@@ -112,7 +112,7 @@ static int nfnl_acct_new(struct sk_buff *skb, const struct nfnl_info *info,
size += sizeof(u64);
}
- nfacct = kzalloc(sizeof(struct nf_acct) + size, GFP_KERNEL);
+ nfacct = kzalloc(sizeof(struct nf_acct) + size, GFP_KERNEL_ACCOUNT);
if (nfacct == NULL)
return -ENOMEM;
@@ -335,7 +335,8 @@ static int nfnl_cthelper_update_policy_all(struct nlattr *tb[],
struct nf_conntrack_expect_policy *policy;
int i, ret = 0;
- new_policy = kmalloc_objs(*new_policy, helper->expect_class_max + 1);
+ new_policy = kmalloc_objs(*new_policy, helper->expect_class_max + 1,
+ GFP_KERNEL_ACCOUNT);
if (!new_policy)
return -ENOMEM;
@@ -71,7 +71,8 @@ ctnl_timeout_parse_policy(void *timeout,
struct nlattr **tb;
int ret = 0;
- tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1);
+ tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1,
+ GFP_KERNEL_ACCOUNT);
if (!tb)
return -ENOMEM;
@@ -150,14 +151,15 @@ static int cttimeout_new_timeout(struct sk_buff *skb,
goto err_proto_put;
}
- timeout = kzalloc(sizeof(*timeout), GFP_KERNEL);
+ timeout = kzalloc(sizeof(*timeout), GFP_KERNEL_ACCOUNT);
if (timeout == NULL) {
ret = -ENOMEM;
goto err_proto_put;
}
timeout->timeout = kzalloc(sizeof(*timeout->timeout) +
- l4proto->ctnl_timeout.obj_size, GFP_KERNEL);
+ l4proto->ctnl_timeout.obj_size,
+ GFP_KERNEL_ACCOUNT);
if (!timeout->timeout) {
ret = -ENOMEM;
goto err;
@@ -325,7 +325,7 @@ static int nfnl_osf_add_callback(struct sk_buff *skb,
!memchr(f->version, 0, MAXGENRELEN))
return -EINVAL;
- kf = kmalloc_obj(struct nf_osf_finger);
+ kf = kmalloc_obj(struct nf_osf_finger, GFP_KERNEL_ACCOUNT);
if (!kf)
return -ENOMEM;
GFP_KERNEL_ACCOUNT is preferred these days for memcg, replace GFP_KERNEL by GFP_KERNEL_ACCOUNT. Use GFP_KERNEL_ACCOUNT for objects that are created from nfnetlink subsystems. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> --- net/netfilter/nfnetlink_acct.c | 2 +- net/netfilter/nfnetlink_cthelper.c | 3 ++- net/netfilter/nfnetlink_cttimeout.c | 8 +++++--- net/netfilter/nfnetlink_osf.c | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-)