Loading net/netfilter/nf_tables_api.c +16 −16 Original line number Diff line number Diff line Loading @@ -7681,7 +7681,7 @@ static void audit_log_obj_reset(const struct nft_table *table, kfree(buf); } struct nft_obj_filter { struct nft_obj_dump_ctx { char *table; u32 type; }; Loading @@ -7691,7 +7691,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh); const struct nft_table *table; unsigned int idx = 0, s_idx = cb->args[0]; struct nft_obj_filter *filter = cb->data; struct nft_obj_dump_ctx *ctx = cb->data; struct net *net = sock_net(skb->sk); int family = nfmsg->nfgen_family; struct nftables_pernet *nft_net; Loading @@ -7717,10 +7717,10 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) goto cont; if (idx < s_idx) goto cont; if (filter->table && strcmp(filter->table, table->name)) if (ctx->table && strcmp(ctx->table, table->name)) goto cont; if (filter->type != NFT_OBJECT_UNSPEC && obj->ops->type->type != filter->type) if (ctx->type != NFT_OBJECT_UNSPEC && obj->ops->type->type != ctx->type) goto cont; rc = nf_tables_fill_obj_info(skb, net, Loading Loading @@ -7752,33 +7752,33 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) static int nf_tables_dump_obj_start(struct netlink_callback *cb) { const struct nlattr * const *nla = cb->data; struct nft_obj_filter *filter = NULL; struct nft_obj_dump_ctx *ctx = NULL; filter = kzalloc(sizeof(*filter), GFP_ATOMIC); if (!filter) ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC); if (!ctx) return -ENOMEM; if (nla[NFTA_OBJ_TABLE]) { filter->table = nla_strdup(nla[NFTA_OBJ_TABLE], GFP_ATOMIC); if (!filter->table) { kfree(filter); ctx->table = nla_strdup(nla[NFTA_OBJ_TABLE], GFP_ATOMIC); if (!ctx->table) { kfree(ctx); return -ENOMEM; } } if (nla[NFTA_OBJ_TYPE]) filter->type = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE])); ctx->type = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE])); cb->data = filter; cb->data = ctx; return 0; } static int nf_tables_dump_obj_done(struct netlink_callback *cb) { struct nft_obj_filter *filter = cb->data; struct nft_obj_dump_ctx *ctx = cb->data; kfree(filter->table); kfree(filter); kfree(ctx->table); kfree(ctx); return 0; } Loading Loading
net/netfilter/nf_tables_api.c +16 −16 Original line number Diff line number Diff line Loading @@ -7681,7 +7681,7 @@ static void audit_log_obj_reset(const struct nft_table *table, kfree(buf); } struct nft_obj_filter { struct nft_obj_dump_ctx { char *table; u32 type; }; Loading @@ -7691,7 +7691,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh); const struct nft_table *table; unsigned int idx = 0, s_idx = cb->args[0]; struct nft_obj_filter *filter = cb->data; struct nft_obj_dump_ctx *ctx = cb->data; struct net *net = sock_net(skb->sk); int family = nfmsg->nfgen_family; struct nftables_pernet *nft_net; Loading @@ -7717,10 +7717,10 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) goto cont; if (idx < s_idx) goto cont; if (filter->table && strcmp(filter->table, table->name)) if (ctx->table && strcmp(ctx->table, table->name)) goto cont; if (filter->type != NFT_OBJECT_UNSPEC && obj->ops->type->type != filter->type) if (ctx->type != NFT_OBJECT_UNSPEC && obj->ops->type->type != ctx->type) goto cont; rc = nf_tables_fill_obj_info(skb, net, Loading Loading @@ -7752,33 +7752,33 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) static int nf_tables_dump_obj_start(struct netlink_callback *cb) { const struct nlattr * const *nla = cb->data; struct nft_obj_filter *filter = NULL; struct nft_obj_dump_ctx *ctx = NULL; filter = kzalloc(sizeof(*filter), GFP_ATOMIC); if (!filter) ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC); if (!ctx) return -ENOMEM; if (nla[NFTA_OBJ_TABLE]) { filter->table = nla_strdup(nla[NFTA_OBJ_TABLE], GFP_ATOMIC); if (!filter->table) { kfree(filter); ctx->table = nla_strdup(nla[NFTA_OBJ_TABLE], GFP_ATOMIC); if (!ctx->table) { kfree(ctx); return -ENOMEM; } } if (nla[NFTA_OBJ_TYPE]) filter->type = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE])); ctx->type = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE])); cb->data = filter; cb->data = ctx; return 0; } static int nf_tables_dump_obj_done(struct netlink_callback *cb) { struct nft_obj_filter *filter = cb->data; struct nft_obj_dump_ctx *ctx = cb->data; kfree(filter->table); kfree(filter); kfree(ctx->table); kfree(ctx); return 0; } Loading