gazelle/0054-ltran-fix-use-after-free-issue.patch
jiangheng14 46ab1e1590 backport upstream patches:
update README
    fix some bugs
    refactor pkt read send to improve performance
    refactor kernle event toimproveperformance

(cherry picked from commit a8c66704608ca83c799adab88be6214bccdcfa44)
2022-07-07 22:46:16 +08:00

29 lines
1.0 KiB
Diff

From 0f37499d7922d59fa46b7961bde36ab0b20eac62 Mon Sep 17 00:00:00 2001
From: Honggang LI <honggangli@163.com>
Date: Thu, 23 Jun 2022 13:56:31 +0800
Subject: [PATCH 5/6] ltran: fix use-after-free issue
Signed-off-by: Honggang LI <honggangli@163.com>
---
src/ltran/ltran_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ltran/ltran_timer.c b/src/ltran/ltran_timer.c
index 29b307c..1327203 100644
--- a/src/ltran/ltran_timer.c
+++ b/src/ltran/ltran_timer.c
@@ -63,9 +63,9 @@ void gazelle_detect_sock_logout(struct gazelle_tcp_sock_htable *tcp_sock_htable)
hlist_del_init(&tcp_sock->tcp_sock_node);
tcp_sock_htable->cur_tcp_sock_num--;
tcp_sock_htable->array[i].chain_size--;
- free(tcp_sock);
LTRAN_DEBUG("delete the tcp sock htable: tid %u ip %u port %u\n",
tcp_sock->tid, tcp_sock->ip, (uint32_t)ntohs(tcp_sock->port));
+ free(tcp_sock);
}
}
}
--
2.23.0