Skip to content
Commit cdc6a395 authored by Li Zefan's avatar Li Zefan Committed by David Sterba
Browse files

Btrfs: avoid possible use-after-free in clear_extent_bit()



clear_extent_bit()
{
    next_node = rb_next(&state->rb_node);
    ...
    clear_state_bit(state);  <-- this may free next_node
    if (next_node) {
        state = rb_entry(next_node);
        ...
    }
}

clear_state_bit() calls merge_state() which may free the next node
of the passing extent_state, so clear_extent_bit() may end up
referencing freed memory.

Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
parent 8e52acf7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment