1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-14 15:21:37 +03:00
systemd/src/libsystemd-network
Patrik Flykt d182960ae9 test-dhcp6-client: Fix option length
The whole DHCPv6 test message length was incorrectly used as the length
of DHCPv6 options causing the following bad memory access:

$ build/test-dhcp6-client
Assertion 'interface_index >= -1' failed at ../src/libsystemd-network/sd-dhcp6-client.c:129, function sd_dhcp6_client_set_index(). Ignoring.
=================================================================
==29135==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fe204aa9148 at pc 0x7fe204a5958f bp 0x7fff3e47d470 sp 0x7fff3e47d460
READ of size 1 at 0x7fe204aa9148 thread T0
    #0 0x7fe204a5958e in option_parse_hdr ../src/libsystemd-network/dhcp6-option.c:145
    #1 0x7fe204a59884 in dhcp6_option_parse ../src/libsystemd-network/dhcp6-option.c:165
    #2 0x7fe204a4eb9c in test_advertise_option ../src/libsystemd-network/test-dhcp6-client.c:227
    #3 0x7fe204a51c58 in main ../src/libsystemd-network/test-dhcp6-client.c:584
    #4 0x7fe2031590df in __libc_start_main (/lib64/libc.so.6+0x200df)
    #5 0x7fe204a4cc5b (/home/test/systemd/build/test-dhcp6-client+0x25c5b)

0x7fe204aa9148 is located 2 bytes to the right of global variable 'msg_advertise' from '../src/libsystemd-network/test-dhcp6-client.c' (0x7fe204aa9080) of size 198
0x7fe204aa9148 is located 56 bytes to the left of global variable 'msg_reply' from '../src/libsystemd-network/test-dhcp6-client.c' (0x7fe204aa9180) of size 173
SUMMARY: AddressSanitizer: global-buffer-overflow ../src/libsystemd-network/dhcp6-option.c:145 option_parse_hdr
2014-08-30 18:35:43 -04:00
..
dhcp6-internal.h sd-dhcp6-client: Receive and parse Advertise messages 2014-06-19 15:44:44 +03:00
dhcp6-lease-internal.h sd-dhcp6-client: Implement Rapid Commit 2014-06-26 16:10:47 +03:00
dhcp6-network.c sd-dhcp6-client: Add functions to bind to DHCPv6 UDP socket 2014-06-19 15:44:44 +03:00
dhcp6-option.c sd-dhcp6-client: Implement Rapid Commit 2014-06-26 16:10:47 +03:00
dhcp6-protocol.h dhcp-network: remove unused DHCP6_STATE_RS 2014-07-23 09:19:47 +02:00
dhcp-internal.h dhcp-network: add check for DHCP.chaddr 2014-07-07 12:17:55 +02:00
dhcp-lease-internal.h Add support for DHCP static route options 2014-06-29 15:18:21 +02:00
dhcp-network.c sd-network: make socket filter programs static const where possible 2014-07-29 23:53:08 +02:00
dhcp-option.c sd-dhcp: option_append - support falling back to 'sname' and 'file' 2014-05-21 16:09:05 +02:00
dhcp-packet.c sd-dhcp: checksum - make endianess-neutral 2014-06-17 09:17:07 +02:00
dhcp-protocol.h sd-dhcp-client: allow the max dhcp message size to be set to the MTU of the link 2014-08-01 16:34:50 +02:00
dhcp-server-internal.h sd-dhcp-server: always send out ROUTER and SUBNET_MASK 2014-08-04 20:58:15 +02:00
ipv4ll-internal.h sd-network: IPv4 link-local support [v2] 2014-03-03 23:24:34 +01:00
ipv4ll-network.c sd-network: make socket filter programs static const where possible 2014-07-29 23:53:08 +02:00
ipv4ll-packet.c sd-network: IPv4 link-local support [v2] 2014-03-03 23:24:34 +01:00
Makefile
network-internal.c networkd: monopolize in_addr utility functions in shared/in-addr-util.h 2014-08-11 22:46:42 +02:00
network-internal.h networkd: monopolize in_addr utility functions in shared/in-addr-util.h 2014-08-11 22:46:42 +02:00
sd-dhcp6-client.c sd-event: name event sources used in libraries 2014-08-28 21:19:17 +02:00
sd-dhcp6-lease.c sd-dhcp6-client: Implement Rapid Commit 2014-06-26 16:10:47 +03:00
sd-dhcp-client.c Fix a few typos in log messages 2014-08-29 09:28:19 -04:00
sd-dhcp-lease.c dhcp: the localhost isn't valid as hostname either 2014-08-15 03:10:20 +02:00
sd-dhcp-server.c sd-dhcp-server: linebreaks 2014-08-14 01:29:51 +02:00
sd-icmp6-nd.c Fix a few more typos 2014-08-30 13:46:07 -04:00
sd-ipv4ll.c sd-ipv4ll: name the correct source 2014-08-30 22:25:42 +02:00
test-dhcp6-client.c test-dhcp6-client: Fix option length 2014-08-30 18:35:43 -04:00
test-dhcp-client.c libsystemd-network: use CLOCK_BOOTTIME instead of CLOCK_MONOTONIC where possible 2014-07-24 19:02:58 +02:00
test-dhcp-option.c test-dhcp-option: fix memleak 2014-05-26 21:31:57 +02:00
test-dhcp-server.c test: dhcp-server - fix test 2014-08-14 01:29:51 +02:00
test-icmp6-rs.c libsystemd-network: use CLOCK_BOOTTIME instead of CLOCK_MONOTONIC where possible 2014-07-24 19:02:58 +02:00
test-ipv4ll.c libnetworkd: add link local tests 2014-04-27 23:39:13 +02:00