Revert "mptcp: pm: Fix uaf in __timer_delete_sync"
This reverts commit a40e9b4e79
.
This commit is contained in:
parent
efd33de913
commit
024ae02cc1
1 changed files with 4 additions and 9 deletions
|
@ -253,21 +253,15 @@ mptcp_pm_del_add_timer(struct mptcp_sock *msk,
|
|||
{
|
||||
struct mptcp_pm_add_entry *entry;
|
||||
struct sock *sk = (struct sock *)msk;
|
||||
struct timer_list *add_timer = NULL;
|
||||
|
||||
spin_lock_bh(&msk->pm.lock);
|
||||
entry = mptcp_lookup_anno_list_by_saddr(msk, addr);
|
||||
if (entry && (!check_id || entry->addr.id == addr->id)) {
|
||||
if (entry && (!check_id || entry->addr.id == addr->id))
|
||||
entry->retrans_times = ADD_ADDR_RETRANS_MAX;
|
||||
add_timer = &entry->add_timer;
|
||||
}
|
||||
if (!check_id && entry)
|
||||
list_del(&entry->list);
|
||||
spin_unlock_bh(&msk->pm.lock);
|
||||
|
||||
/* no lock, because sk_stop_timer_sync() is calling del_timer_sync() */
|
||||
if (add_timer)
|
||||
sk_stop_timer_sync(sk, add_timer);
|
||||
if (entry && (!check_id || entry->addr.id == addr->id))
|
||||
sk_stop_timer_sync(sk, &entry->add_timer);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
@ -772,6 +766,7 @@ static bool remove_anno_list_by_saddr(struct mptcp_sock *msk,
|
|||
|
||||
entry = mptcp_pm_del_add_timer(msk, addr, false);
|
||||
if (entry) {
|
||||
list_del(&entry->list);
|
||||
kfree(entry);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue