CVE-2024-44976

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-44976
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-44976.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-44976
Downstream
Published
2024-09-04T19:54:28Z
Modified
2025-10-22T01:53:06.288148Z
Summary
ata: pata_macio: Fix DMA table overflow
Details

In the Linux kernel, the following vulnerability has been resolved:

ata: pata_macio: Fix DMA table overflow

Kolbjørn and Jonáš reported that their 32-bit PowerMacs were crashing in pata-macio since commit 09fe2bfa6b83 ("ata: patamacio: Fix maxsegmentsize with PAGESIZE == 64K").

For example:

kernel BUG at drivers/ata/patamacio.c:544! Oops: Exception in kernel mode, sig: 5 [#1] BE PAGESIZE=4K MMU=Hash SMP NRCPUS=2 DEBUGPAGEALLOC PowerMac ... NIP patamacioqcprep+0xf4/0x190 LR patamacioqcprep+0xfc/0x190 Call Trace: 0xc1421660 (unreliable) ataqcissue+0x14c/0x2d4 _atascsiqueuecmd+0x200/0x53c atascsiqueuecmd+0x50/0xe0 scsiqueuerq+0x788/0xb1c _blkmqissuedirectly+0x58/0xf4 blkmqplugissuedirect+0x8c/0x1b4 blkmqflushpluglist.part.0+0x584/0x5e0 _blkflushplug+0xf8/0x194 _submitbio+0x1b8/0x2e0 submitbionoacctnocheck+0x230/0x304 btrfsworkhelper+0x200/0x338 processonework+0x1a8/0x338 workerthread+0x364/0x4c0 kthread+0x100/0x104 startkernelthread+0x10/0x14

That commit increased maxsegmentsize to 64KB, with the justification that the SCSI core was already using that size when PAGE_SIZE == 64KB, and that there was existing logic to split over-sized requests.

However with a sufficiently large request, the splitting logic causes each sg to be split into two commands in the DMA table, leading to overflow of the DMA table, triggering the BUG_ON().

With default settings the bug doesn't trigger, because the request size is limited by maxsectorskb == 1280, however maxsectorskb can be increased, and apparently some distros do that by default using udev rules.

Fix the bug for 4KB kernels by reverting to the old maxsegmentsize.

For 64KB kernels the sg_tablesize needs to be halved, to allow for the possibility that each sg will be split into two.

References

Affected packages

Git / 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
09fe2bfa6b83f865126ce3964744863f69a4a030
Fixed
709e4c8f78e156ab332297bdd87527ec3da4e2d4
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
09fe2bfa6b83f865126ce3964744863f69a4a030
Fixed
822c8020aebcf5804a143b891e34f29873fee5e2

Affected versions

v6.*

v6.10
v6.10-rc2
v6.10-rc3
v6.10-rc4
v6.10-rc5
v6.10-rc6
v6.10-rc7
v6.10.1
v6.10.2
v6.10.3
v6.10.4
v6.10.5
v6.10.6
v6.11-rc1

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.10.0
Fixed
6.10.7