{"id":"CVE-2026-139057","state":"PUBLISHED","title":"wifi: rtw88: fix out-of-bounds CAM write when key table is full","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nwifi: rtw88: fix out-of-bounds CAM write when key table is full\n\nIn rtw_ops_set_key(), when the CAM table is full,\nrtw_sec_get_free_cam() returns RTW_MAX_SEC_CAM_NUM (32) because\nfind_next_zero_bit()/find_first_zero_bit() return the bitmap size\nwhen no free slot exists. The bounds check compares the returned\nindex with \">\" against total_cam_num (32), so the invalid index 32\npasses the check.\n\nrtw_sec_write_cam() then indexes cam_table[32], an array declared\nwith RTW_MAX_SEC_CAM_NUM (32) entries, causing an out-of-bounds\nwrite that corrupts the cam_map allocation bitmap. The write also\nsets bit 32 of cam_map, which overruns the bitmap as well.\n\nFix the off-by-one by rejecting indices >= total_cam_num.\n\nTested on: RTL8821CE (PCIe) on kernel\n7.2.0-rc6-rtw88test-00059-g0d8395707651. The patched module loaded\nand associated to a WPA2 network; ping traffic passed with 0% packet\nloss. Reassociation and disconnect/reconnect cycles completed\nwithout errors, and the CAM table (debugfs dump_cam) showed valid\nkey entries. The CAM-full boundary (28+ pairwise keys) requires an\naccess point with 28+ clients and is not reachable in a\nsingle-client setup, so that path was verified by code inspection.","publishedAt":"2026-11-30T13:27:28.132Z","updatedAt":"2026-11-30T13:27:28.132Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"6f03581ef59d18f022186fabd9ffc3fb2aeced81","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"16862a9bcd8d9f883b6fd801173eb86a8f4a7b12","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"10030d93efee3ec9088523285109c6549010bbf5","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"7aed0f9c91bcfb449216404a5df44dce825a76e2","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"46ff3bfce058bc0d0ac54b1338582ea7985fdd4f","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"aa26d4a75f2c85e062270bc5e68ce9d495fa12f9","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"aa33d8dae0b47d87dc886642a709e1fd41266463","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"10d58823cb44681466c022054030b8e68d94ce2f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/wireless/realtek/rtw88/mac80211.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.2","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.63","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.4","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":["drivers/net/wireless/realtek/rtw88/mac80211.c"]}],"references":["https://git.kernel.org/stable/c/6f03581ef59d18f022186fabd9ffc3fb2aeced81","https://git.kernel.org/stable/c/16862a9bcd8d9f883b6fd801173eb86a8f4a7b12","https://git.kernel.org/stable/c/10030d93efee3ec9088523285109c6549010bbf5","https://git.kernel.org/stable/c/7aed0f9c91bcfb449216404a5df44dce825a76e2","https://git.kernel.org/stable/c/46ff3bfce058bc0d0ac54b1338582ea7985fdd4f","https://git.kernel.org/stable/c/aa26d4a75f2c85e062270bc5e68ce9d495fa12f9","https://git.kernel.org/stable/c/aa33d8dae0b47d87dc886642a709e1fd41266463","https://git.kernel.org/stable/c/10d58823cb44681466c022054030b8e68d94ce2f"],"weaknesses":[],"ingestedAt":"2026-11-30T13:42:04.437Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139057.json","commit":"5317bbbde1916a58cb1fadabb726eb126daf44c1","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139057","state":"PUBLISHED","datePublished":"2026-11-30T13:27:28.132Z","dateUpdated":"2026-11-30T13:27:28.132Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.911Z"},"containers":{"cna":{"title":"wifi: rtw88: fix out-of-bounds CAM write when key table is full","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nwifi: rtw88: fix out-of-bounds CAM write when key table is full\n\nIn rtw_ops_set_key(), when the CAM table is full,\nrtw_sec_get_free_cam() returns RTW_MAX_SEC_CAM_NUM (32) because\nfind_next_zero_bit()/find_first_zero_bit() return the bitmap size\nwhen no free slot exists. The bounds check compares the returned\nindex with \">\" against total_cam_num (32), so the invalid index 32\npasses the check.\n\nrtw_sec_write_cam() then indexes cam_table[32], an array declared\nwith RTW_MAX_SEC_CAM_NUM (32) entries, causing an out-of-bounds\nwrite that corrupts the cam_map allocation bitmap. The write also\nsets bit 32 of cam_map, which overruns the bitmap as well.\n\nFix the off-by-one by rejecting indices >= total_cam_num.\n\nTested on: RTL8821CE (PCIe) on kernel\n7.2.0-rc6-rtw88test-00059-g0d8395707651. The patched module loaded\nand associated to a WPA2 network; ping traffic passed with 0% packet\nloss. Reassociation and disconnect/reconnect cycles completed\nwithout errors, and the CAM table (debugfs dump_cam) showed valid\nkey entries. The CAM-full boundary (28+ pairwise keys) requires an\naccess point with 28+ clients and is not reachable in a\nsingle-client setup, so that path was verified by code inspection."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"6f03581ef59d18f022186fabd9ffc3fb2aeced81","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"16862a9bcd8d9f883b6fd801173eb86a8f4a7b12","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"10030d93efee3ec9088523285109c6549010bbf5","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"7aed0f9c91bcfb449216404a5df44dce825a76e2","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"46ff3bfce058bc0d0ac54b1338582ea7985fdd4f","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"aa26d4a75f2c85e062270bc5e68ce9d495fa12f9","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"aa33d8dae0b47d87dc886642a709e1fd41266463","versionType":"git"},{"version":"e3037485c68ec1a299ff41160d8fedbd4abc29b9","status":"affected","lessThan":"10d58823cb44681466c022054030b8e68d94ce2f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/wireless/realtek/rtw88/mac80211.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.2","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.63","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.4","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":["drivers/net/wireless/realtek/rtw88/mac80211.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/6f03581ef59d18f022186fabd9ffc3fb2aeced81"},{"url":"https://git.kernel.org/stable/c/16862a9bcd8d9f883b6fd801173eb86a8f4a7b12"},{"url":"https://git.kernel.org/stable/c/10030d93efee3ec9088523285109c6549010bbf5"},{"url":"https://git.kernel.org/stable/c/7aed0f9c91bcfb449216404a5df44dce825a76e2"},{"url":"https://git.kernel.org/stable/c/46ff3bfce058bc0d0ac54b1338582ea7985fdd4f"},{"url":"https://git.kernel.org/stable/c/aa26d4a75f2c85e062270bc5e68ce9d495fa12f9"},{"url":"https://git.kernel.org/stable/c/aa33d8dae0b47d87dc886642a709e1fd41266463"},{"url":"https://git.kernel.org/stable/c/10d58823cb44681466c022054030b8e68d94ce2f"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:27:28.132Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"5.10.275"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"6.18.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}