diff options
| author | Nitin Wankhade <nitin.wankhade@kpit.com> | 2025-09-22 09:08:19 +0530 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-09-26 15:01:57 +0200 |
| commit | 8f65fa4e2eb7598384d5d1d1be07beef10c0b4e8 (patch) | |
| tree | f2c85cf58f24fb6eff1067ad84a612270366324a | |
| parent | bfa5f662db7c35d46afb4e57fae5aabd6cf8189e (diff) | |
| download | meta-openembedded-8f65fa4e2eb7598384d5d1d1be07beef10c0b4e8.tar.gz | |
iperf3: Fix CVE-2025-54349
This commit fix heap overflow for iperf3 package
Reference: https://github.com/esnet/iperf/commit/4e5313bab0b9b3fe03513ab54f722c8a3e4b7bdf
Signed-off-by: Nitin Wankhade <nitin.wankhade333@gmail.com>
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
| -rw-r--r-- | meta-oe/recipes-benchmark/iperf3/iperf3/CVE-2025-54349.patch | 56 | ||||
| -rw-r--r-- | meta-oe/recipes-benchmark/iperf3/iperf3_3.14.bb | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/iperf3/iperf3/CVE-2025-54349.patch b/meta-oe/recipes-benchmark/iperf3/iperf3/CVE-2025-54349.patch new file mode 100644 index 0000000000..a8d3bf9cef --- /dev/null +++ b/meta-oe/recipes-benchmark/iperf3/iperf3/CVE-2025-54349.patch | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | Subject: [PATCH] iperf3: Fix CVE-2025-54349 | ||
| 2 | CVE: CVE-2025-54349 | ||
| 3 | Upstream-Status: Backport [https://github.com/esnet/iperf/commit/4e5313bab0b9b3fe03513ab54f722c8a3e4b7bdf] | ||
| 4 | Comment: Patch is refreshed as per codebase of 3.14 | ||
| 5 | Signed-off-by: Nitin Wankhade <nitin.wankhade333@gmail.com> | ||
| 6 | --- | ||
| 7 | --- a/src/iperf_auth.c 2025-08-19 12:02:47.706337000 +0530 | ||
| 8 | +++ b/src/iperf_auth.c 2025-09-15 12:50:47.933400511 +0530 | ||
| 9 | @@ -264,7 +264,8 @@ | ||
| 10 | |||
| 11 | keysize = RSA_size(rsa); | ||
| 12 | rsa_buffer = OPENSSL_malloc(keysize * 2); | ||
| 13 | - *plaintext = (unsigned char*)OPENSSL_malloc(keysize); | ||
| 14 | + // Note: +1 for NULL | ||
| 15 | + *plaintext = (unsigned char*)OPENSSL_malloc(keysize + 1); | ||
| 16 | |||
| 17 | BIO *bioBuff = BIO_new_mem_buf((void*)encryptedtext, encryptedtext_len); | ||
| 18 | rsa_buffer_len = BIO_read(bioBuff, rsa_buffer, keysize * 2); | ||
| 19 | @@ -274,7 +275,7 @@ | ||
| 20 | OPENSSL_free(rsa_buffer); | ||
| 21 | BIO_free(bioBuff); | ||
| 22 | |||
| 23 | - if (plaintext_len < 0) { | ||
| 24 | + if (plaintext_len <= 0) { | ||
| 25 | /* We probably shouldn't be printing stuff like this */ | ||
| 26 | fprintf(stderr, "%s\n", ERR_error_string(ERR_get_error(), NULL)); | ||
| 27 | } | ||
| 28 | @@ -320,7 +321,7 @@ | ||
| 29 | int plaintext_len; | ||
| 30 | plaintext_len = decrypt_rsa_message(encrypted_b64, encrypted_len_b64, private_key, &plaintext); | ||
| 31 | free(encrypted_b64); | ||
| 32 | - if (plaintext_len < 0) { | ||
| 33 | + if (plaintext_len <= 0) { | ||
| 34 | return -1; | ||
| 35 | } | ||
| 36 | plaintext[plaintext_len] = '\0'; | ||
| 37 | @@ -328,16 +329,19 @@ | ||
| 38 | char *s_username, *s_password; | ||
| 39 | s_username = (char *) calloc(plaintext_len, sizeof(char)); | ||
| 40 | if (s_username == NULL) { | ||
| 41 | + OPENSSL_free(plaintext); | ||
| 42 | return -1; | ||
| 43 | } | ||
| 44 | s_password = (char *) calloc(plaintext_len, sizeof(char)); | ||
| 45 | if (s_password == NULL) { | ||
| 46 | + OPENSSL_free(plaintext); | ||
| 47 | free(s_username); | ||
| 48 | return -1; | ||
| 49 | } | ||
| 50 | |||
| 51 | int rc = sscanf((char *) plaintext, auth_text_format, s_username, s_password, &utc_seconds); | ||
| 52 | if (rc != 3) { | ||
| 53 | + OPENSSL_free(plaintext); | ||
| 54 | free(s_password); | ||
| 55 | free(s_username); | ||
| 56 | return -1; | ||
diff --git a/meta-oe/recipes-benchmark/iperf3/iperf3_3.14.bb b/meta-oe/recipes-benchmark/iperf3/iperf3_3.14.bb index 41f336a11f..e161927927 100644 --- a/meta-oe/recipes-benchmark/iperf3/iperf3_3.14.bb +++ b/meta-oe/recipes-benchmark/iperf3/iperf3_3.14.bb | |||
| @@ -17,6 +17,7 @@ SRC_URI = "git://github.com/esnet/iperf.git;branch=master;protocol=https \ | |||
| 17 | file://0002-Remove-pg-from-profile_CFLAGS.patch \ | 17 | file://0002-Remove-pg-from-profile_CFLAGS.patch \ |
| 18 | file://0001-configure.ac-check-for-CPP-prog.patch \ | 18 | file://0001-configure.ac-check-for-CPP-prog.patch \ |
| 19 | file://CVE-2025-54350.patch \ | 19 | file://CVE-2025-54350.patch \ |
| 20 | file://CVE-2025-54349.patch \ | ||
| 20 | " | 21 | " |
| 21 | 22 | ||
| 22 | SRCREV = "a0be85934144bc04712a6695b14ea6e45c379e1d" | 23 | SRCREV = "a0be85934144bc04712a6695b14ea6e45c379e1d" |
