Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp826761qtg; Thu, 6 Apr 2023 02:31:47 -0700 (PDT) X-Google-Smtp-Source: AKy350YtdJqmOG6YsLfaI1ERIZo+uwDicLfVj2+g1e/3R3CXmgUb6Che950i6HSQuTDgiCPa0aU2 X-Received: by 2002:a17:906:6d88:b0:931:9cd2:c214 with SMTP id h8-20020a1709066d8800b009319cd2c214mr5547560ejt.66.1680773507433; Thu, 06 Apr 2023 02:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680773507; cv=none; d=google.com; s=arc-20160816; b=P93M0zzVI0far0gzAdkZGnC4bhBk0LkFHAtBlsnQGl+03FRujJ+qDTFE97/WHMC0O0 sG2iqSz2a3R9G1NTwSLi+o++YUJY+3KuSbA+eMGyOW947JQtdsvq9ywwme6K3CMR/x0y lMZ7/n5ShggJUZq+24drwMRZkdooPYkTqJYpL4daGpdVTTnU1z3lYqpXt6CKD/DqvWTd skSefIPS1jGRlycPUxIIy9oK5b+573uhyP27BwnhIaXC5aBoUCo4OwzGKwxHqqOE+Mjq BoCrPSAW+iMtr+vbpfq89pYnX1XTPFim8EuYd0uQKdn+d2sx09VZ3uoDvo0iC8sPBYWI 3xgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1XwyqfnzJX1uLapuV/9QINP2rtEqF25BMCckbxrhsGM=; b=ps0bHipEO+s4r23zl9Vk83Utrmp+QjadwGlOJ7UYyHfm20P+jurf7bMx6ZxwjkPU1l BdGRUFFhwadLRmHxC7SwSurNKQYbYYRbxejfTBVKX5q0CAMhksdUb+HT4gAKlU2xUkaS dm3Yrrk0sXZNFBpQcm7eopFhKs4rXZz1+rWhacidZ1pf/Oe1k8z71KhPZLPeA9EuITbR tPKNIE3I9gq5h1Wmt4bJplo7/G5exw1+WIsaTuIIFw5D7KJ4WlDUNk0UU56hmH4Mv1M2 yKDIxqF47qisYeYRe2G60RGzgFGCKqTm3U2BdNb0T2WwrIYKVPq9/WabI2uNAHSUJQYb f6Kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf9-20020a1709077f0900b0091fca6007bbsi1195595ejc.488.2023.04.06.02.31.20; Thu, 06 Apr 2023 02:31:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235753AbjDFJV6 (ORCPT + 99 others); Thu, 6 Apr 2023 05:21:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235068AbjDFJV4 (ORCPT ); Thu, 6 Apr 2023 05:21:56 -0400 Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0FBDD83; Thu, 6 Apr 2023 02:21:54 -0700 (PDT) Date: Thu, 6 Apr 2023 11:21:50 +0200 From: Pablo Neira Ayuso To: Chen Aotian Cc: kadlec@netfilter.org, fw@strlen.de, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT Message-ID: References: <20230406040151.1676-1-chenaotian2@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230406040151.1676-1-chenaotian2@163.com> X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 06, 2023 at 12:01:51PM +0800, Chen Aotian wrote: > For memory alloc that store user data from nla[NFTA_OBJ_USERDATA], > use GFP_KERNEL_ACCOUNT is more suitable. > Fixes: 33758c891479 ("memcg: enable accounting for nft objects") > Signed-off-by: Chen Aotian > --- > net/netfilter/nf_tables_api.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c > index 6004d4b24..cd52109e6 100644 > --- a/net/netfilter/nf_tables_api.c > +++ b/net/netfilter/nf_tables_api.c > @@ -7052,7 +7052,7 @@ static int nf_tables_newobj(struct sk_buff *skb, const struct nfnl_info *info, > } > > if (nla[NFTA_OBJ_USERDATA]) { > - obj->udata = nla_memdup(nla[NFTA_OBJ_USERDATA], GFP_KERNEL); > + obj->udata = nla_memdup(nla[NFTA_OBJ_USERDATA], GFP_KERNEL_ACCOUNT); > if (obj->udata == NULL) > goto err_userdata; > > -- > 2.25.1 >