{"id":"CVE-2022-50279","aliases":["CVE-2022-50279"],"related":[],"kind":"vulnerability","state":"published","title":"wifi: rtlwifi: Fix global-out-of-bounds bug in _rtl8812ae_phy_set_txpower_limit()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nwifi: rtlwifi: Fix global-out-of-bounds bug in _rtl8812ae_phy_set_txpower_limit()\n\nThere is a global-out-of-bounds reported by KASAN:\n\n  BUG: KASAN: global-out-of-bounds in\n  _rtl8812ae_eq_n_byte.part.0+0x3d/0x84 [rtl8821ae]\n  Read of size 1 at addr ffffffffa0773c43 by task NetworkManager/411\n\n  CPU: 6 PID: 411 Comm: NetworkManager Tainted: G      D\n  6.1.0-rc8+ #144 e15588508517267d37\n  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009),\n  Call Trace:\n   <TASK>\n   ...\n   kasan_report+0xbb/0x1c0\n   _rtl8812ae_eq_n_byte.part.0+0x3d/0x84 [rtl8821ae]\n   rtl8821ae_phy_bb_config.cold+0x346/0x641 [rtl8821ae]\n   rtl8821ae_hw_init+0x1f5e/0x79b0 [rtl8821ae]\n   ...\n   </TASK>\n\nThe root cause of the problem is that the comparison order of\n\"prate_section\" in _rtl8812ae_phy_set_txpower_limit() is wrong. The\n_rtl8812ae_eq_n_byte() is used to compare the first n bytes of the two\nstrings from tail to head, which causes the problem. In the\n_rtl8812ae_phy_set_txpower_limit(), it was originally intended to meet\nthis requirement by carefully designing the comparison order.\nFor example, \"pregulation\" and \"pbandwidth\" are compared in order of\nlength from small to large, first is 3 and last is 4. However, the\ncomparison order of \"prate_section\" dose not obey such order requirement,\ntherefore when \"prate_section\" is \"HT\", when comparing from tail to head,\nit will lead to access out of bounds in _rtl8812ae_eq_n_byte(). As\nmentioned above, the _rtl8812ae_eq_n_byte() has the same function as\nstrcmp(), so just strcmp() is enough.\n\nFix it by removing _rtl8812ae_eq_n_byte() and use strcmp() barely.\nAlthough it can be fixed by adjusting the comparison order of\n\"prate_section\", this may cause the value of \"rate_section\" to not be\nfrom 0 to 5. In addition, commit \"21e4b0726dc6\" not only moved driver\nfrom staging to regular tree, but also added setting txpower limit\nfunction during the driver config phase, so the problem was introduced\nby this commit.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nwifi: rtlwifi: Fix global-out-of-bounds bug in _rtl8812ae_phy_set_txpower_limit()\n\nThere is a global-out-of-bounds reported by KASAN:\n\n  BUG: KASAN: global-out-of-bounds in\n  _rtl8812ae_eq_n_byte.part.0+0x3d/0x84 [rtl8821ae]\n  Read of size 1 at addr ffffffffa0773c43 by task NetworkManager/411\n\n  CPU: 6 PID: 411 Comm: NetworkManager Tainted: G      D\n  6.1.0-rc8+ #144 e15588508517267d37\n  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009),\n  Call Trace:\n   <TASK>\n   ...\n   kasan_report+0xbb/0x1c0\n   _rtl8812ae_eq_n_byte.part.0+0x3d/0x84 [rtl8821ae]\n   rtl8821ae_phy_bb_config.cold+0x346/0x641 [rtl8821ae]\n   rtl8821ae_hw_init+0x1f5e/0x79b0 [rtl8821ae]\n   ...\n   </TASK>\n\nThe root cause of the problem is that the comparison order of\n\"prate_section\" in _rtl8812ae_phy_set_txpower_limit() is wrong. The\n_rtl8812ae_eq_n_byte() is used to compare the first n bytes of the two\nstrings from tail to head, which causes the problem. In the\n_rtl8812ae_phy_set_txpower_limit(), it was originally intended to meet\nthis requirement by carefully designing the comparison order.\nFor example, \"pregulation\" and \"pbandwidth\" are compared in order of\nlength from small to large, first is 3 and last is 4. However, the\ncomparison order of \"prate_section\" dose not obey such order requirement,\ntherefore when \"prate_section\" is \"HT\", when comparing from tail to head,\nit will lead to access out of bounds in _rtl8812ae_eq_n_byte(). As\nmentioned above, the _rtl8812ae_eq_n_byte() has the same function as\nstrcmp(), so just strcmp() is enough.\n\nFix it by removing _rtl8812ae_eq_n_byte() and use strcmp() barely.\nAlthough it can be fixed by adjusting the comparison order of\n\"prate_section\", this may cause the value of \"rate_section\" to not be\nfrom 0 to 5. In addition, commit \"21e4b0726dc6\" not only moved driver\nfrom staging to regular tree, but also added setting txpower limit\nfunction during the driver config phase, so the problem was introduced\nby this commit.","source":"cvelist"}],"published":"2025-09-15T14:21:16.051Z","modified":"2026-11-05T20:17:31.977Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"type":"git","introduced":"21e4b0726dc671c423e2dc9a85364716219c4502","fixed":"fc3442247716fc426bbcf62ed65e086e48a6d44f","status":"affected"},{"type":"git","introduced":"21e4b0726dc671c423e2dc9a85364716219c4502","fixed":"28ea268d95e57cdf6394a058f0d854206d478772","status":"affected"},{"type":"git","introduced":"21e4b0726dc671c423e2dc9a85364716219c4502","fixed":"1e950b9a841bc96e98ee25680d5c7aa305120be1","status":"affected"},{"type":"git","introduced":"21e4b0726dc671c423e2dc9a85364716219c4502","fixed":"0c962dcd6bf64b78eaffc09e497a2beb4e48bc32","status":"affected"},{"type":"git","introduced":"21e4b0726dc671c423e2dc9a85364716219c4502","fixed":"f1fe40120de6ad4ffa8299fde035a5feba10d4fb","status":"affected"},{"type":"git","introduced":"21e4b0726dc671c423e2dc9a85364716219c4502","fixed":"057b52461dc005ecd85a3e4998913b1492ec0f72","status":"affected"},{"type":"git","introduced":"21e4b0726dc671c423e2dc9a85364716219c4502","fixed":"117dbeda22ec5ea0918254d03b540ef8b8a64d53","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.18","status":"unaffected"},{"type":"semver","introduced":"4.19.276","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.235","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.173","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.99","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.16","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.2.3","lastAffected":"6.2.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.3","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"3.18","fixed":"4.19.276"},{"status":"affected","introduced":"4.20","fixed":"5.4.235"},{"status":"affected","introduced":"5.5","fixed":"5.10.173"},{"status":"affected","introduced":"5.11","fixed":"5.15.99"},{"status":"affected","introduced":"5.16","fixed":"6.1.16"},{"status":"affected","introduced":"6.2","fixed":"6.2.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/fc3442247716fc426bbcf62ed65e086e48a6d44f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/28ea268d95e57cdf6394a058f0d854206d478772","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1e950b9a841bc96e98ee25680d5c7aa305120be1","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0c962dcd6bf64b78eaffc09e497a2beb4e48bc32","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f1fe40120de6ad4ffa8299fde035a5feba10d4fb","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/057b52461dc005ecd85a3e4998913b1492ec0f72","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/117dbeda22ec5ea0918254d03b540ef8b8a64d53","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T20:08:47.709Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-50279","url":"https://www.cve.org/CVERecord?id=CVE-2022-50279","licence":"CVE Terms of Use","modified":"2026-11-05T20:10:32.737Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-50279","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50279","licence":"Public domain","modified":"2026-11-05T20:17:31.977Z"}],"updatedAt":"2026-11-25T22:58:21.144Z","epss":{"score":0.00171,"percentile":0.06783,"date":"2026-12-01T12:00:22.000Z"}}