Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F39111E6DFD for ; Wed, 4 Sep 2024 19:57:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725479849; cv=none; b=sy/enwkm23xBANLJeFg1AAkqHvcVMGQaQE9acpbUDZkfY5zX1hIm3W5QFhvOBQrRfK1mtDNYNPthdliE3ltTjCflxhlEy2c3iIVlbsJnA8pg22w46sgGweCEZbBqTVN4121IoXed9N6q4R+Pr/ml7MzDmSjD0oVIunvDI65Fe0I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725479849; c=relaxed/simple; bh=DWobpGhlRBs2xv2Th97ItRkzf829JM1gEkuMKY7kGuM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=AETCUMmXWB9B4E8aZrzxzjslElFV8ACVtPoJ9rQdlJh3H2Nu0A6QcwnobZfCd/SKfFG300754PYD15v3MAC0x1WEe4vq283tKuMq8XTPjV4GKJuDPIblbVWfK65U7le3ZDPVaSySs5Tel4OemFRimVIlk3sjGSO+7E6EWUp3LE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cAf7bUYN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cAf7bUYN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21421C4CEC2; Wed, 4 Sep 2024 19:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725479848; bh=DWobpGhlRBs2xv2Th97ItRkzf829JM1gEkuMKY7kGuM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=cAf7bUYNMWwMrPWTxcdd9gF2nQmIgEN9/uCefLP9jCj6C5sX7GkF8VyzchxaYZGux aeIaT4A1bu5BPyUIrEoQE0g0BXnWPQDGerkPmzG3A3Fw4as9sBJt6I6JfpFfXl7Q7M 0ZJBOsjVRWJsvPMKZs48SC6+Y0gz84zWZfTp1Bj8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-44976: ata: pata_macio: Fix DMA table overflow Date: Wed, 4 Sep 2024 21:56:41 +0200 Message-ID: <2024090442-CVE-2024-44976-0775@gregkh> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3470; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=DWobpGhlRBs2xv2Th97ItRkzf829JM1gEkuMKY7kGuM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk3dlftnac/dWLM77zc6R6zboqzzivP+OP49/X+xRmZU 74mMAk1dcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE7JgYFjRo31IPf/kqsW9v T0SSi+4ll9AWZYb5ri+irZIFpU3vGNzReMC0y/tA8/5tAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description =========== 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: pata_macio: Fix max_segment_size with PAGE_SIZE == 64K"). For example: kernel BUG at drivers/ata/pata_macio.c:544! Oops: Exception in kernel mode, sig: 5 [#1] BE PAGE_SIZE=4K MMU=Hash SMP NR_CPUS=2 DEBUG_PAGEALLOC PowerMac ... NIP pata_macio_qc_prep+0xf4/0x190 LR pata_macio_qc_prep+0xfc/0x190 Call Trace: 0xc1421660 (unreliable) ata_qc_issue+0x14c/0x2d4 __ata_scsi_queuecmd+0x200/0x53c ata_scsi_queuecmd+0x50/0xe0 scsi_queue_rq+0x788/0xb1c __blk_mq_issue_directly+0x58/0xf4 blk_mq_plug_issue_direct+0x8c/0x1b4 blk_mq_flush_plug_list.part.0+0x584/0x5e0 __blk_flush_plug+0xf8/0x194 __submit_bio+0x1b8/0x2e0 submit_bio_noacct_nocheck+0x230/0x304 btrfs_work_helper+0x200/0x338 process_one_work+0x1a8/0x338 worker_thread+0x364/0x4c0 kthread+0x100/0x104 start_kernel_thread+0x10/0x14 That commit increased max_segment_size 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 max_sectors_kb == 1280, however max_sectors_kb 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 max_segment_size. For 64KB kernels the sg_tablesize needs to be halved, to allow for the possibility that each sg will be split into two. The Linux kernel CVE team has assigned CVE-2024-44976 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 09fe2bfa6b83 and fixed in 6.10.7 with commit 709e4c8f78e1 Issue introduced in 6.10 with commit 09fe2bfa6b83 and fixed in 6.11-rc5 with commit 822c8020aebc Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-44976 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/ata/pata_macio.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/709e4c8f78e156ab332297bdd87527ec3da4e2d4 https://git.kernel.org/stable/c/822c8020aebcf5804a143b891e34f29873fee5e2