← Commit list

e265c8d4c

Russ Dill
Russ Dill
2023-10-04
SUCCESS Duration: 153s

Subject

udhcp: Avoid leaking uninitialized/stale data

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/udhcp/d6_dhcpc.c+1 -0
@@ -961,6 +961,7 @@ static NOINLINE int d6_recv_raw_packet(struct in6_addr *peer_ipv6, struct d6_pac
d6_dump_packet(&packet.data);
bytes -= sizeof(packet.ip6) + sizeof(packet.udp);
+ memset(d6_pkt, 0, sizeof(*d6_pkt));
memcpy(d6_pkt, &packet.data, bytes);
return bytes;
}
networking/udhcp/dhcpc.c+2 -1
@@ -966,7 +966,7 @@ static NOINLINE int d4_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
check = packet.udp.check;
packet.udp.check = 0;
if (check && check != inet_cksum(&packet, bytes)) {
- log1s("packet with bad UDP checksum received, ignoring");
+ log1s("packet with bad UDP checksum, ignoring");
return -2;
}
skip_udp_sum_check:
@@ -981,6 +981,7 @@ static NOINLINE int d4_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
udhcp_dump_packet(&packet.data);
bytes -= sizeof(packet.ip) + sizeof(packet.udp);
+ memset(dhcp_pkt, 0, sizeof(*dhcp_pkt));
memcpy(dhcp_pkt, &packet.data, bytes);
return bytes;
}