All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	Florian Westphal <fw@strlen.de>
Subject: Re: [PATCH nf-next 1/4] netfilter: nf_tables: allow to dump all registered base hooks
Date: Sun, 23 May 2021 06:49:28 +0800	[thread overview]
Message-ID: <202105230639.XVxbXVNR-lkp@intel.com> (raw)
In-Reply-To: <20210521113922.20798-2-fw@strlen.de>

[-- Attachment #1: Type: text/plain, Size: 3114 bytes --]

Hi Florian,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nf-next/master]

url:    https://github.com/0day-ci/linux/commits/Florian-Westphal/netfilter-add-hook-dump-feature/20210522-225655
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
config: x86_64-randconfig-r026-20210522 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project e84a9b9bb3051c35dea993cdad7b3d2575638f85)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/0d9a4c5b44ef1ad2d9ed5c4c8cea7eae29560706
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Florian-Westphal/netfilter-add-hook-dump-feature/20210522-225655
        git checkout 0d9a4c5b44ef1ad2d9ed5c4c8cea7eae29560706
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/netfilter/nf_tables_api.c:7991:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!nlh)
               ^~~~
   net/netfilter/nf_tables_api.c:8006:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   net/netfilter/nf_tables_api.c:7991:2: note: remove the 'if' if its condition is always false
           if (!nlh)
           ^~~~~~~~~
   net/netfilter/nf_tables_api.c:7987:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.


vim +7991 net/netfilter/nf_tables_api.c

  7979	
  7980	static int nf_tables_dump_one_hook(struct sk_buff *nlskb,
  7981					   const struct nft_dump_hooks_data *ctx,
  7982					   const struct nf_hook_ops *ops)
  7983	{
  7984		unsigned int portid = NETLINK_CB(nlskb).portid;
  7985		struct net *net = sock_net(nlskb->sk);
  7986		struct nlmsghdr *nlh;
  7987		int ret;
  7988	
  7989		nlh = nfnl_msg_put(nlskb, portid, ctx->seq, NFT_MSG_GETNFHOOKS,
  7990				   NLM_F_MULTI, ops->pf, NFNETLINK_V0, nft_base_seq(net));
> 7991		if (!nlh)
  7992			goto nla_put_failure;
  7993	
  7994		ret = nla_put_be32(nlskb, NFTA_HOOK_HOOKNUM, htonl(ops->hooknum));
  7995		if (ret)
  7996			goto nla_put_failure;
  7997	
  7998		ret = nla_put_be32(nlskb, NFTA_HOOK_PRIORITY, htonl(ops->priority));
  7999		if (ret)
  8000			goto nla_put_failure;
  8001	
  8002		nlmsg_end(nlskb, nlh);
  8003		return 0;
  8004	nla_put_failure:
  8005		nlmsg_trim(nlskb, nlh);
  8006		return ret;
  8007	}
  8008	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35091 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH nf-next 1/4] netfilter: nf_tables: allow to dump all registered base hooks
Date: Sun, 23 May 2021 06:49:28 +0800	[thread overview]
Message-ID: <202105230639.XVxbXVNR-lkp@intel.com> (raw)
In-Reply-To: <20210521113922.20798-2-fw@strlen.de>

[-- Attachment #1: Type: text/plain, Size: 3195 bytes --]

Hi Florian,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nf-next/master]

url:    https://github.com/0day-ci/linux/commits/Florian-Westphal/netfilter-add-hook-dump-feature/20210522-225655
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
config: x86_64-randconfig-r026-20210522 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project e84a9b9bb3051c35dea993cdad7b3d2575638f85)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/0d9a4c5b44ef1ad2d9ed5c4c8cea7eae29560706
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Florian-Westphal/netfilter-add-hook-dump-feature/20210522-225655
        git checkout 0d9a4c5b44ef1ad2d9ed5c4c8cea7eae29560706
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/netfilter/nf_tables_api.c:7991:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!nlh)
               ^~~~
   net/netfilter/nf_tables_api.c:8006:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   net/netfilter/nf_tables_api.c:7991:2: note: remove the 'if' if its condition is always false
           if (!nlh)
           ^~~~~~~~~
   net/netfilter/nf_tables_api.c:7987:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.


vim +7991 net/netfilter/nf_tables_api.c

  7979	
  7980	static int nf_tables_dump_one_hook(struct sk_buff *nlskb,
  7981					   const struct nft_dump_hooks_data *ctx,
  7982					   const struct nf_hook_ops *ops)
  7983	{
  7984		unsigned int portid = NETLINK_CB(nlskb).portid;
  7985		struct net *net = sock_net(nlskb->sk);
  7986		struct nlmsghdr *nlh;
  7987		int ret;
  7988	
  7989		nlh = nfnl_msg_put(nlskb, portid, ctx->seq, NFT_MSG_GETNFHOOKS,
  7990				   NLM_F_MULTI, ops->pf, NFNETLINK_V0, nft_base_seq(net));
> 7991		if (!nlh)
  7992			goto nla_put_failure;
  7993	
  7994		ret = nla_put_be32(nlskb, NFTA_HOOK_HOOKNUM, htonl(ops->hooknum));
  7995		if (ret)
  7996			goto nla_put_failure;
  7997	
  7998		ret = nla_put_be32(nlskb, NFTA_HOOK_PRIORITY, htonl(ops->priority));
  7999		if (ret)
  8000			goto nla_put_failure;
  8001	
  8002		nlmsg_end(nlskb, nlh);
  8003		return 0;
  8004	nla_put_failure:
  8005		nlmsg_trim(nlskb, nlh);
  8006		return ret;
  8007	}
  8008	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35091 bytes --]

  reply	other threads:[~2021-05-22 22:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 11:39 [PATCH nf-next 0/4] netfilter: add hook dump feature Florian Westphal
2021-05-21 11:39 ` [PATCH nf-next 1/4] netfilter: nf_tables: allow to dump all registered base hooks Florian Westphal
2021-05-22 22:49   ` kernel test robot [this message]
2021-05-22 22:49     ` kernel test robot
2021-05-21 11:39 ` [PATCH nf-next 2/4] netfilter: nf_tables: include function and module name in hook dumps Florian Westphal
2021-05-21 11:39 ` [PATCH nf-next 3/4] netfilter: annotate nf_tables base hook ops Florian Westphal
2021-05-21 11:39 ` [PATCH nf-next 4/4] netfilter: nf_tables: include table and chain name when dumping hooks Florian Westphal
2021-05-23  8:52   ` Pablo Neira Ayuso
2021-05-23 18:54     ` Florian Westphal
2021-05-23 21:03       ` Pablo Neira Ayuso
2021-05-23 21:26         ` Florian Westphal
2021-05-23 21:36           ` Pablo Neira Ayuso
2021-05-25 20:51 [PATCH nf-next v2 0/4] netfilter: add hook dump feature Florian Westphal
2021-05-25 20:51 ` [PATCH nf-next 1/4] netfilter: nf_tables: allow to dump all registered base hooks Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202105230639.XVxbXVNR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=fw@strlen.de \
    --cc=kbuild-all@lists.01.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.