Skip to content

Commit a73455f

Browse files
leperrbgarga
authored andcommitted
net/igmpproxy: Fix buffer overflow and use after free
Taken from upstream pull requests: pali/igmpproxy#98 pali/igmpproxy#99 PR: 291642 MFH: 2025Q4 (cherry picked from commit a0bac3e)
1 parent 3e6eb93 commit a73455f

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

net/igmpproxy/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PORTNAME= igmpproxy
22
DISTVERSION= 0.4
3-
PORTREVISION= 2
3+
PORTREVISION= 3
44
PORTEPOCH= 1
55
CATEGORIES= net
66

@@ -15,7 +15,6 @@ USES= autoreconf
1515
USE_GITHUB= yes
1616
GH_ACCOUNT= pali
1717
GNU_CONFIGURE= yes
18-
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
1918
USE_RC_SUBR= igmpproxy
2019

2120
post-install:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From 2b30c36e6ab5b21defb76ec6458ab7687984484c Mon Sep 17 00:00:00 2001
2+
From: Jan Klemkow <j.klemkow@wemelug.de>
3+
Date: Thu, 17 Apr 2025 19:02:16 +0200
4+
Subject: [PATCH] Fix Buffer Overflow #97
5+
6+
---
7+
src/igmp.c | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/src/igmp.c b/src/igmp.c
11+
index a80c4e5..838694c 100644
12+
--- src/igmp.c
13+
+++ src/igmp.c
14+
@@ -94,7 +94,7 @@ static const char *igmpPacketKind(unsigned int type, unsigned int code) {
15+
case IGMP_V2_LEAVE_GROUP: return "Leave message ";
16+
17+
default:
18+
- sprintf(unknown, "unk: 0x%02x/0x%02x ", type, code);
19+
+ snprintf(unknown, sizeof unknown, "unk: 0x%02x/0x%02x ", type, code);
20+
return unknown;
21+
}
22+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From e49fb373da9044dfb00ffbcd3e1f68ca7107af75 Mon Sep 17 00:00:00 2001
2+
From: Jan Klemkow <j.klemkow@wemelug.de>
3+
Date: Thu, 17 Apr 2025 18:53:18 +0200
4+
Subject: [PATCH] Fix use after free(3) in internAgeRoute().
5+
6+
removeRoute(croute) calls free(croute). Thus, the zeroing of
7+
croute->ageVifBits afterwards is unnecessary, illegal and an
8+
undefined behavior.
9+
---
10+
src/rttable.c | 4 +++-
11+
1 file changed, 3 insertions(+), 1 deletion(-)
12+
13+
diff --git a/src/rttable.c b/src/rttable.c
14+
index bcafa3fe..04e24f3b 100644
15+
--- src/rttable.c
16+
+++ src/rttable.c
17+
@@ -704,13 +704,15 @@ int internAgeRoute(struct RouteTable* croute) {
18+
19+
// No activity was registered within the timelimit, so remove the route.
20+
removeRoute(croute);
21+
+ croute = NULL;
22+
}
23+
// Tell that the route was updated...
24+
result = 1;
25+
}
26+
27+
// The aging vif bits must be reset for each round...
28+
- BIT_ZERO(croute->ageVifBits);
29+
+ if (croute != NULL)
30+
+ BIT_ZERO(croute->ageVifBits);
31+
32+
return result;
33+
}

0 commit comments

Comments
 (0)