Skip to content

Fix NETLINK issues in ZMap caused by changes in latest linux kernel#925

Merged
zakird merged 6 commits intomainfrom
phillip/924-hw-address-ubuntu-24-10
Jan 29, 2025
Merged

Fix NETLINK issues in ZMap caused by changes in latest linux kernel#925
zakird merged 6 commits intomainfrom
phillip/924-hw-address-ubuntu-24-10

Conversation

@phillip-stephens
Copy link
Contributor

@phillip-stephens phillip-stephens commented Jan 28, 2025

Resolves #924

More info provided in #924

Iterates thru netlink msgs to ensure that none are NLMSG_DONE before returning.

Testing

Confirmed that main is broken on Ubuntu 24.10

phillip@phillip-QEMU-Virtual-Machine:~/Documents/zmap$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
phillip@phillip-QEMU-Virtual-Machine:~/Documents/zmap$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.10
Release:        24.10
Codename:       oracular
phillip@phillip-QEMU-Virtual-Machine:~/Documents/zmap$ cmake .; make -j4; sudo ./src/zmap -p 53 1.1.1.1
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

... Compilation skipped for brevity...

[ 98%] Linking C executable ztests
[100%] Built target ztests
Jan 28 15:53:20.419 [INFO] zmap: By default, ZMap will output the unique IP addresses of hosts that respond successfully (e.g., SYN-ACK packet). This is equivalent to running ZMap with the following flags: --output-module=csv --output-fields=saddr --output-filter='success=1 && repeat=0' --no-header-row. If you want all responses, explicitly set an output module or set --output-filter="".
Jan 28 15:53:20.419 [INFO] dedup: Response deduplication method is full
^C
phillip@phillip-QEMU-Virtual-Machine:~/Documents/zmap$ 

Notice the hanging program

Phillip/924... works on Ubuntu 24.10

phillip@phillip-QEMU-Virtual-Machine:~/Documents/zmap$ git checkout phillip/924-hw-address-ubuntu-24-10 
Switched to branch 'phillip/924-hw-address-ubuntu-24-10'
Your branch is up to date with 'origin/phillip/924-hw-address-ubuntu-24-10'.
phillip@phillip-QEMU-Virtual-Machine:~/Documents/zmap$ cmake .; make -j4; sudo ./src/zmap -p 53 1.1.1.1
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

... Compilation skipped for brevity...

[100%] Built target zmap
Jan 28 15:56:12.056 [INFO] zmap: By default, ZMap will output the unique IP addresses of hosts that respond successfully (e.g., SYN-ACK packet). This is equivalent to running ZMap with the following flags: --output-module=csv --output-fields=saddr --output-filter='success=1 && repeat=0' --no-header-row. If you want all responses, explicitly set an output module or set --output-filter="".
Jan 28 15:56:12.056 [INFO] dedup: Response deduplication method is full
Jan 28 15:56:12.067 [INFO] recv: duplicate responses will be excluded from output
Jan 28 15:56:12.067 [INFO] recv: unsuccessful responses will be excluded from output
 0:00 0%; send: 1 1 p/s (88 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 0.00%
1.1.1.1
 0:01 13%; send: 1 done (88 p/s avg); recv: 1 1 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:02 25%; send: 1 done (88 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:03 38%; send: 1 done (88 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:04 50%; send: 1 done (88 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:05 63% (3s left); send: 1 done (88 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:06 75% (2s left); send: 1 done (88 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:07 88% (1s left); send: 1 done (88 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:08 100% (0s left); send: 1 done (88 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
Jan 28 15:56:20.093 [INFO] zmap: completed

Confirmed Change is does not cause regression on Ubuntu 24.04

phillip@phillip-QEMU-Virtual-Machine:~/Documents/zmap$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.1 LTS
Release:	24.04
Codename:	noble
phillip@phillip-QEMU-Virtual-Machine:~/Documents/zmap$ cmake .; make -j4; sudo ./src/zmap -p 53 1.1.1.1

...Compilation skipped for brevity...

[100%] Built target zmap
[sudo] password for phillip: 
Jan 28 15:57:30.292 [INFO] zmap: By default, ZMap will output the unique IP addresses of hosts that respond successfully (e.g., SYN-ACK packet). This is equivalent to running ZMap with the following flags: --output-module=csv --output-fields=saddr --output-filter='success=1 && repeat=0' --no-header-row. If you want all responses, explicitly set an output module or set --output-filter="".
Jan 28 15:57:30.292 [INFO] dedup: Response deduplication method is full
Jan 28 15:57:30.315 [INFO] recv: duplicate responses will be excluded from output
Jan 28 15:57:30.315 [INFO] recv: unsuccessful responses will be excluded from output
 0:00 0%; send: 1 1 p/s (45 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 0.00%
1.1.1.1
 0:01 13%; send: 1 done (45 p/s avg); recv: 1 1 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:02 25%; send: 1 done (45 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:03 38%; send: 1 done (45 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:04 50%; send: 1 done (45 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:05 63% (3s left); send: 1 done (45 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:06 75% (2s left); send: 1 done (45 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:07 88% (1s left); send: 1 done (45 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
 0:08 100% (0s left); send: 1 done (45 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 100.00%
Jan 28 15:57:38.332 [INFO] zmap: completed

@phillip-stephens phillip-stephens marked this pull request as ready for review January 28, 2025 23:58
@zakird zakird merged commit 1822544 into main Jan 29, 2025
12 checks passed
@zakird zakird deleted the phillip/924-hw-address-ubuntu-24-10 branch January 29, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZMap hangs while trying to get default gateway hw address

2 participants