lkml.org 
[lkml]   [2023]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 02/44] maple_tree: Fix potential rcu issue
    Date
    From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>

    Ensure the node isn't dead after reading the node end.

    Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
    ---
    lib/maple_tree.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/lib/maple_tree.c b/lib/maple_tree.c
    index 26e2045d3cda..f3c5ad9ff57f 100644
    --- a/lib/maple_tree.c
    +++ b/lib/maple_tree.c
    @@ -4661,13 +4661,13 @@ static inline void *mas_next_nentry(struct ma_state *mas,
    pivots = ma_pivots(node, type);
    slots = ma_slots(node, type);
    mas->index = mas_safe_min(mas, pivots, mas->offset);
    + count = ma_data_end(node, type, pivots, mas->max);
    if (ma_dead_node(node))
    return NULL;

    if (mas->index > max)
    return NULL;

    - count = ma_data_end(node, type, pivots, mas->max);
    if (mas->offset > count)
    return NULL;

    --
    2.35.1
    \
     
     \ /
      Last update: 2023-03-26 23:29    [W:4.310 / U:0.248 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site