{"id":"CVE-2026-139057","summary":"wifi: rtw88: fix out-of-bounds CAM write when key table is full","details":"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 \"\u003e\" 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 \u003e= 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.","modified":"2026-12-01T21:02:36.118037314Z","published":"2026-11-30T13:27:28.132Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139057.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/10030d93efee3ec9088523285109c6549010bbf5"},{"type":"WEB","url":"https://git.kernel.org/stable/c/10d58823cb44681466c022054030b8e68d94ce2f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/16862a9bcd8d9f883b6fd801173eb86a8f4a7b12"},{"type":"WEB","url":"https://git.kernel.org/stable/c/46ff3bfce058bc0d0ac54b1338582ea7985fdd4f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6f03581ef59d18f022186fabd9ffc3fb2aeced81"},{"type":"WEB","url":"https://git.kernel.org/stable/c/7aed0f9c91bcfb449216404a5df44dce825a76e2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/aa26d4a75f2c85e062270bc5e68ce9d495fa12f9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/aa33d8dae0b47d87dc886642a709e1fd41266463"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139057.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139057"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"e3037485c68ec1a299ff41160d8fedbd4abc29b9"},{"fixed":"6f03581ef59d18f022186fabd9ffc3fb2aeced81"},{"fixed":"16862a9bcd8d9f883b6fd801173eb86a8f4a7b12"},{"fixed":"10030d93efee3ec9088523285109c6549010bbf5"},{"fixed":"7aed0f9c91bcfb449216404a5df44dce825a76e2"},{"fixed":"46ff3bfce058bc0d0ac54b1338582ea7985fdd4f"},{"fixed":"aa26d4a75f2c85e062270bc5e68ce9d495fa12f9"},{"fixed":"aa33d8dae0b47d87dc886642a709e1fd41266463"},{"fixed":"10d58823cb44681466c022054030b8e68d94ce2f"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139057.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.2.0"},{"fixed":"5.10.275"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139057.json"}}],"schema_version":"1.9.2"}