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]
Message-ID: <202111230549.U0WrDxKK-lkp@intel.com>
Date:   Tue, 23 Nov 2021 11:44:32 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Andy Lutomirski <luto@...nel.org>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [luto:sched/lazymm 13/16] kernel/sched/core.c:4982
 __change_current_mm() error: uninitialized symbol 'old_active_mm'.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git sched/lazymm
head:   c0d03d4f2778fd0a7c16e69cdfb3f111296129b5
commit: 4863118ffa6fe6af7cfb18c4d4ee6434537b0c8b [13/16] sched, exec: Factor current mm changes out from exec
config: x86_64-randconfig-m001-20211118 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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

smatch warnings:
kernel/sched/core.c:4982 __change_current_mm() error: uninitialized symbol 'old_active_mm'.

vim +/old_active_mm +4982 kernel/sched/core.c

4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4938  void __change_current_mm(struct mm_struct *mm, bool mm_is_brand_new)
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4939  {
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4940  	struct task_struct *tsk = current;
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4941  	struct mm_struct *old_active_mm, *mm_to_drop = NULL;
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4942  
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4943  	BUG_ON(!mm);	/* likely to cause corruption if we continue */
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4944  
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4945  	/*
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4946  	 * We do not want to schedule, nor should procfs peek at current->mm
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4947  	 * while we're modifying it.  task_lock() disables preemption and
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4948  	 * locks against procfs.
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4949  	 */
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4950  	task_lock(tsk);
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4951  	/*
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4952  	 * membarrier() requires a full barrier before switching mm.
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4953  	 */
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4954  	smp_mb__after_spinlock();
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4955  
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4956  	local_irq_disable();
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4957  
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4958  	if (tsk->mm) {
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4959  		/* We're detaching from an old mm.  Sync stats. */
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4960  		sync_mm_rss(tsk->mm);
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4961  	} else {
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4962  		/*
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4963  		 * Switching from kernel mm to user.  Drop the old lazy
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4964  		 * mm reference.
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4965  		 */
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4966  		mm_to_drop = tsk->active_mm;
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4967  	}
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4968  
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4969  	tsk->active_mm = mm;
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4970  	WRITE_ONCE(tsk->mm, mm);  /* membarrier reads this without locks */
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4971  	membarrier_update_current_mm(mm);
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4972  
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4973  	if (mm_is_brand_new) {
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4974  		/*
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4975  		 * For historical reasons, some architectures want IRQs on
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4976  		 * when activate_mm() is called.  If we're going to call
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4977  		 * activate_mm(), turn on IRQs but leave preemption
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4978  		 * disabled.
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4979  		 */
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4980  		if (!IS_ENABLED(CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM))
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4981  			local_irq_enable();
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03 @4982  		activate_mm(old_active_mm, mm);

"old_active_mm" is never initialized.

4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4983  		if (IS_ENABLED(CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM))
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4984  			local_irq_enable();
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4985  	} else {
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4986  		switch_mm_irqs_off(old_active_mm, mm, tsk);
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4987  		local_irq_enable();
4863118ffa6fe6 kernel/sched/core.c Andy Lutomirski  2021-09-03  4988  	}
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ