[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 2/2] Delay crash when mbufs are corrupted
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [RFC PATCH 2/2] Delay crash when mbufs are corrupted |
Date: |
Thu, 22 Aug 2019 16:41:34 +0200 |
If the mbufs linked list is corrupted, give the application
a chance to properly shutdown itself without causing dataloss.
For now, this means slowly leaking the heap.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
src/ip_input.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/ip_input.c b/src/ip_input.c
index ee52085..36962b5 100644
--- a/src/ip_input.c
+++ b/src/ip_input.c
@@ -185,6 +185,15 @@ void ip_input(struct mbuf *m)
if (ip == NULL)
return;
m = dtom(slirp, ip);
+ if (m == NULL) {
+ /* The mbufs linked list is corrupted, we
+ * should properly shutdown the application.
+ * We prefer to leak a mbuf on the heap
+ * rather than allowing null dereference
+ * and eventual crash (data corruption).
+ */
+ return; /* TODO warn the library consumer! */
+ }
} else if (fp)
ip_freef(slirp, fp);
--
2.20.1
- [Qemu-devel] [PATCH 0/2] slirp: Fix heap buffer overflow during packet reassembly (CVE-2019-14378), Philippe Mathieu-Daudé, 2019/08/22
- [Qemu-devel] [PATCH 1/2] Do not reassemble fragments pointing outside of the original payload, Philippe Mathieu-Daudé, 2019/08/22
- Re: [Qemu-devel] [Slirp] [PATCH 1/2] Do not reassemble fragments pointing outside of the original payload, Samuel Thibault, 2019/08/22
- Re: [Qemu-devel] [Slirp] [PATCH 1/2] Do not reassemble fragments pointing outside of the original payload, Philippe Mathieu-Daudé, 2019/08/23
- Re: [Qemu-devel] [Slirp] [PATCH 1/2] Do not reassemble fragments pointing outside of the original payload, Samuel Thibault, 2019/08/25
- Re: [Qemu-devel] [Slirp] [PATCH 1/2] Do not reassemble fragments pointing outside of the original payload, P J P, 2019/08/29
- Re: [Qemu-devel] [Slirp] [PATCH 1/2] Do not reassemble fragments pointing outside of the original payload, Philippe Mathieu-Daudé, 2019/08/29
- Re: [Qemu-devel] [Slirp] [PATCH 1/2] Do not reassemble fragments pointing outside of the original payload, Philippe Mathieu-Daudé, 2019/08/29
- Re: [Qemu-devel] [Slirp] [PATCH 1/2] Do not reassemble fragments pointing outside of the original payload, Philippe Mathieu-Daudé, 2019/08/29
[Qemu-devel] [RFC PATCH 2/2] Delay crash when mbufs are corrupted,
Philippe Mathieu-Daudé <=