LoFP LoFP / legitimate processes almost never open a sock_raw socket with an unregistered address family. the eafnosupport error on a raw socket from a non-system path has no benign use case outside of socket fuzzing or explicit error-handling tests

Techniques

Sample rules

Linux Auditd SOCK RAW EAFNOSUPPORT From User Writable Path

Description

The following analytic detects a process executing from a user-writable directory calling socket() with SOCK_RAW (a1=3) and receiving EAFNOSUPPORT (exit=-97, errno 97). This is the kernel trigger for vhost-vsock class privilege escalation exploits. When socket() is called with an unregistered address family and SOCK_RAW, the kernel calls request_module() to attempt to load a matching protocol module. In vulnerable kernels, this triggers a stale IOTLB metadata cache access path that allows an unprivileged user to write an arbitrary value to modprobe_path. The specific address family number varies by kernel and exploit variant (AF 41, 42, or any unregistered AF).

Detection logic

`linux_auditd`
type=SYSCALL
key=sock_raw_eafnosupport
success=no
exit="-97"
a1=3
exe IN (
    "/dev/shm/*",
    "/home/*",
    "/run/user/*",
    "/tmp/*",
    "/var/tmp/*"
)


| rename host as dest


| stats count min(_time) as firstTime
              max(_time) as lastTime
              values(exe) as process_path
              values(a0) as address_family
              values(pid) as pid
              values(ppid) as ppid

  BY auid uid dest ses


| `security_content_ctime(firstTime)`

| `security_content_ctime(lastTime)`

| `linux_auditd_sock_raw_eafnosupport_from_user_writable_path_filter`