lkml.org 
[lkml]   [2019]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 34/34] rcu: Force boolean subscript for expedited stall warnings
    Date
    4.4-stable review patch.  If anyone has any objections, please let me know.

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

    From: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

    commit ec3833ed02ae6ef2a933ece9de7cbab0c64c699e upstream.

    The cpu_online() function can return values other than 0 and 1, which
    can result in subscript overflow when applied to a two-element array.
    This commit allows for this behavior by using "!!" on the return value
    from cpu_online() when used as a subscript.

    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: "Rantala, Tommi" <tommi.t.rantala@nokia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    kernel/rcu/tree.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/kernel/rcu/tree.c
    +++ b/kernel/rcu/tree.c
    @@ -3817,7 +3817,7 @@ static void synchronize_sched_expedited_
    continue;
    rdp = per_cpu_ptr(rsp->rda, cpu);
    pr_cont(" %d-%c%c%c", cpu,
    - "O."[cpu_online(cpu)],
    + "O."[!!cpu_online(cpu)],
    "o."[!!(rdp->grpmask & rnp->expmaskinit)],
    "N."[!!(rdp->grpmask & rnp->expmaskinitnext)]);
    }

    \
     
     \ /
      Last update: 2019-02-07 12:44    [W:2.866 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site