summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Haferkamp <rhafer@suse.com>2020-07-03 14:51:16 +0200
committerwanchao-xu <wanchao.xu@samsung.com>2024-01-09 20:00:55 +0800
commitf32b3952edbb459c6294e4e76060cba41256253d (patch)
treef16292128faebf5245ce660faf6f5771e6047607
parent4542a90e0e82de5001099c4c7bf47bf7fa7607b1 (diff)
downloadqemu-arm-static-f32b3952edbb459c6294e4e76060cba41256253d.tar.gz
qemu-arm-static-f32b3952edbb459c6294e4e76060cba41256253d.tar.bz2
qemu-arm-static-f32b3952edbb459c6294e4e76060cba41256253d.zip
Drop bogus IPv6 messages
Git-commit: c7ede54cbd2e2b25385325600958ba0124e31cc0 References: bsc#1172380 CVE-2020-10756 Drop IPv6 message shorter than what's mentioned in the payload length header (+ the size of the IPv6 header). They're invalid an could lead to data leakage in icmp6_send_echoreply(). Signed-off-by: Jose R Ziviani <jose.ziviani@suse.com>
-rw-r--r--slirp/src/ip6_input.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/slirp/src/ip6_input.c b/slirp/src/ip6_input.c
index dfcbfd6a7..d88d1ab92 100644
--- a/slirp/src/ip6_input.c
+++ b/slirp/src/ip6_input.c
@@ -49,6 +49,13 @@ void ip6_input(struct mbuf *m)
goto bad;
}
+ // Check if the message size is big enough to hold what's
+ // set in the payload length header. If not this is an invalid
+ // packet
+ if (m->m_len < ntohs(ip6->ip_pl) + sizeof(struct ip6)) {
+ goto bad;
+ }
+
/* check ip_ttl for a correct ICMP reply */
if (ip6->ip_hl == 0) {
icmp6_send_error(m, ICMP6_TIMXCEED, ICMP6_TIMXCEED_INTRANS);