{
   "containers": {
      "cna": {
         "providerMetadata": {
            "orgId": "f4215fc3-5b6b-47ff-a258-f7189bd81038"
         },
         "descriptions": [
            {
               "lang": "en",
               "value": "In the Linux kernel, the following vulnerability has been resolved:\n\npstore: ram_core: fix possible overflow in persistent_ram_init_ecc()\n\nIn persistent_ram_init_ecc(), on 64-bit arches DIV_ROUND_UP() will return\n64-bit value since persistent_ram_zone::buffer_size has type size_t which\nis derived from the 64-bit *unsigned long*, while the ecc_blocks variable\nthis value gets assigned to has (always 32-bit) *int* type.  Even if that\nvalue fits into *int* type, an overflow is still possible when calculating\nthe size_t typed ecc_total variable further below since there's no cast to\nany 64-bit type before multiplication.  Declaring the ecc_blocks variable\nas *size_t* should fix this mess...\n\nFound by Linux Verification Center (linuxtesting.org) with the SVACE static\nanalysis tool."
            }
         ],
         "affected": [
            {
               "product": "Linux",
               "vendor": "Linux",
               "defaultStatus": "unaffected",
               "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               "programFiles": [
                  "fs/pstore/ram_core.c"
               ],
               "versions": [
                  {
                     "version": "9cc05ad97c57",
                     "lessThan": "3b333cded94f",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "9cc05ad97c57",
                     "lessThan": "d1fe1aede684",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "9cc05ad97c57",
                     "lessThan": "acd413da3e1f",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "9cc05ad97c57",
                     "lessThan": "8fb12524c86b",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "9cc05ad97c57",
                     "lessThan": "48dcfc42ce70",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "9cc05ad97c57",
                     "lessThan": "a34946ec3de8",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "9cc05ad97c57",
                     "lessThan": "f9b891a7e8fc",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "9cc05ad97c57",
                     "lessThan": "86222a8fc16e",
                     "status": "affected",
                     "versionType": "git"
                  }
               ]
            },
            {
               "product": "Linux",
               "vendor": "Linux",
               "defaultStatus": "affected",
               "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               "programFiles": [
                  "fs/pstore/ram_core.c"
               ],
               "versions": [
                  {
                     "version": "3.4",
                     "status": "affected"
                  },
                  {
                     "version": "0",
                     "lessThan": "3.4",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "4.19.306",
                     "lessThanOrEqual": "4.19.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "5.4.268",
                     "lessThanOrEqual": "5.4.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "5.10.209",
                     "lessThanOrEqual": "5.10.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "5.15.148",
                     "lessThanOrEqual": "5.15.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.1.75",
                     "lessThanOrEqual": "6.1.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.6.14",
                     "lessThanOrEqual": "6.6.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.7.2",
                     "lessThanOrEqual": "6.7.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.8",
                     "lessThanOrEqual": "*",
                     "status": "unaffected",
                     "versionType": "original_commit_for_fix"
                  }
               ]
            }
         ],
         "references": [
            {
               "url": "https://git.kernel.org/stable/c/3b333cded94fbe5ce30d699b316c4715151268ae"
            },
            {
               "url": "https://git.kernel.org/stable/c/d1fe1aede684bd014714dacfdc75586a9ad38657"
            },
            {
               "url": "https://git.kernel.org/stable/c/acd413da3e1f37582207cd6078a41d57c9011918"
            },
            {
               "url": "https://git.kernel.org/stable/c/8fb12524c86bdd542a54857d5d076b1b6778c78c"
            },
            {
               "url": "https://git.kernel.org/stable/c/48dcfc42ce705b652c0619cb99846afc43029de9"
            },
            {
               "url": "https://git.kernel.org/stable/c/a34946ec3de88a16cc3a87fdab50aad06255a22b"
            },
            {
               "url": "https://git.kernel.org/stable/c/f9b891a7e8fcf83901f8507241e23e7420103b61"
            },
            {
               "url": "https://git.kernel.org/stable/c/86222a8fc16ec517de8da2604d904c9df3a08e5d"
            }
         ],
         "title": "pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()",
         "x_generator": {
            "engine": "bippy-a5840b7849dd"
         }
      }
   },
   "cveMetadata": {
      "assignerOrgId": "f4215fc3-5b6b-47ff-a258-f7189bd81038",
      "cveID": "CVE-2023-52685",
      "requesterUserId": "gregkh@kernel.org",
      "serial": "1",
      "state": "PUBLISHED"
   },
   "dataType": "CVE_RECORD",
   "dataVersion": "5.0"
}
