Skip to content

dlt_jnpr_ether_cleanup: check config before cleanup#851

Merged
fklassen merged 1 commit intoappneta:4.5.0from
Marsman1996:master
Jun 3, 2024
Merged

dlt_jnpr_ether_cleanup: check config before cleanup#851
fklassen merged 1 commit intoappneta:4.5.0from
Marsman1996:master

Conversation

@Marsman1996
Copy link
Copy Markdown
Contributor

Fix #812
The ctx->encoder->config is somehow already cleaned up in dlt_en10mb_cleanup() and set as NULL, so I add a check in dlt_jnpr_ether_cleanup().

(gdb) p & ctx->encoder->config
$1 = (void **) 0x55555559f140
(gdb) watch *0x55555559f140
Hardware watchpoint 2: *0x55555559f140
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/ubuntu178/afgen/tcpreplay/4.4.4/bin_normal/bin/tcprewrite -o /dev/null --dlt=enet --enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66 --enet-smac=00:12:13:14:15:16,00:22:33:44:55:66 -i issue-812
Warning: issue-812 was captured using a snaplen of 50 bytes.  This may mean you have truncated packets.

Hardware watchpoint 2: *0x55555559f140

Old value = <unreadable>
New value = 0
__memset_avx2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:203
203     ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S: No such file or directory.
(gdb) c
Continuing.

Hardware watchpoint 2: *0x55555559f140

Old value = 0
New value = 1431959872
dlt_en10mb_init (ctx=0x55555559f040) at ../../../code/src/tcpedit/plugins/dlt_en10mb/en10mb.c:114
warning: Source file is more recent than executable.
114         config = (en10mb_config_t *)plugin->config;
(gdb) c
Continuing.

Hardware watchpoint 2: *0x55555559f140

Old value = 1431959872
New value = 0
dlt_en10mb_cleanup (ctx=0x55555559f040) at ../../../code/src/tcpedit/plugins/dlt_en10mb/en10mb.c:151    <- clean up here first
151             plugin->config_size = 0; 

@fklassen fklassen changed the base branch from master to 4.5.0 June 3, 2024 00:36
@fklassen fklassen self-assigned this Jun 3, 2024
@fklassen fklassen added the bug label Jun 3, 2024
@fklassen fklassen merged commit b002ccc into appneta:4.5.0 Jun 3, 2024
fklassen added a commit that referenced this pull request Jun 4, 2024
Double free was fixed in PRs #711 and #851. This fix applied after these PRs introduces memory leaks.
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Jul 25, 2024
Add patch to fix tcpreplay CVE-2023-4256
dlt_jnpr_ether_cleanup: check config before cleanup
Links:
appneta/tcpreplay#851
appneta/tcpreplay#813 (comment)

Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/meta-openembedded that referenced this pull request Aug 5, 2024
Source: meta-openembedded
MR: 158189
Type: Integration
Disposition: Merged from meta-openembedded
ChangeID: e488bc8
Description:

Add patch to fix tcpreplay CVE-2023-4256
dlt_jnpr_ether_cleanup: check config before cleanup
Links:
appneta/tcpreplay#851
appneta/tcpreplay#813 (comment)

Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/meta-openembedded that referenced this pull request Aug 19, 2024
Source: meta-openembedded
MR: 158406
Type: Integration
Disposition: Merged from meta-openembedded
ChangeID: 4d7c91e
Description:

Add patch to fix tcpreplay CVE-2023-4256
dlt_jnpr_ether_cleanup: check config before cleanup
Links:
appneta/tcpreplay#851
appneta/tcpreplay#813 (comment)

Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] tcprewrite SEGV plugins/dlt_jnpr_ether/jnpr_ether.c:167 in dlt_jnpr_ether_cleanup

2 participants