In the Linux kernel, the following vulnerability has been resolved:
of: module: add buffer overflow check in of_modalias()
In of_modalias(), if the buffer happens to be too small even for the 1st snprintf() call, the len parameter will become negative and str parameter (if not NULL initially) will point beyond the buffer's end. Add the buffer overflow check after the 1st snprintf() call and fix such check after the strlen() call (accounting for the terminating NUL char).
[
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"330281670445633889024466838934785215793",
"247395856484531036520084492672959302153",
"318598317928663578269521698771744367991",
"307862350750515173839830562078111715444",
"82894149695029133382163192914181266805",
"326826571168493258698708228956075368968",
"333548023812733567117851241139945645086",
"164756643968509887650944104636514460667",
"135709324436755456456754488916475526943",
"119643930086504987103826875371510072705",
"146276567494813374477205059904893201068"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@733e62786bdf1b2b9dbb09ba2246313306503414",
"target": {
"file": "drivers/of/device.c"
},
"id": "CVE-2024-38541-0acff997"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"60582406631466747549884099479839047726",
"127151511293961273041774489761740126979",
"146570684452168274024718103025677686568",
"307862350750515173839830562078111715444",
"84408760198917687986937725657858629230",
"269146518266106504377099298903032800875",
"315214186122163442399083096320536750598",
"139417915802106992296172443622508211839",
"135709324436755456456754488916475526943",
"119643930086504987103826875371510072705",
"146276567494813374477205059904893201068"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0b0d5701a8bf02f8fee037e81aacf6746558bfd6",
"target": {
"file": "drivers/of/module.c"
},
"id": "CVE-2024-38541-17f817fd"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 674.0,
"function_hash": "10298338827386272717844607135637102142"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e45b69360a63165377b30db4a1dfddd89ca18e9a",
"target": {
"file": "drivers/of/module.c",
"function": "of_modalias"
},
"id": "CVE-2024-38541-2912871d"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"60582406631466747549884099479839047726",
"127151511293961273041774489761740126979",
"146570684452168274024718103025677686568",
"307862350750515173839830562078111715444",
"84408760198917687986937725657858629230",
"269146518266106504377099298903032800875",
"315214186122163442399083096320536750598",
"139417915802106992296172443622508211839",
"135709324436755456456754488916475526943",
"119643930086504987103826875371510072705",
"146276567494813374477205059904893201068"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e45b69360a63165377b30db4a1dfddd89ca18e9a",
"target": {
"file": "drivers/of/module.c"
},
"id": "CVE-2024-38541-3f1ac5bd"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"330281670445633889024466838934785215793",
"247395856484531036520084492672959302153",
"318598317928663578269521698771744367991",
"307862350750515173839830562078111715444",
"82894149695029133382163192914181266805",
"326826571168493258698708228956075368968",
"333548023812733567117851241139945645086",
"164756643968509887650944104636514460667",
"135709324436755456456754488916475526943",
"119643930086504987103826875371510072705",
"146276567494813374477205059904893201068"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d59fd637a8af42b211a92b2edb2474325b4d488",
"target": {
"file": "drivers/of/device.c"
},
"id": "CVE-2024-38541-59823b5f"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 611.0,
"function_hash": "79722615483041881603629778213368311301"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cf7385cb26ac4f0ee6c7385960525ad534323252",
"target": {
"file": "drivers/of/module.c",
"function": "of_modalias"
},
"id": "CVE-2024-38541-692c0117"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 708.0,
"function_hash": "164908358253602838398160929120024669896"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d59fd637a8af42b211a92b2edb2474325b4d488",
"target": {
"file": "drivers/of/device.c",
"function": "of_device_get_modalias"
},
"id": "CVE-2024-38541-7a1e3d64"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 674.0,
"function_hash": "10298338827386272717844607135637102142"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0b0d5701a8bf02f8fee037e81aacf6746558bfd6",
"target": {
"file": "drivers/of/module.c",
"function": "of_modalias"
},
"id": "CVE-2024-38541-8a3b174f"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 708.0,
"function_hash": "164908358253602838398160929120024669896"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@733e62786bdf1b2b9dbb09ba2246313306503414",
"target": {
"file": "drivers/of/device.c",
"function": "of_device_get_modalias"
},
"id": "CVE-2024-38541-9d5db9e0"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 674.0,
"function_hash": "10298338827386272717844607135637102142"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ee332023adfd5882808f2dabf037b32d6ce36f9e",
"target": {
"file": "drivers/of/module.c",
"function": "of_modalias"
},
"id": "CVE-2024-38541-9fb91e1f"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 708.0,
"function_hash": "164908358253602838398160929120024669896"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c7f24b7d94549ff4623e8f41ea4d9f5319bd8ac8",
"target": {
"file": "drivers/of/device.c",
"function": "of_device_get_modalias"
},
"id": "CVE-2024-38541-c4dc7e28"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"330281670445633889024466838934785215793",
"247395856484531036520084492672959302153",
"318598317928663578269521698771744367991",
"307862350750515173839830562078111715444",
"82894149695029133382163192914181266805",
"326826571168493258698708228956075368968",
"333548023812733567117851241139945645086",
"164756643968509887650944104636514460667",
"135709324436755456456754488916475526943",
"119643930086504987103826875371510072705",
"146276567494813374477205059904893201068"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c7f24b7d94549ff4623e8f41ea4d9f5319bd8ac8",
"target": {
"file": "drivers/of/device.c"
},
"id": "CVE-2024-38541-fa7bfd7d"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"43344045917278489596283999290836121658",
"127151511293961273041774489761740126979",
"146570684452168274024718103025677686568",
"307862350750515173839830562078111715444",
"84408760198917687986937725657858629230",
"269146518266106504377099298903032800875",
"315214186122163442399083096320536750598",
"139417915802106992296172443622508211839",
"135709324436755456456754488916475526943",
"119643930086504987103826875371510072705",
"146276567494813374477205059904893201068"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cf7385cb26ac4f0ee6c7385960525ad534323252",
"target": {
"file": "drivers/of/module.c"
},
"id": "CVE-2024-38541-faf6c659"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"60582406631466747549884099479839047726",
"127151511293961273041774489761740126979",
"146570684452168274024718103025677686568",
"307862350750515173839830562078111715444",
"84408760198917687986937725657858629230",
"269146518266106504377099298903032800875",
"315214186122163442399083096320536750598",
"139417915802106992296172443622508211839",
"135709324436755456456754488916475526943",
"119643930086504987103826875371510072705",
"146276567494813374477205059904893201068"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ee332023adfd5882808f2dabf037b32d6ce36f9e",
"target": {
"file": "drivers/of/module.c"
},
"id": "CVE-2024-38541-fc4ee8ec"
}
]