[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] l2tpv3: overwrite s->fd in net_l2tpv3_cleanup
|
From: |
Anastasia Belova |
|
Subject: |
[PATCH] l2tpv3: overwrite s->fd in net_l2tpv3_cleanup |
|
Date: |
Wed, 18 Oct 2023 14:09:17 +0300 |
It's better to overwrite freed pointer s->fd to avoid
accessing an invalid descriptor.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 3fb69aa1d1 ("net: L2TPv3 transport")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
---
net/l2tpv3.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index b5547cb917..713fb8053a 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -501,6 +501,7 @@ static void net_l2tpv3_cleanup(NetClientState *nc)
l2tpv3_write_poll(s, false);
if (s->fd >= 0) {
close(s->fd);
+ s->fd = -1;
}
destroy_vector(s->msgvec, MAX_L2TPV3_MSGCNT, IOVSIZE);
g_free(s->vec);
--
2.30.2
| [Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] l2tpv3: overwrite s->fd in net_l2tpv3_cleanup,
Anastasia Belova <=