In the Linux kernel, the following vulnerability has been resolved:
crypto: cavium - prevent integer overflow loading firmware
The "code_length" value comes from the firmware file. If your firmware is untrusted realistically there is probably very little you can do to protect yourself. Still we try to limit the damage as much as possible. Also Smatch marks any data read from the filesystem as untrusted and prints warnings if it not capped correctly.
The "ntohl(ucode->code_length) * 2" multiplication can have an integer overflow.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c4d4c2afd08dfb3cd1c880d1811ede2568e81a6d",
"target": {
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"line_hashes": [
"311063516257339626812625150320706917609",
"201265304466840281068187275700391479123",
"183041517337868504947021774807438893174",
"6610917772567711922996573342232959094",
"257184073949339074840243999967908480655",
"163075371157444785403599639469583991336",
"238079158727311029052318876905441070700",
"104477222614808439056517572266572146543",
"179300271300130428438306566980795902187",
"12970696667159287950922888963437068018",
"112127506413618836798888533101989580727",
"304615071284056332668616126225933943980"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2022-50330-2074e1d8",
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3a720eb89026c5241b8c4abb33370dc6fb565eee",
"target": {
"function": "cpt_ucode_load_fw",
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"function_hash": "134473807942677396353748494094252094037",
"length": 1861.0
},
"deprecated": false,
"id": "CVE-2022-50330-2807dac3",
"signature_version": "v1",
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172c8a24fc8312cf6b88d3c88469653fdcb1c127",
"target": {
"function": "cpt_ucode_load_fw",
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"function_hash": "134473807942677396353748494094252094037",
"length": 1861.0
},
"deprecated": false,
"id": "CVE-2022-50330-29a82922",
"signature_version": "v1",
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@584561e94260268abe1c83e00d9c205565cb7bc5",
"target": {
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"line_hashes": [
"311063516257339626812625150320706917609",
"201265304466840281068187275700391479123",
"183041517337868504947021774807438893174",
"6610917772567711922996573342232959094",
"257184073949339074840243999967908480655",
"163075371157444785403599639469583991336",
"238079158727311029052318876905441070700",
"104477222614808439056517572266572146543",
"179300271300130428438306566980795902187",
"12970696667159287950922888963437068018",
"112127506413618836798888533101989580727",
"304615071284056332668616126225933943980"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2022-50330-349bfe77",
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e29fd7a6852376d2cfb95ad5d6d3eeff93f815e9",
"target": {
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"line_hashes": [
"311063516257339626812625150320706917609",
"201265304466840281068187275700391479123",
"183041517337868504947021774807438893174",
"6610917772567711922996573342232959094",
"257184073949339074840243999967908480655",
"163075371157444785403599639469583991336",
"238079158727311029052318876905441070700",
"104477222614808439056517572266572146543",
"179300271300130428438306566980795902187",
"12970696667159287950922888963437068018",
"112127506413618836798888533101989580727",
"304615071284056332668616126225933943980"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2022-50330-542c587a",
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@371fa5129af53a79f6dddc90fe5bb0825cbe72a4",
"target": {
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"line_hashes": [
"311063516257339626812625150320706917609",
"201265304466840281068187275700391479123",
"183041517337868504947021774807438893174",
"6610917772567711922996573342232959094",
"257184073949339074840243999967908480655",
"163075371157444785403599639469583991336",
"238079158727311029052318876905441070700",
"104477222614808439056517572266572146543",
"179300271300130428438306566980795902187",
"12970696667159287950922888963437068018",
"112127506413618836798888533101989580727",
"304615071284056332668616126225933943980"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2022-50330-55714a35",
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2526d6bf27d15054bb0778b2f7bc6625fd934905",
"target": {
"function": "cpt_ucode_load_fw",
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"function_hash": "134473807942677396353748494094252094037",
"length": 1861.0
},
"deprecated": false,
"id": "CVE-2022-50330-699600ad",
"signature_version": "v1",
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e29fd7a6852376d2cfb95ad5d6d3eeff93f815e9",
"target": {
"function": "cpt_ucode_load_fw",
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"function_hash": "134473807942677396353748494094252094037",
"length": 1861.0
},
"deprecated": false,
"id": "CVE-2022-50330-816d2f2a",
"signature_version": "v1",
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@90e483e7f20c32287d2a9da967e122938f52737a",
"target": {
"function": "cpt_ucode_load_fw",
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"function_hash": "134473807942677396353748494094252094037",
"length": 1861.0
},
"deprecated": false,
"id": "CVE-2022-50330-a1f08f39",
"signature_version": "v1",
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2526d6bf27d15054bb0778b2f7bc6625fd934905",
"target": {
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"line_hashes": [
"311063516257339626812625150320706917609",
"201265304466840281068187275700391479123",
"183041517337868504947021774807438893174",
"6610917772567711922996573342232959094",
"257184073949339074840243999967908480655",
"163075371157444785403599639469583991336",
"238079158727311029052318876905441070700",
"104477222614808439056517572266572146543",
"179300271300130428438306566980795902187",
"12970696667159287950922888963437068018",
"112127506413618836798888533101989580727",
"304615071284056332668616126225933943980"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2022-50330-aa28440b",
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3a720eb89026c5241b8c4abb33370dc6fb565eee",
"target": {
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"line_hashes": [
"311063516257339626812625150320706917609",
"201265304466840281068187275700391479123",
"183041517337868504947021774807438893174",
"6610917772567711922996573342232959094",
"257184073949339074840243999967908480655",
"163075371157444785403599639469583991336",
"238079158727311029052318876905441070700",
"104477222614808439056517572266572146543",
"179300271300130428438306566980795902187",
"12970696667159287950922888963437068018",
"112127506413618836798888533101989580727",
"304615071284056332668616126225933943980"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2022-50330-acccf534",
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172c8a24fc8312cf6b88d3c88469653fdcb1c127",
"target": {
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"line_hashes": [
"311063516257339626812625150320706917609",
"201265304466840281068187275700391479123",
"183041517337868504947021774807438893174",
"6610917772567711922996573342232959094",
"257184073949339074840243999967908480655",
"163075371157444785403599639469583991336",
"238079158727311029052318876905441070700",
"104477222614808439056517572266572146543",
"179300271300130428438306566980795902187",
"12970696667159287950922888963437068018",
"112127506413618836798888533101989580727",
"304615071284056332668616126225933943980"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2022-50330-b1843345",
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@90e483e7f20c32287d2a9da967e122938f52737a",
"target": {
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"line_hashes": [
"311063516257339626812625150320706917609",
"201265304466840281068187275700391479123",
"183041517337868504947021774807438893174",
"6610917772567711922996573342232959094",
"257184073949339074840243999967908480655",
"163075371157444785403599639469583991336",
"238079158727311029052318876905441070700",
"104477222614808439056517572266572146543",
"179300271300130428438306566980795902187",
"12970696667159287950922888963437068018",
"112127506413618836798888533101989580727",
"304615071284056332668616126225933943980"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2022-50330-d05320cf",
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@371fa5129af53a79f6dddc90fe5bb0825cbe72a4",
"target": {
"function": "cpt_ucode_load_fw",
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"function_hash": "134473807942677396353748494094252094037",
"length": 1861.0
},
"deprecated": false,
"id": "CVE-2022-50330-d9fed330",
"signature_version": "v1",
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@584561e94260268abe1c83e00d9c205565cb7bc5",
"target": {
"function": "cpt_ucode_load_fw",
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"function_hash": "134473807942677396353748494094252094037",
"length": 1861.0
},
"deprecated": false,
"id": "CVE-2022-50330-dd181aa9",
"signature_version": "v1",
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c4d4c2afd08dfb3cd1c880d1811ede2568e81a6d",
"target": {
"function": "cpt_ucode_load_fw",
"file": "drivers/crypto/cavium/cpt/cptpf_main.c"
},
"digest": {
"function_hash": "134473807942677396353748494094252094037",
"length": 1861.0
},
"deprecated": false,
"id": "CVE-2022-50330-f8621fc5",
"signature_version": "v1",
"signature_type": "Function"
}
]