Message ID | CA+HokZqeQsYkLeyrwaJK-T8ngXDO207_QuuZX2G8AbWFuvYG-A@mail.gmail.com (mailing list archive) |
---|---|
State | New |
Delegated to: | BPF |
Headers | show |
Series | [BUG] list corruption in __bpf_lru_node_move () 【 bug found and suggestions for fixing it】 | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Guessing tree name failed - patch did not apply |
bpf/vmtest-bpf-PR | fail | merge-conflict |
diff --git a/kernel/bpf/bpf_lru_list.c b/kernel/bpf/bpf_lru_list.c index XXXXXXX..XXXXXXX 100644 --- a/kernel/bpf/bpf_lru_list.c +++ b/kernel/bpf/bpf_lru_list.c @@ -119,8 +119,13 @@ static void __bpf_lru_node_move(struct bpf_lru_list *l, * move the next_inactive_rotation pointer also. */ if (&node->list == l->next_inactive_rotation) - l->next_inactive_rotation = l->next_inactive_rotation->prev; - + { + if (l->next_inactive_rotation->prev == &node->list) { + l->next_inactive_rotation = NULL; + } else { + l->next_inactive_rotation = l->next_inactive_rotation->prev; + } + } list_move(&node->list, &l->lists[tgt_type]); }