Commit 3d4ff1ba authored by Simon Kelley's avatar Simon Kelley

Security fix, CVE-2017-14493, DHCPv6 - Stack buffer overflow.

Fix stack overflow in DHCPv6 code. An attacker who can send
a DHCPv6 request to dnsmasq can overflow the stack frame and
crash or control dnsmasq.
parent 24036ea5
...@@ -43,6 +43,14 @@ version 2.78 ...@@ -43,6 +43,14 @@ version 2.78
Credit to Felix Wilhelm, Fermin J. Serna, Gabriel Campana Credit to Felix Wilhelm, Fermin J. Serna, Gabriel Campana
and Kevin Hamacher of the Google Security Team for and Kevin Hamacher of the Google Security Team for
finding this. finding this.
Fix stack overflow in DHCPv6 code. An attacker who can send
a DHCPv6 request to dnsmasq can overflow the stack frame and
crash or control dnsmasq.
CVE-2017-14493 applies.
Credit to Felix Wilhelm, Fermin J. Serna, Gabriel Campana
and Kevin Hamacher of the Google Security Team for
finding this.
version 2.77 version 2.77
......
...@@ -206,6 +206,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz, ...@@ -206,6 +206,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz,
/* RFC-6939 */ /* RFC-6939 */
if ((opt = opt6_find(opts, end, OPTION6_CLIENT_MAC, 3))) if ((opt = opt6_find(opts, end, OPTION6_CLIENT_MAC, 3)))
{ {
if (opt6_len(opt) - 2 > DHCP_CHADDR_MAX) {
return 0;
}
state->mac_type = opt6_uint(opt, 0, 2); state->mac_type = opt6_uint(opt, 0, 2);
state->mac_len = opt6_len(opt) - 2; state->mac_len = opt6_len(opt) - 2;
memcpy(&state->mac[0], opt6_ptr(opt, 2), state->mac_len); memcpy(&state->mac[0], opt6_ptr(opt, 2), state->mac_len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment