If you check in your syslog (or console), you will probably see a message
telling you that build_udp_raw() has performed an 'backwards memcpy' which
is not allowed because the result is undefined, therefore we check for this
and then log + abort.

this code should be using memmove().

Rafael Sadowski <raf...@sizeofvoid.org> wrote:

> I stumbled across the following. Maybe only our nmap port is broken.
> 
> $ doas nmap -vvv -sU -sT google.de
> Starting Nmap 7.91 ( https://nmap.org ) at 2023-11-16 21:28 CET
> Warning: Hostname google.de resolves to 2 IPs. Using 142.250.74.195.
> Initiating Ping Scan at 21:28
> Scanning google.de (142.250.74.195) [4 ports]
> sendto in send_ip_packet_sd: sendto(4, packet, 40, 0, 142.250.74.195, 16) => 
> Permission denied
> Offending packet: TCP 10.0.23.5:58160 > 142.250.74.195:80 A ttl=39 id=51533 
> iplen=40  seq=0 win=1024 
> Completed Ping Scan at 21:28, 0.01s elapsed (1 total hosts)
> Initiating Parallel DNS resolution of 1 host. at 21:28
> Completed Parallel DNS resolution of 1 host. at 21:28, 0.00s elapsed
> DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 1, OK: 1, NX: 0, DR: 0, 
> SF: 0, TR: 1, CN: 0]
> Initiating UDP Scan at 21:28
> Scanning google.de (142.250.74.195) [1000 ports]
> zsh: abort (core dumped)  doas nmap -vvv -sU -sT google.d
> 
> Tested on:
> dmesg|head
> OpenBSD 7.4-current (GENERIC.MP) #16: Fri Nov  3 21:38:55 MDT 2023
>     dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
>     real mem  = 8432713728 (8042MB)
>     avail mem = 8137003008 (7760MB)
>     random: good seed from bootblocks
>     mainbus0 at root: Raspberry Pi 4 Model B Rev 1.4
>     psci0 at mainbus0: PSCI 1.1, SMCCC 1.2
>     efi0 at mainbus0: UEFI 2.7
>     efi0: https://github.com/pftf/RPi4 rev 0x10000
>     smbios0 at efi0: SMBIOS 3.3.0
> 
> and
> 
> OpenBSD 7.4-current (GENERIC.MP) #1447: Wed Nov 15 09:56:54 MST 2023
>     dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>     real mem = 34026549248 (32450MB)
>     avail mem = 32975663104 (31448MB)
>     random: good seed from bootblocks
>     mpath0 at root
>     scsibus0 at mpath0: 256 targets
>     mainbus0 at root
>     bios0 at mainbus0: SMBIOS rev. 3.4 @ 0x8dfda000 (81 entries)
>     bios0: vendor LENOVO version "N3AET77W (1.42 )" date 09/21/2023
> 
> backtrace:
> 
> #1  0x0000010a3cca7262 in _libc_abort () at 
> /usr/src/lib/libc/stdlib/abort.c:51
> #2  0x0000010a3ccfdda3 in memcpy (dst0=<optimized out>, src0=<optimized out>, 
> length=<optimized out>) at /usr/src/lib/libc/string/memcpy.c:74
> #3  0x000001078eaf3ddd in build_udp_raw(in_addr const*, in_addr const*, int, 
> unsigned short, unsigned char, bool, unsigned char*, int, unsigned short, 
> unsigned short, char const*, unsigned short, unsigned int*) ()
> #4  0x000001078eadcc3e in sendIPScanProbe(UltraScanInfo*, HostScanStats*, 
> probespec const*, unsigned char, unsigned char) ()
> #5  0x000001078ead6601 in ultra_scan(std::__1::vector<Target*, 
> std::__1::allocator<Target*> >&, scan_lists*, stype, timeout_info*) ()
> #6  0x000001078eaa5554 in nmap_main(int, char**) ()
> #7  0x000001078ea7c1a1 in _start ()
> 

Reply via email to