All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: mm/kfence/kfence_test.c:397 test_use_after_free_read_nofault() warn: passing freed memory 'addr' (line 395)
Date: Sat, 13 Sep 2025 17:06:35 +0800	[thread overview]
Message-ID: <202509131634.QXd7BtIK-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Nirjhar Roy <nirjhar@linux.ibm.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
CC: Marco Elver <elver@google.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   22f20375f5b71f30c0d6896583b93b6e4bba7279
commit: 811808d365398680b628d2b88aafeba77c88691a mm/kfence: add a new kunit test test_use_after_free_read_nofault()
date:   10 months ago
:::::: branch date: 15 hours ago
:::::: commit date: 10 months ago
config: arm64-randconfig-r071-20250913 (https://download.01.org/0day-ci/archive/20250913/202509131634.QXd7BtIK-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 21857ae337e0892a5522b6e7337899caa61de2a6)

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202509131634.QXd7BtIK-lkp@intel.com/

smatch warnings:
mm/kfence/kfence_test.c:397 test_use_after_free_read_nofault() warn: passing freed memory 'addr' (line 395)

vim +/addr +397 mm/kfence/kfence_test.c

bc8fbc5f305aec Marco Elver 2021-02-25  385  
811808d3653986 Nirjhar Roy 2024-10-18  386  static void test_use_after_free_read_nofault(struct kunit *test)
811808d3653986 Nirjhar Roy 2024-10-18  387  {
811808d3653986 Nirjhar Roy 2024-10-18  388  	const size_t size = 32;
811808d3653986 Nirjhar Roy 2024-10-18  389  	char *addr;
811808d3653986 Nirjhar Roy 2024-10-18  390  	char dst;
811808d3653986 Nirjhar Roy 2024-10-18  391  	int ret;
811808d3653986 Nirjhar Roy 2024-10-18  392  
811808d3653986 Nirjhar Roy 2024-10-18  393  	setup_test_cache(test, size, 0, NULL);
811808d3653986 Nirjhar Roy 2024-10-18  394  	addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
811808d3653986 Nirjhar Roy 2024-10-18 @395  	test_free(addr);
811808d3653986 Nirjhar Roy 2024-10-18  396  	/* Use after free with *_nofault() */
811808d3653986 Nirjhar Roy 2024-10-18 @397  	ret = copy_from_kernel_nofault(&dst, addr, 1);
811808d3653986 Nirjhar Roy 2024-10-18  398  	KUNIT_EXPECT_EQ(test, ret, -EFAULT);
811808d3653986 Nirjhar Roy 2024-10-18  399  	KUNIT_EXPECT_FALSE(test, report_available());
811808d3653986 Nirjhar Roy 2024-10-18  400  }
811808d3653986 Nirjhar Roy 2024-10-18  401  

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

             reply	other threads:[~2025-09-13  9:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-13  9:06 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-30 10:13 mm/kfence/kfence_test.c:397 test_use_after_free_read_nofault() warn: passing freed memory 'addr' (line 395) kernel test robot
2024-12-12 14:17 kernel test robot

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=202509131634.QXd7BtIK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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.