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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Apr 2022 11:50:42 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Anna-Maria Behnsen <anna-maria@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, rcu@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Benedikt Spranger <b.spranger@...utronix.de>
Subject: Re: [PATCH] rcu/torture: Change order of warning and trace dump

On Mon, Apr 11, 2022 at 11:09:15AM -0700, Paul E. McKenney wrote:
> On Mon, Apr 11, 2022 at 05:19:03PM +0200, Anna-Maria Behnsen wrote:
> > Dumping a big ftrace buffer could lead to a RCU stall. So there is the
> > ftrace buffer and the stall information which needs to be printed. When
> > there is additionaly a WARN_ON() which describes the reason for the ftrace
> > buffer dump and the WARN_ON() is executed _after_ ftrace buffer dump, the
> > information get lost in the middle of the RCU stall information.
> > 
> > Therefore print WARN_ON() message before dumping the ftrace buffer in
> > rcu_torture_writer().
> > 
> > Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
> > Reviewed-by: Benedikt Spranger <b.spranger@...utronix.de>
> 
> Hello, Anna-Maria!
> 
> Good point, but we get caught out either way.  Either we take the chance
> of losing the WARN() message as you say, or we take the chance of the
> activity in the WARN() message overwriting needed information in the
> trace buffer.
> 
> Would it work to shut off tracing, do the WARN(), and only then do the
> rcu_ftrace_dump()?

For example, as shown the the updated patch below currently queued on -rcu
for further review and testing?

If this is problematic, please let me know!

							Thanx, Paul

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

commit cdbc93534da1bba3f498783473361b2f26dc65d6
Author: Anna-Maria Behnsen <anna-maria@...utronix.de>
Date:   Mon Apr 11 17:19:03 2022 +0200

    rcu/torture: Change order of warning and trace dump
    
    Dumping a big ftrace buffer could lead to a RCU stall. So there is the
    ftrace buffer and the stall information which needs to be printed. When
    there is additionaly a WARN_ON() which describes the reason for the ftrace
    buffer dump and the WARN_ON() is executed _after_ ftrace buffer dump, the
    information get lost in the middle of the RCU stall information.
    
    Therefore print WARN_ON() message before dumping the ftrace buffer in
    rcu_torture_writer().
    
    [ paulmck: Add tracing_off() to avoid cruft from WARN(). ]
    
    Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
    Reviewed-by: Benedikt Spranger <b.spranger@...utronix.de>
    Signed-off-by: Paul E. McKenney <paulmck@...nel.org>

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 2b40a8f6d2a0..0885a66f9d76 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1369,8 +1369,9 @@ rcu_torture_writer(void *arg)
 				if (list_empty(&rcu_tortures[i].rtort_free) &&
 				    rcu_access_pointer(rcu_torture_current) !=
 				    &rcu_tortures[i]) {
-					rcu_ftrace_dump(DUMP_ALL);
+					tracing_off();
 					WARN(1, "%s: rtort_pipe_count: %d\n", __func__, rcu_tortures[i].rtort_pipe_count);
+					rcu_ftrace_dump(DUMP_ALL);
 				}
 		if (stutter_waited)
 			sched_set_normal(current, oldnice);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ