lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 21 Mar 2022 23:05:23 +0800
From:   kernel test robot <lkp@...el.com>
To:     Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Miguel Ojeda <ojeda@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Memory Management List <linux-mm@...ck.org>
Subject: mm/damon/core.c:469 __damon_stop() warn: if();

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f443e374ae131c168a065ea1748feac6b2e76613
commit: e1edc277e6f6dfb372216522dfc57f9381c39e35 linux/container_of.h: switch to static_assert
date:   4 months ago
config: nds32-randconfig-m031-20220320 (https://download.01.org/0day-ci/archive/20220321/202203212359.HWkV7SP9-lkp@intel.com/config)
compiler: nds32le-linux-gcc (GCC) 11.2.0

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

smatch warnings:
mm/damon/core.c:469 __damon_stop() warn: if();

vim +469 mm/damon/core.c

2224d8485492e49 SeongJae Park 2021-09-07  456  
2224d8485492e49 SeongJae Park 2021-09-07  457  /*
2224d8485492e49 SeongJae Park 2021-09-07  458   * __damon_stop() - Stops monitoring of given context.
2224d8485492e49 SeongJae Park 2021-09-07  459   * @ctx:	monitoring context
2224d8485492e49 SeongJae Park 2021-09-07  460   *
2224d8485492e49 SeongJae Park 2021-09-07  461   * Return: 0 on success, negative error code otherwise.
2224d8485492e49 SeongJae Park 2021-09-07  462   */
2224d8485492e49 SeongJae Park 2021-09-07  463  static int __damon_stop(struct damon_ctx *ctx)
2224d8485492e49 SeongJae Park 2021-09-07  464  {
0f91d13366a4024 Changbin Du   2021-11-05  465  	struct task_struct *tsk;
0f91d13366a4024 Changbin Du   2021-11-05  466  
2224d8485492e49 SeongJae Park 2021-09-07  467  	mutex_lock(&ctx->kdamond_lock);
0f91d13366a4024 Changbin Du   2021-11-05  468  	tsk = ctx->kdamond;
0f91d13366a4024 Changbin Du   2021-11-05 @469  	if (tsk) {
0f91d13366a4024 Changbin Du   2021-11-05  470  		get_task_struct(tsk);
2224d8485492e49 SeongJae Park 2021-09-07  471  		mutex_unlock(&ctx->kdamond_lock);
0f91d13366a4024 Changbin Du   2021-11-05  472  		kthread_stop(tsk);
0f91d13366a4024 Changbin Du   2021-11-05  473  		put_task_struct(tsk);
2224d8485492e49 SeongJae Park 2021-09-07  474  		return 0;
2224d8485492e49 SeongJae Park 2021-09-07  475  	}
2224d8485492e49 SeongJae Park 2021-09-07  476  	mutex_unlock(&ctx->kdamond_lock);
2224d8485492e49 SeongJae Park 2021-09-07  477  
2224d8485492e49 SeongJae Park 2021-09-07  478  	return -EPERM;
2224d8485492e49 SeongJae Park 2021-09-07  479  }
2224d8485492e49 SeongJae Park 2021-09-07  480  

:::::: The code at line 469 was first introduced by commit
:::::: 0f91d13366a402420bf98eaaf393db03946c13e0 mm/damon: simplify stop mechanism

:::::: TO: Changbin Du <changbin.du@...il.com>
:::::: CC: Linus Torvalds <torvalds@...ux-foundation.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ