On Mon, Apr 14, 2014 at 09:32:43PM -0400, sven falempin wrote:
> so i got gdb back to the machine because i cannot reproduce outside of the
> box.
> gdb too old cannot gcore.
>
> The state is nasty, but i do get the trace of the dhcp transaction.
>
> [..]
> DHCPREQUEST on trunk0 to 255.255.255.255 port 67
> DHCPACK from 10.0.0.254 (96:4f:87:9c:ad:67)
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x1c005b26 in add_classless_static_routes (rdomain=13684944,
> classless_static_routes=0x0) at /usr/src/sbin/dhclient/dhclient.c:2408
> 2408 /usr/src/sbin/dhclient/dhclient.c: No such file or directory.
> in /usr/src/sbin/dhclient/dhclient.c
> (gdb) bt
> #0 0x1c005b26 in add_classless_static_routes (rdomain=13684944,
> classless_static_routes=0x0) at /usr/src/sbin/dhclient/dhclient.c:2408
> #1 0xd0d0d0d0 in ?? ()
> #2 0x00d0d0d0 in ?? ()
> #3 0x00000000 in ?? ()
... the line in 5.4 is :
2405: i += bytes;
2406:
2407: memset(&gateway, 0, sizeof(gateway));
2408: memcpy(&gateway, &classless_static_routes->data[i], 4);
The memcpy segfaults.
Current and 5.5 have a rewritten version of this code.
Can you reproduce on current?
-Otto
> The transmission leading to the bug, maybe it can be used as a replay test :
>
> tcpdump: listening on trunk0, link-type EN10MB
> 1397524649.881762 fe:e1:ba:d0:8e:d0 ff:ff:ff:ff:ff:ff 0800 342:
> 10.0.0.126.68 > 255.255.255.255.67: xid:0x38641e99 vend-rfc1048
> DHCP:REQUEST HN:"ulis-v12-GW" RQ:10.0.0.126
> PR:SM+BR+TZ+121+DG+DN+NS+HN CID:1.254.225.186.208.142.208 [tos 0x10]
> 0000: ffff ffff ffff fee1 bad0 8ed0 0800 4510 ..............E.
> 0010: 0148 0000 0000 8011 2f18 0a00 007e ffff .H....../....~..
> 0020: ffff 0044 0043 0134 3fc2 0101 0600 3864 ...D.C.4?.....8d
> 0030: 1e99 0000 0000 0000 0000 0000 0000 0000 ................
> 0040: 0000 0000 0000 fee1 bad0 8ed0 0000 0000 ................
> 0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0110: 0000 0000 0000 6382 5363 3501 030c 0b75 ......c.Sc5....u
> 0120: 6c69 732d 7631 322d 4757 3204 0a00 007e lis-v12-GW2....~
> 0130: 3708 011c 0279 030f 060c 3d07 01fe e1ba 7....y....=.....
> 0140: d08e d0ff 0000 0000 0000 0000 0000 0000 ................
> 0150: 0000 0000 0000 ......
>
> 1397524652.887574 fe:e1:ba:d0:8e:d0 ff:ff:ff:ff:ff:ff 0800 342:
> 10.0.0.126.68 > 255.255.255.255.67: xid:0x38641e99 secs:3 vend-rfc1048
> DHCP:REQUEST HN:"ulis-v12-GW" RQ:10.0.0.126
> PR:SM+BR+TZ+121+DG+DN+NS+HN CID:1.254.225.186.208.142.208 [tos 0x10]
> 0000: ffff ffff ffff fee1 bad0 8ed0 0800 4510 ..............E.
> 0010: 0148 0000 0000 8011 2f18 0a00 007e ffff .H....../....~..
> 0020: ffff 0044 0043 0134 3fbf 0101 0600 3864 ...D.C.4?.....8d
> 0030: 1e99 0003 0000 0000 0000 0000 0000 0000 ................
> 0040: 0000 0000 0000 fee1 bad0 8ed0 0000 0000 ................
> 0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0110: 0000 0000 0000 6382 5363 3501 030c 0b75 ......c.Sc5....u
> 0120: 6c69 732d 7631 322d 4757 3204 0a00 007e lis-v12-GW2....~
> 0130: 3708 011c 0279 030f 060c 3d07 01fe e1ba 7....y....=.....
> 0140: d08e d0ff 0000 0000 0000 0000 0000 0000 ................
> 0150: 0000 0000 0000 ......
>
> 1397524658.897378 fe:e1:ba:d0:8e:d0 ff:ff:ff:ff:ff:ff 0800 342:
> 10.0.0.126.68 > 255.255.255.255.67: xid:0x38641e99 secs:9 vend-rfc1048
> DHCP:REQUEST HN:"ulis-v12-GW" RQ:10.0.0.126
> PR:SM+BR+TZ+121+DG+DN+NS+HN CID:1.254.225.186.208.142.208 [tos 0x10]
> 0000: ffff ffff ffff fee1 bad0 8ed0 0800 4510 ..............E.
> 0010: 0148 0000 0000 8011 2f18 0a00 007e ffff .H....../....~..
> 0020: ffff 0044 0043 0134 3fb9 0101 0600 3864 ...D.C.4?.....8d
> 0030: 1e99 0009 0000 0000 0000 0000 0000 0000 ................
> 0040: 0000 0000 0000 fee1 bad0 8ed0 0000 0000 ................
> 0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0110: 0000 0000 0000 6382 5363 3501 030c 0b75 ......c.Sc5....u
> 0120: 6c69 732d 7631 322d 4757 3204 0a00 007e lis-v12-GW2....~
> 0130: 3708 011c 0279 030f 060c 3d07 01fe e1ba 7....y....=.....
> 0140: d08e d0ff 0000 0000 0000 0000 0000 0000 ................
> 0150: 0000 0000 0000 ......
>
> 1397524673.907963 fe:e1:ba:d0:8e:d0 ff:ff:ff:ff:ff:ff 0800 342:
> 0.0.0.0.68 > 255.255.255.255.67: xid:0x95ce17 vend-rfc1048
> DHCP:DISCOVER HN:"ulis-v12-GW" RQ:10.0.0.126
> PR:SM+BR+TZ+121+DG+DN+NS+HN CID:1.254.225.186.208.142.208 [tos 0x10]
> 0000: ffff ffff ffff fee1 bad0 8ed0 0800 4510 ..............E.
> 0010: 0148 0000 0000 8011 3996 0000 0000 ffff .H......9.......
> 0020: ffff 0044 0043 0134 d490 0101 0600 0095 ...D.C.4........
> 0030: ce17 0000 0000 0000 0000 0000 0000 0000 ................
> 0040: 0000 0000 0000 fee1 bad0 8ed0 0000 0000 ................
> 0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0110: 0000 0000 0000 6382 5363 3501 010c 0b75 ......c.Sc5....u
> 0120: 6c69 732d 7631 322d 4757 3204 0a00 007e lis-v12-GW2....~
> 0130: 3708 011c 0279 030f 060c 3d07 01fe e1ba 7....y....=.....
> 0140: d08e d0ff 0000 0000 0000 0000 0000 0000 ................
> 0150: 0000 0000 0000 ......
>
> 1397524673.939634 96:4f:87:9c:ad:67 fe:e1:ba:d0:8e:d0 0800 360:
> 10.0.0.254.67 > 10.0.0.126.68: xid:0x95ce17 Y:10.0.0.126 S:10.0.0.254
> vend-rfc1048 DHCP:OFFER SID:10.0.0.254 LT:43200 RN:21600 RB:37800
> SM:255.255.255.0 BR:10.0.0.255
> T121:415279105,3232236030,415279114,3232236030,3232236030,167772414
> NS:10.0.0.254 DG:10.0.0.254 (DF)
> 0000: fee1 bad0 8ed0 964f 879c ad67 0800 4500 .......O...g..E.
> 0010: 015a 0000 4000 4011 2418 0a00 00fe 0a00 .Z..@.@.$.......
> 0020: 007e 0043 0044 0146 47bf 0201 0600 0095 .~.C.D.FG.......
> 0030: ce17 0000 0000 0000 0000 0a00 007e 0a00 .............~..
> 0040: 00fe 0000 0000 fee1 bad0 8ed0 0000 0000 ................
> 0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0110: 0000 0000 0000 6382 5363 3501 0236 040a ......c.Sc5..6..
> 0120: 0000 fe33 0400 00a8 c03a 0400 0054 603b ...3.....:...T`;
> 0130: 0400 0093 a801 04ff ffff 001c 040a 0000 ................
> 0140: ff79 1818 c0a8 01c0 a801 fe18 c0a8 0ac0 .y..............
> 0150: a801 fec0 a801 fe0a 0000 fe06 040a 0000 ................
> 0160: fe03 040a 0000 feff ........
>
> 1397524673.943489 fe:e1:ba:d0:8e:d0 ff:ff:ff:ff:ff:ff 0800 342:
> 0.0.0.0.68 > 255.255.255.255.67: xid:0x95ce17 vend-rfc1048
> DHCP:REQUEST HN:"ulis-v12-GW" RQ:10.0.0.126 SID:10.0.0.254
> PR:SM+BR+TZ+121+DG+DN+NS+HN CID:1.254.225.186.208.142.208 [tos 0x10]
> 0000: ffff ffff ffff fee1 bad0 8ed0 0800 4510 ..............E.
> 0010: 0148 0000 0000 8011 3996 0000 0000 ffff .H......9.......
> 0020: ffff 0044 0043 0134 918e 0101 0600 0095 ...D.C.4........
> 0030: ce17 0000 0000 0000 0000 0000 0000 0000 ................
> 0040: 0000 0000 0000 fee1 bad0 8ed0 0000 0000 ................
> 0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0110: 0000 0000 0000 6382 5363 3501 030c 0b75 ......c.Sc5....u
> 0120: 6c69 732d 7631 322d 4757 3204 0a00 007e lis-v12-GW2....~
> 0130: 3604 0a00 00fe 3708 011c 0279 030f 060c 6.....7....y....
> 0140: 3d07 01fe e1ba d08e d0ff 0000 0000 0000 =...............
> 0150: 0000 0000 0000 ......
>
> 1397524674.011308 96:4f:87:9c:ad:67 fe:e1:ba:d0:8e:d0 0800 373:
> 10.0.0.254.67 > 10.0.0.126.68: xid:0x95ce17 Y:10.0.0.126 S:10.0.0.254
> vend-rfc1048 DHCP:ACK SID:10.0.0.254 LT:43200 RN:21600 RB:37800
> SM:255.255.255.0 BR:10.0.0.255 HN:"ulis-v12-GW"
> T121:415279105,3232236030,415279114,3232236030,3232236030,167772414
> NS:10.0.0.254 DG:10.0.0.254 (DF)
> 0000: fee1 bad0 8ed0 964f 879c ad67 0800 4500 .......O...g..E.
> 0010: 0167 0000 4000 4011 240b 0a00 00fe 0a00 .g..@.@.$.......
> 0020: 007e 0043 0044 0153 9aa6 0201 0600 0095 .~.C.D.S........
> 0030: ce17 0000 0000 0000 0000 0a00 007e 0a00 .............~..
> 0040: 00fe 0000 0000 fee1 bad0 8ed0 0000 0000 ................
> 0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0110: 0000 0000 0000 6382 5363 3501 0536 040a ......c.Sc5..6..
> 0120: 0000 fe33 0400 00a8 c03a 0400 0054 603b ...3.....:...T`;
> 0130: 0400 0093 a801 04ff ffff 001c 040a 0000 ................
> 0140: ff0c 0b75 6c69 732d 7631 322d 4757 7918 ...ulis-v12-GWy.
> 0150: 18c0 a801 c0a8 01fe 18c0 a80a c0a8 01fe ................
> 0160: c0a8 01fe 0a00 00fe 0604 0a00 00fe 0304 ................
> 0170: 0a00 00fe ff .....