Skip to content
Heist/ feed
Back to feed
UnratedFix available

ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger() bdev->bd_super has been removed and commit 8887b94d9322 change the usage from bdev->bd_super to b_assoc_map->host->i_sb. Since ocfs2 hasn't set bh->b_assoc_map, it will trigger NULL pointer dereference when calling into ocfs2_abort_trigger(). Actually this was pointed out in history, see commit 74e364ad1b13. But I've made a mistake when reviewing commit 8887b94d9322 and then re-introduce this regression. Since we cannot revive bdev in buffer head, so fix this issue by initializing all types of ocfs2 triggers when fill super, and then get the specific ocfs2 trigger from ocfs2_caching_info when access journal. [joseph.qi@linux.alibaba.com: v2]

Products
Kernel
Affected versions
Not specified
Fixed versions
6.6.36, 6.9.7
CVEs
CVE-2024-40951
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 11:03 UTC · Revision 1

Source evidence

ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger()

core-osv · Original source

Published 12 Jul 2024, 12:31 UTC

In the Linux kernel, the following vulnerability has been resolved: ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger() bdev->bd_super has been removed and commit 8887b94d9322 change the usage from bdev->bd_super to b_assoc_map->host->i_sb. Since ocfs2 hasn't set bh->b_assoc_map, it will trigger NULL pointer dereference when calling into ocfs2_abort_trigger(). Actually this was pointed out in history, see commit 74e364ad1b13. But I've made a mistake when reviewing commit 8887b94d9322 and then re-introduce this regression. Since we cannot revive bdev in buffer head, so fix this issue by initializing all types of ocfs2 triggers when fill super, and then get the specific ocfs2 trigger from ocfs2_caching_info when access journal. [joseph.qi@linux.alibaba.com: v2]

osv:CVE-2024-40951

Kernel

Fixed versions: 6.6.36, 6.9.7

Complete source record
{
  "id": "0120ac0ead8ace2d16495c83e04833f50f0fda32091332ba9461516f53a36f6d",
  "url": "https://osv.dev/vulnerability/CVE-2024-40951",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger() bdev->bd_super has been removed and commit 8887b94d9322 change the usage from bdev->bd_super to b_assoc_map->host->i_sb. Since ocfs2 hasn't set bh->b_assoc_map, it will trigger NULL pointer dereference when calling into ocfs2_abort_trigger(). Actually this was pointed out in history, see commit 74e364ad1b13. But I've made a mistake when reviewing commit 8887b94d9322 and then re-introduce this regression. Since we cannot revive bdev in buffer head, so fix this issue by initializing all types of ocfs2 triggers when fill super, and then get the specific ocfs2 trigger from ocfs2_caching_info when access journal. [joseph.qi@linux.alibaba.com: v2]",
    "evidence": "osv:CVE-2024-40951",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.6.36",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.9.7",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-40951",
      "aliases": [
        "CVE-2024-40951"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "8887b94d93224e0ef7e1bc6369640e313b8b12f4"
                },
                {
                  "fixed": "67bcecd780609f471260a8c83fb0ae15f27734ce"
                },
                {
                  "fixed": "eb63357ef229fae061ce7ce2839d558681c42f1a"
                },
                {
                  "fixed": "685d03c3795378fca6a1b3d43581f7f1a3fc095f"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-40951.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.6.0"
                },
                {
                  "fixed": "6.6.36"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.9.7"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-40951.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:43.790676957Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/67bcecd780609f471260a8c83fb0ae15f27734ce",
        "https://git.kernel.org/stable/c/685d03c3795378fca6a1b3d43581f7f1a3fc095f",
        "https://git.kernel.org/stable/c/eb63357ef229fae061ce7ce2839d558681c42f1a",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40951.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-40951",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40951.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-40951",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 511688,
  "published_at": "2024-07-12T12:31:55.493+00:00"
}