{"id":"CVE-2026-139161","state":"PUBLISHED","title":"tls: keep TX and RX hardware offload on the same device","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ntls: keep TX and RX hardware offload on the same device\n\nAfter TX is offloaded on device A, a route change, or a change in the\nusable-slave set of an 802.3ad or balance-xor (layer3+4) bond, can make\nRX setup program device B. tls_device_attach() sees the existing TLS\ndestructor and keeps ctx->netdev pointing at A. The RX driver state on B\nis then untracked: tls_dev_resync() and tls_dev_del() are invoked on A\nfor a context it never created, and neither socket close nor\nNETDEV_DOWN on B calls tls_dev_del() for B, so the driver context leaks.\nThe reverse setup order has the same problem.\n\nCheck the shared device binding under device_offload_lock before each\ntls_dev_add(). Permit the first attachment and a second direction on the\nsame device. Reject a different device, including when the old binding\nwas cleared by NETDEV_DOWN: the TLS destructor remains installed and\ntls_device_attach() cannot establish a new binding. Setup then falls\nback to software for the requested direction.\n\nThe RX check precedes allocation and software setup. TX uses its existing\nresource unwind path without calling the driver. Document the shared\nbinding and clarify that fallback is per direction.\n\nThis issue was discovered during code review and subsequently\nreproduced on hardware using mlx5 and TLS 1.2 AES-GCM-128.\n\nChanging the route between TX and RX setup installed the second\ndirection on a different device. Driver traces showed successful adds\non both devices, but both deletes at socket close targeted the first\ndevice, leaving an orphaned context on the second. Both setup orders\nreproduced the leak, even though all current core TLS context counters\nreturned to zero. No crash was observed.\n\nWith the fix, the same tests correctly fall back to software for the\nsecond direction and leave no orphaned hardware context.","publishedAt":"2026-11-30T13:32:08.809Z","updatedAt":"2026-11-30T13:32:08.809Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"4799ac81e52a72a6404827bf2738337bb581a174","status":"affected","lessThan":"a2b9316a40f20a79e460bf31c4f036c17cc9c512","versionType":"git"},{"version":"4799ac81e52a72a6404827bf2738337bb581a174","status":"affected","lessThan":"afd3039627d97a959214d544c660390cf28d6527","versionType":"git"},{"version":"4799ac81e52a72a6404827bf2738337bb581a174","status":"affected","lessThan":"d1a31f1523543513da5b285d82598977303011c7","versionType":"git"},{"version":"4799ac81e52a72a6404827bf2738337bb581a174","status":"affected","lessThan":"1c8a70075235cd733095532a97f2405037c52a7b","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["Documentation/networking/tls-offload.rst","net/tls/tls_device.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.19","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["Documentation/networking/tls-offload.rst","net/tls/tls_device.c"]}],"references":["https://git.kernel.org/stable/c/a2b9316a40f20a79e460bf31c4f036c17cc9c512","https://git.kernel.org/stable/c/afd3039627d97a959214d544c660390cf28d6527","https://git.kernel.org/stable/c/d1a31f1523543513da5b285d82598977303011c7","https://git.kernel.org/stable/c/1c8a70075235cd733095532a97f2405037c52a7b"],"weaknesses":[],"ingestedAt":"2026-11-30T13:44:05.999Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139161.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139161","state":"PUBLISHED","datePublished":"2026-11-30T13:32:08.809Z","dateUpdated":"2026-11-30T13:32:08.809Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.917Z"},"containers":{"cna":{"title":"tls: keep TX and RX hardware offload on the same device","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ntls: keep TX and RX hardware offload on the same device\n\nAfter TX is offloaded on device A, a route change, or a change in the\nusable-slave set of an 802.3ad or balance-xor (layer3+4) bond, can make\nRX setup program device B. tls_device_attach() sees the existing TLS\ndestructor and keeps ctx->netdev pointing at A. The RX driver state on B\nis then untracked: tls_dev_resync() and tls_dev_del() are invoked on A\nfor a context it never created, and neither socket close nor\nNETDEV_DOWN on B calls tls_dev_del() for B, so the driver context leaks.\nThe reverse setup order has the same problem.\n\nCheck the shared device binding under device_offload_lock before each\ntls_dev_add(). Permit the first attachment and a second direction on the\nsame device. Reject a different device, including when the old binding\nwas cleared by NETDEV_DOWN: the TLS destructor remains installed and\ntls_device_attach() cannot establish a new binding. Setup then falls\nback to software for the requested direction.\n\nThe RX check precedes allocation and software setup. TX uses its existing\nresource unwind path without calling the driver. Document the shared\nbinding and clarify that fallback is per direction.\n\nThis issue was discovered during code review and subsequently\nreproduced on hardware using mlx5 and TLS 1.2 AES-GCM-128.\n\nChanging the route between TX and RX setup installed the second\ndirection on a different device. Driver traces showed successful adds\non both devices, but both deletes at socket close targeted the first\ndevice, leaving an orphaned context on the second. Both setup orders\nreproduced the leak, even though all current core TLS context counters\nreturned to zero. No crash was observed.\n\nWith the fix, the same tests correctly fall back to software for the\nsecond direction and leave no orphaned hardware context."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"4799ac81e52a72a6404827bf2738337bb581a174","status":"affected","lessThan":"a2b9316a40f20a79e460bf31c4f036c17cc9c512","versionType":"git"},{"version":"4799ac81e52a72a6404827bf2738337bb581a174","status":"affected","lessThan":"afd3039627d97a959214d544c660390cf28d6527","versionType":"git"},{"version":"4799ac81e52a72a6404827bf2738337bb581a174","status":"affected","lessThan":"d1a31f1523543513da5b285d82598977303011c7","versionType":"git"},{"version":"4799ac81e52a72a6404827bf2738337bb581a174","status":"affected","lessThan":"1c8a70075235cd733095532a97f2405037c52a7b","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["Documentation/networking/tls-offload.rst","net/tls/tls_device.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.19","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["Documentation/networking/tls-offload.rst","net/tls/tls_device.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a2b9316a40f20a79e460bf31c4f036c17cc9c512"},{"url":"https://git.kernel.org/stable/c/afd3039627d97a959214d544c660390cf28d6527"},{"url":"https://git.kernel.org/stable/c/d1a31f1523543513da5b285d82598977303011c7"},{"url":"https://git.kernel.org/stable/c/1c8a70075235cd733095532a97f2405037c52a7b"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:32:08.809Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.19","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.19","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.19","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.19","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}