CVE-2022-50277 (GCVE-0-2022-50277)
Vulnerability from cvelistv5
Published
2025-09-15 14:21
Modified
2025-09-15 14:21
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: ext4: don't allow journal inode to have encrypt flag Mounting a filesystem whose journal inode has the encrypt flag causes a NULL dereference in fscrypt_limit_io_blocks() when the 'inlinecrypt' mount option is used. The problem is that when jbd2_journal_init_inode() calls bmap(), it eventually finds its way into ext4_iomap_begin(), which calls fscrypt_limit_io_blocks(). fscrypt_limit_io_blocks() requires that if the inode is encrypted, then its encryption key must already be set up. That's not the case here, since the journal inode is never "opened" like a normal file would be. Hence the crash. A reproducer is: mkfs.ext4 -F /dev/vdb debugfs -w /dev/vdb -R "set_inode_field <8> flags 0x80808" mount /dev/vdb /mnt -o inlinecrypt To fix this, make ext4 consider journal inodes with the encrypt flag to be invalid. (Note, maybe other flags should be rejected on the journal inode too. For now, this is just the minimal fix for the above issue.) I've marked this as fixing the commit that introduced the call to fscrypt_limit_io_blocks(), since that's what made an actual crash start being possible. But this fix could be applied to any version of ext4 that supports the encrypt feature.
Impacted products
Vendor Product Version
Linux Linux Version: 38ea50daa7a447dbcd7031f37a39a1baa163b2ab
Version: 38ea50daa7a447dbcd7031f37a39a1baa163b2ab
Version: 38ea50daa7a447dbcd7031f37a39a1baa163b2ab
Create a notification for this product.
   Linux Linux Version: 5.18
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/ext4/super.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "1f7a6626f611aa06d7907aa45b484708dd5ac8bc",
              "status": "affected",
              "version": "38ea50daa7a447dbcd7031f37a39a1baa163b2ab",
              "versionType": "git"
            },
            {
              "lessThan": "bcc5057e1781a3ee889225480d995c3b5cbde555",
              "status": "affected",
              "version": "38ea50daa7a447dbcd7031f37a39a1baa163b2ab",
              "versionType": "git"
            },
            {
              "lessThan": "105c78e12468413e426625831faa7db4284e1fec",
              "status": "affected",
              "version": "38ea50daa7a447dbcd7031f37a39a1baa163b2ab",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/ext4/super.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.18"
            },
            {
              "lessThan": "5.18",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.0.*",
              "status": "unaffected",
              "version": "6.0.18",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.2",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0.18",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.4",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.2",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\next4: don\u0027t allow journal inode to have encrypt flag\n\nMounting a filesystem whose journal inode has the encrypt flag causes a\nNULL dereference in fscrypt_limit_io_blocks() when the \u0027inlinecrypt\u0027\nmount option is used.\n\nThe problem is that when jbd2_journal_init_inode() calls bmap(), it\neventually finds its way into ext4_iomap_begin(), which calls\nfscrypt_limit_io_blocks().  fscrypt_limit_io_blocks() requires that if\nthe inode is encrypted, then its encryption key must already be set up.\nThat\u0027s not the case here, since the journal inode is never \"opened\" like\na normal file would be.  Hence the crash.\n\nA reproducer is:\n\n    mkfs.ext4 -F /dev/vdb\n    debugfs -w /dev/vdb -R \"set_inode_field \u003c8\u003e flags 0x80808\"\n    mount /dev/vdb /mnt -o inlinecrypt\n\nTo fix this, make ext4 consider journal inodes with the encrypt flag to\nbe invalid.  (Note, maybe other flags should be rejected on the journal\ninode too.  For now, this is just the minimal fix for the above issue.)\n\nI\u0027ve marked this as fixing the commit that introduced the call to\nfscrypt_limit_io_blocks(), since that\u0027s what made an actual crash start\nbeing possible.  But this fix could be applied to any version of ext4\nthat supports the encrypt feature."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-09-15T14:21:14.381Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/1f7a6626f611aa06d7907aa45b484708dd5ac8bc"
        },
        {
          "url": "https://git.kernel.org/stable/c/bcc5057e1781a3ee889225480d995c3b5cbde555"
        },
        {
          "url": "https://git.kernel.org/stable/c/105c78e12468413e426625831faa7db4284e1fec"
        }
      ],
      "title": "ext4: don\u0027t allow journal inode to have encrypt flag",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50277",
    "datePublished": "2025-09-15T14:21:14.381Z",
    "dateReserved": "2025-09-15T13:58:00.976Z",
    "dateUpdated": "2025-09-15T14:21:14.381Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-50277\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-09-15T15:15:38.700\",\"lastModified\":\"2025-09-15T15:22:27.090\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\next4: don\u0027t allow journal inode to have encrypt flag\\n\\nMounting a filesystem whose journal inode has the encrypt flag causes a\\nNULL dereference in fscrypt_limit_io_blocks() when the \u0027inlinecrypt\u0027\\nmount option is used.\\n\\nThe problem is that when jbd2_journal_init_inode() calls bmap(), it\\neventually finds its way into ext4_iomap_begin(), which calls\\nfscrypt_limit_io_blocks().  fscrypt_limit_io_blocks() requires that if\\nthe inode is encrypted, then its encryption key must already be set up.\\nThat\u0027s not the case here, since the journal inode is never \\\"opened\\\" like\\na normal file would be.  Hence the crash.\\n\\nA reproducer is:\\n\\n    mkfs.ext4 -F /dev/vdb\\n    debugfs -w /dev/vdb -R \\\"set_inode_field \u003c8\u003e flags 0x80808\\\"\\n    mount /dev/vdb /mnt -o inlinecrypt\\n\\nTo fix this, make ext4 consider journal inodes with the encrypt flag to\\nbe invalid.  (Note, maybe other flags should be rejected on the journal\\ninode too.  For now, this is just the minimal fix for the above issue.)\\n\\nI\u0027ve marked this as fixing the commit that introduced the call to\\nfscrypt_limit_io_blocks(), since that\u0027s what made an actual crash start\\nbeing possible.  But this fix could be applied to any version of ext4\\nthat supports the encrypt feature.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/105c78e12468413e426625831faa7db4284e1fec\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/1f7a6626f611aa06d7907aa45b484708dd5ac8bc\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/bcc5057e1781a3ee889225480d995c3b5cbde555\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…