{"id":"CVE-2026-139110","aliases":["CVE-2026-139110"],"related":[],"kind":"vulnerability","state":"published","title":"apparmor: mediate AF_UNSPEC socket disconnects","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\napparmor: mediate AF_UNSPEC socket disconnects\n\naa_inet_connect_perm() returns success immediately for AF_UNSPEC\nbefore checking the active AppArmor profile.  AF_UNSPEC is the socket\ndisconnect operation for TCP and UDP.  A process confined by a profile\ncontaining deny network can therefore disconnect inherited sockets\neven though ordinary socket creation and connect calls are denied.\n\nconsole output:\nhttps://gist.githubusercontent.com/shaos26/73b057c77b9ea22d5e6813c259dbf43c/raw/fab5c58d6f184f5fab88a3a31a80c2b919efecf0/console-output.txt\nreproduction kernel config:\nhttps://gist.githubusercontent.com/shaos26/73b057c77b9ea22d5e6813c259dbf43c/raw/b9192c97c92fdd3b59089704bad6fbd0a33ccf06/kernel-config.txt\nreproducer:\nhttps://gist.githubusercontent.com/shaos26/73b057c77b9ea22d5e6813c259dbf43c/raw/92c7dd098a227276fe3daeea45996e2848e66439/poc.c\n\nBuild the kernel from HEAD with the attached reproduction config, then\nmake a one-file initramfs.  The PoC mounts sysfs and securityfs\nitself; DEVTMPFS_MOUNT supplies /dev/console.\n\n    mkdir -p build rootfs\n    cp kernel-config.txt build/.config\n    make O=build olddefconfig\n    make O=build -j\"$(nproc)\" bzImage\n    cc -O2 -static -Wall -Wextra -o poc poc.c\n    cp poc rootfs/poc\n    (cd rootfs && find poc | cpio -o -H newc --owner=0:0) | gzip -9 > initramfs.cpio.gz\n    timeout 900 qemu-system-x86_64 -kernel build/arch/x86/boot/bzImage \\\n        -initrd initramfs.cpio.gz -append \"console=ttyS0 rdinit=/poc panic=-1 loglevel=7 lsm=apparmor security=apparmor apparmor=1\" \\\n        -nographic -m 1024 -smp 1 -no-reboot 2>&1 | tee console.log\n\nUnder the deny-network profile, socket() and connect(AF_INET) returned\nEACCES, but connect(fd, AF_UNSPEC) returned success and tore down the\ninherited connection and listener.  Two fresh boots matched.  A\none-line control that routed AF_UNSPEC through aa_sk_perm returned\nEACCES and kept both sockets alive.\n\nImpact and prerequisites: A confined process that inherits a TCP/UDP\nsocket can bypass the profile's network mediation for disconnect and\ndisrupt that socket.  The finding does not permit socket creation,\nbind, or arbitrary peer connections; no privilege escalation is\ndemonstrated.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\napparmor: mediate AF_UNSPEC socket disconnects\n\naa_inet_connect_perm() returns success immediately for AF_UNSPEC\nbefore checking the active AppArmor profile.  AF_UNSPEC is the socket\ndisconnect operation for TCP and UDP.  A process confined by a profile\ncontaining deny network can therefore disconnect inherited sockets\neven though ordinary socket creation and connect calls are denied.\n\nconsole output:\nhttps://gist.githubusercontent.com/shaos26/73b057c77b9ea22d5e6813c259dbf43c/raw/fab5c58d6f184f5fab88a3a31a80c2b919efecf0/console-output.txt\nreproduction kernel config:\nhttps://gist.githubusercontent.com/shaos26/73b057c77b9ea22d5e6813c259dbf43c/raw/b9192c97c92fdd3b59089704bad6fbd0a33ccf06/kernel-config.txt\nreproducer:\nhttps://gist.githubusercontent.com/shaos26/73b057c77b9ea22d5e6813c259dbf43c/raw/92c7dd098a227276fe3daeea45996e2848e66439/poc.c\n\nBuild the kernel from HEAD with the attached reproduction config, then\nmake a one-file initramfs.  The PoC mounts sysfs and securityfs\nitself; DEVTMPFS_MOUNT supplies /dev/console.\n\n    mkdir -p build rootfs\n    cp kernel-config.txt build/.config\n    make O=build olddefconfig\n    make O=build -j\"$(nproc)\" bzImage\n    cc -O2 -static -Wall -Wextra -o poc poc.c\n    cp poc rootfs/poc\n    (cd rootfs && find poc | cpio -o -H newc --owner=0:0) | gzip -9 > initramfs.cpio.gz\n    timeout 900 qemu-system-x86_64 -kernel build/arch/x86/boot/bzImage \\\n        -initrd initramfs.cpio.gz -append \"console=ttyS0 rdinit=/poc panic=-1 loglevel=7 lsm=apparmor security=apparmor apparmor=1\" \\\n        -nographic -m 1024 -smp 1 -no-reboot 2>&1 | tee console.log\n\nUnder the deny-network profile, socket() and connect(AF_INET) returned\nEACCES, but connect(fd, AF_UNSPEC) returned success and tore down the\ninherited connection and listener.  Two fresh boots matched.  A\none-line control that routed AF_UNSPEC through aa_sk_perm returned\nEACCES and kept both sockets alive.\n\nImpact and prerequisites: A confined process that inherits a TCP/UDP\nsocket can bypass the profile's network mediation for disconnect and\ndisrupt that socket.  The finding does not permit socket creation,\nbind, or arbitrary peer connections; no privilege escalation is\ndemonstrated.","source":"cvelist"}],"published":"2026-11-30T13:31:40.482Z","modified":"2026-11-30T14:18:19.800Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"89ac6aa752ec8b7b43d8d88a3e7719d1868d582a","fixed":"6bac94125c0b9471f46a18be21916d6d4a5bcd60","status":"affected"},{"type":"git","introduced":"89ac6aa752ec8b7b43d8d88a3e7719d1868d582a","fixed":"049760746597cfd054c181fe850531be3c1e7358","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"7.3","status":"affected"},{"type":"semver","introduced":"0","fixed":"7.3","status":"unaffected"},{"type":"semver","introduced":"7.3.6","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/6bac94125c0b9471f46a18be21916d6d4a5bcd60","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/049760746597cfd054c181fe850531be3c1e7358","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139110","url":"https://www.cve.org/CVERecord?id=CVE-2026-139110","licence":"CVE Terms of Use","modified":"2026-11-30T13:31:40.482Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139110","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139110","licence":"Public domain","modified":"2026-11-30T14:18:19.800Z"}],"updatedAt":"2026-11-30T14:32:24.240Z","epss":{"score":0.00355,"percentile":0.31217,"date":"2026-12-01T12:00:22.000Z"}}