In the Linux kernel, the following vulnerability has been resolved:
rcu: Fix buffer overflow in printcpustall_info()
The rcuc-starvation output from printcpustall_info() might overflow the buffer if there is a huge difference in jiffies difference. The situation might seem improbable, but computers sometimes get very confused about time, which can result in full-sized integers, and, in this case, buffer overflow.
Also, the unsigned jiffies difference is printed using %ld, which is normally for signed integers. This is intentional for debugging purposes, but it is not obvious from the code.
This commit therefore changes sprintf() to snprintf() and adds a clarifying comment about intention of %ld format.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
[
{
"id": "CVE-2024-38576-017f0b7b",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "119821266695481345082631164336231796645",
"length": 1274.0
},
"target": {
"file": "kernel/rcu/tree_stall.h",
"function": "print_cpu_stall_info"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@afb39909bfb5c08111f99e21bf5be7505f59ff1c"
},
{
"id": "CVE-2024-38576-1b3c86d4",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"289249538689078478749354187795664293538",
"60555036253696276911116079937550659046",
"241791305694372706640840807971502196139",
"328703334787751180961120273306966121524"
],
"threshold": 0.9
},
"target": {
"file": "kernel/rcu/tree_stall.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4c3e2ef4d8ddd313c8ce3ac30505940bea8d6257"
},
{
"id": "CVE-2024-38576-1bb08fa5",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "84496070274328566585973860889983272716",
"length": 1253.0
},
"target": {
"file": "kernel/rcu/tree_stall.h",
"function": "print_cpu_stall_info"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e2228ed3fe7aa838fba87c79a76fb1ad9ea47138"
},
{
"id": "CVE-2024-38576-358accfa",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "119821266695481345082631164336231796645",
"length": 1274.0
},
"target": {
"file": "kernel/rcu/tree_stall.h",
"function": "print_cpu_stall_info"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9351e1338539cb7f319ffc1210fa9b2aa27384b5"
},
{
"id": "CVE-2024-38576-5c23cd69",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"289249538689078478749354187795664293538",
"60555036253696276911116079937550659046",
"241791305694372706640840807971502196139",
"328703334787751180961120273306966121524"
],
"threshold": 0.9
},
"target": {
"file": "kernel/rcu/tree_stall.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e2228ed3fe7aa838fba87c79a76fb1ad9ea47138"
},
{
"id": "CVE-2024-38576-5c8a18a3",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"289249538689078478749354187795664293538",
"60555036253696276911116079937550659046",
"241791305694372706640840807971502196139",
"328703334787751180961120273306966121524"
],
"threshold": 0.9
},
"target": {
"file": "kernel/rcu/tree_stall.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@afb39909bfb5c08111f99e21bf5be7505f59ff1c"
},
{
"id": "CVE-2024-38576-5e7aa30b",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "119821266695481345082631164336231796645",
"length": 1274.0
},
"target": {
"file": "kernel/rcu/tree_stall.h",
"function": "print_cpu_stall_info"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3758f7d9917bd7ef0482c4184c0ad673b4c4e069"
},
{
"id": "CVE-2024-38576-9b74c1a4",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"289249538689078478749354187795664293538",
"60555036253696276911116079937550659046",
"241791305694372706640840807971502196139",
"328703334787751180961120273306966121524"
],
"threshold": 0.9
},
"target": {
"file": "kernel/rcu/tree_stall.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9351e1338539cb7f319ffc1210fa9b2aa27384b5"
},
{
"id": "CVE-2024-38576-b024b1f7",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"289249538689078478749354187795664293538",
"60555036253696276911116079937550659046",
"241791305694372706640840807971502196139",
"328703334787751180961120273306966121524"
],
"threshold": 0.9
},
"target": {
"file": "kernel/rcu/tree_stall.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3758f7d9917bd7ef0482c4184c0ad673b4c4e069"
},
{
"id": "CVE-2024-38576-d19500c3",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "119821266695481345082631164336231796645",
"length": 1274.0
},
"target": {
"file": "kernel/rcu/tree_stall.h",
"function": "print_cpu_stall_info"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4c3e2ef4d8ddd313c8ce3ac30505940bea8d6257"
}
]