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>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190321164340.GV4102@linux.ibm.com>
Date:   Thu, 21 Mar 2019 09:43:40 -0700
From:   "Paul E. McKenney" <paulmck@...ux.ibm.com>
To:     kernel test robot <rong.a.chen@...el.com>
Cc:     Barret Rhoden <brho@...gle.com>, Tejun Heo <tj@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>, lkp@...org
Subject: Re: [LKP] [rcu] f836ea2ec9: BUG:unable_to_handle_kernel

On Thu, Mar 21, 2019 at 04:49:37PM +0800, kernel test robot wrote:
> FYI, we noticed the following commit (built with gcc-7):
> 
> commit: f836ea2ec954a20af25861e68075ad743be046f4 ("rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules")
> https://git.kernel.org/cgit/linux/kernel/git/paulmck/linux-rcu.git dev.2019.03.18a

This commit has been replaced by eb89abcb3073 ("rcu: Forbid
DEFINE{,_STATIC}_SRCU() from modules"), but this did locate an otherwise
mostly latent bug, the fix for which is shown below.

So thank you again.  ;-)

							Thanx, Paul

------------------------------------------------------------------------

commit 6534d5b0f24accd71620873980ba5a14aa85e898
Author: Paul E. McKenney <paulmck@...ux.ibm.com>
Date:   Thu Mar 21 09:27:28 2019 -0700

    rcutorture: Fix cleanup path for invalid torture_type strings
    
    If the specified rcutorture.torture_type is not in the rcu_torture_init()
    function's torture_ops[] array, rcutorture prints some console messages
    and then invokes rcu_torture_cleanup() to set state so that a future
    torture test can run.  However, rcu_torture_cleanup() also attempts to
    end the test that didn't actually start, and in doing so relies on the
    value of cur_ops, a value that is not particularly relevant in this case.
    This can result in confusing output or even follow-on failures due to
    attempts to use facilities that have not been properly initialized.
    
    This commit therefore sets the value of cur_ops to NULL in this case
    and inserts a check near the beginning of rcu_torture_cleanup(),
    thus avoiding relying on an irrelevant cur_ops value.
    
    Reported-by: kernel test robot <rong.a.chen@...el.com>
    Signed-off-by: Paul E. McKenney <paulmck@...ux.ibm.com>

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 7086caa743c7..af31ddee7b36 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -2101,6 +2101,10 @@ rcu_torture_cleanup(void)
 			cur_ops->cb_barrier();
 		return;
 	}
+	if (!cur_ops) {
+		torture_cleanup_end();
+		return;
+	}
 
 	rcu_torture_barrier_cleanup();
 	torture_stop_kthread(rcu_torture_fwd_prog, fwd_prog_task);
@@ -2281,6 +2285,7 @@ rcu_torture_init(void)
 		pr_cont("\n");
 		WARN_ON(!IS_MODULE(CONFIG_RCU_TORTURE_TEST));
 		firsterr = -EINVAL;
+		cur_ops = NULL;
 		goto unwind;
 	}
 	if (cur_ops->fqs == NULL && fqs_duration != 0) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ