The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dong Chenchen <dongchenchen2@huawei.com>,
	hawk@kernel.org, ilias.apalodimas@linaro.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, almasrymina@google.com
Cc: oe-kbuild-all@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, zhangchangzhong@huawei.com,
	Dong Chenchen <dongchenchen2@huawei.com>,
	syzbot+204a4382fcb3311f3858@syzkaller.appspotmail.com
Subject: Re: [PATCH net] page_pool: Fix use-after-free in page_pool_recycle_in_ring
Date: Sat, 24 May 2025 05:23:15 +0800	[thread overview]
Message-ID: <202505240558.ANlvx42u-lkp@intel.com> (raw)
In-Reply-To: <20250523064524.3035067-1-dongchenchen2@huawei.com>

Hi Dong,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Dong-Chenchen/page_pool-Fix-use-after-free-in-page_pool_recycle_in_ring/20250523-144323
base:   net/main
patch link:    https://lore.kernel.org/r/20250523064524.3035067-1-dongchenchen2%40huawei.com
patch subject: [PATCH net] page_pool: Fix use-after-free in page_pool_recycle_in_ring
config: x86_64-buildonly-randconfig-004-20250524 (https://download.01.org/0day-ci/archive/20250524/202505240558.ANlvx42u-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250524/202505240558.ANlvx42u-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505240558.ANlvx42u-lkp@intel.com/

All warnings (new ones prefixed by >>):

   net/core/page_pool.c: In function 'page_pool_recycle_in_ring':
>> net/core/page_pool.c:716:45: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     716 |                 recycle_stat_inc(pool, ring);
         |                                             ^


vim +/if +716 net/core/page_pool.c

ff7d6b27f894f1 Jesper Dangaard Brouer 2018-04-17  707  
4dec64c52e24c2 Mina Almasry           2024-06-28  708  static bool page_pool_recycle_in_ring(struct page_pool *pool, netmem_ref netmem)
ff7d6b27f894f1 Jesper Dangaard Brouer 2018-04-17  709  {
8801e4b0622139 Dong Chenchen          2025-05-23  710  	bool in_softirq;
ff7d6b27f894f1 Jesper Dangaard Brouer 2018-04-17  711  	int ret;
542bcea4be866b Qingfang DENG          2023-02-03  712  	/* BH protection not needed if current is softirq */
8801e4b0622139 Dong Chenchen          2025-05-23  713  	in_softirq = page_pool_producer_lock(pool);
8801e4b0622139 Dong Chenchen          2025-05-23  714  	ret = !__ptr_ring_produce(&pool->ring, (__force void *)netmem);
8801e4b0622139 Dong Chenchen          2025-05-23  715  	if (ret)
ad6fa1e1ab1b81 Joe Damato             2022-03-01 @716  		recycle_stat_inc(pool, ring);
8801e4b0622139 Dong Chenchen          2025-05-23  717  	page_pool_producer_unlock(pool, in_softirq);
ad6fa1e1ab1b81 Joe Damato             2022-03-01  718  
8801e4b0622139 Dong Chenchen          2025-05-23  719  	return ret;
ff7d6b27f894f1 Jesper Dangaard Brouer 2018-04-17  720  }
ff7d6b27f894f1 Jesper Dangaard Brouer 2018-04-17  721  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      parent reply	other threads:[~2025-05-23 21:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23  6:45 [PATCH net] page_pool: Fix use-after-free in page_pool_recycle_in_ring Dong Chenchen
2025-05-23  8:30 ` Yunsheng Lin
2025-05-23 16:45   ` Mina Almasry
2025-05-26 14:47     ` dongchenchen (A)
2025-05-26 17:51       ` Mina Almasry
2025-05-27  1:52         ` dongchenchen (A)
2025-05-27  2:13           ` Mina Almasry
2025-05-26 14:27   ` dongchenchen (A)
2025-05-23  9:16 ` Toke Høiland-Jørgensen
2025-05-23 13:31 ` Paolo Abeni
2025-05-26 15:02   ` dongchenchen (A)
2025-05-23 21:23 ` kernel test robot [this message]

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=202505240558.ANlvx42u-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=almasrymina@google.com \
    --cc=davem@davemloft.net \
    --cc=dongchenchen2@huawei.com \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=syzbot+204a4382fcb3311f3858@syzkaller.appspotmail.com \
    --cc=zhangchangzhong@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox