Linux: RDMA/efa: Fix PBL chunk length computation
What fixes it
- 665cd418b8561a099c3854443f8ad8ae751b72a0LinuxCVE List
- 932e5684906a090644a9061fae2d254041c3b8f2LinuxCVE List
- 489b28f2377afa70c18c45b06a6387f3d39bb123LinuxCVE List
- 3982714e15512b83115897806dacc94899683420LinuxCVE List
- 1d4b5902773475fc97151379b7e5f09cad0fa57bLinuxCVE List
- 229b42d7450c1cf96f45ec39ebb69211b06bc036LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
RDMA/efa: Fix PBL chunk length computation
On register MR, when creating the PBL, if it's an indirect PBL we create a chunk list to hold the PBL pages pointers. Each chunk is 4KB in size and can hold 510 addresses (EFA_PTRS_PER_CHUNK) and has a 12-byte control buffer at the end of it holding the next chunk's pointer and its length.
If the PBL number of pages is a multiple of EFA_PTRS_PER_CHUNK, the calculated last chunk length is wrongly computed as 0, even though that chunk is fully populated with 510 real page pointers. This wrong length is used both to DMA map the chunk and is propagated to the device, causing the device to see the chunk as empty and reject the memory registration.
Fix the calculation so it will be performed only if the number of pages isn't a multiple of EFA_PTRS_PER_CHUNK, if it is, its already handled in the above loop correctly. Also prevent out-of-bounds reach in the chunks array in such scenario.
Text from CVE List
Affected versions 18
- Linuxaffected: 40909f664d279765af430acc5db348a0b71c9b0a before 665cd418b8561a099c3854443f8ad8ae751b72a0CVE List
- Linuxaffected: 40909f664d279765af430acc5db348a0b71c9b0a before 932e5684906a090644a9061fae2d254041c3b8f2CVE List
- Linuxaffected: 40909f664d279765af430acc5db348a0b71c9b0a before 489b28f2377afa70c18c45b06a6387f3d39bb123CVE List
- Linuxaffected: 40909f664d279765af430acc5db348a0b71c9b0a before aadf3f9b5edb7f0a77e9172b237d2e07c754829cCVE List
- Linuxaffected: 40909f664d279765af430acc5db348a0b71c9b0a before 3982714e15512b83115897806dacc94899683420CVE List
- Linuxaffected: 40909f664d279765af430acc5db348a0b71c9b0a before da7805f0211af19968584e621074f253ac07dba7CVE List
- Linuxaffected: 40909f664d279765af430acc5db348a0b71c9b0a before 1d4b5902773475fc97151379b7e5f09cad0fa57bCVE List
- Linuxaffected: 40909f664d279765af430acc5db348a0b71c9b0a before 229b42d7450c1cf96f45ec39ebb69211b06bc036CVE List
- Linuxaffected: 5.2CVE List
- Linuxunaffected: all versions before 5.2CVE List
- Linuxunaffected: 5.10.270 through 5.10.*CVE List
- Linuxunaffected: 5.15.221 through 5.15.*CVE List
- Linuxunaffected: 6.1.188 through 6.1.*CVE List
- Linuxunaffected: 6.6.157 through 6.6.*CVE List
- Linuxunaffected: 6.12.110 through 6.12.*CVE List
- Linuxunaffected: 6.18.52 through 6.18.*CVE List
- Linuxunaffected: 7.2.6 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 8
- git.kernel.org/stable/c/665cd418b8561a099c3854443f8ad8ae751b72a0Referencevia CVE List
- git.kernel.org/stable/c/932e5684906a090644a9061fae2d254041c3b8f2Referencevia CVE List
- git.kernel.org/stable/c/489b28f2377afa70c18c45b06a6387f3d39bb123Referencevia CVE List
- git.kernel.org/stable/c/aadf3f9b5edb7f0a77e9172b237d2e07c754829cReferencevia CVE List
- git.kernel.org/stable/c/3982714e15512b83115897806dacc94899683420Referencevia CVE List
- git.kernel.org/stable/c/da7805f0211af19968584e621074f253ac07dba7Referencevia CVE List
- git.kernel.org/stable/c/1d4b5902773475fc97151379b7e5f09cad0fa57bReferencevia CVE List
- git.kernel.org/stable/c/229b42d7450c1cf96f45ec39ebb69211b06bc036Referencevia CVE List