CVE-2024-57930
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
21/01/2025
Last modified:
21/01/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
tracing: Have process_string() also allow arrays<br />
<br />
In order to catch a common bug where a TRACE_EVENT() TP_fast_assign()<br />
assigns an address of an allocated string to the ring buffer and then<br />
references it in TP_printk(), which can be executed hours later when the<br />
string is free, the function test_event_printk() runs on all events as<br />
they are registered to make sure there&#39;s no unwanted dereferencing.<br />
<br />
It calls process_string() to handle cases in TP_printk() format that has<br />
"%s". It returns whether or not the string is safe. But it can have some<br />
false positives.<br />
<br />
For instance, xe_bo_move() has:<br />
<br />
TP_printk("move_lacks_source:%s, migrate object %p [size %zu] from %s to %s device_id:%s",<br />
__entry->move_lacks_source ? "yes" : "no", __entry->bo, __entry->size,<br />
xe_mem_type_to_name[__entry->old_placement],<br />
xe_mem_type_to_name[__entry->new_placement], __get_str(device_id))<br />
<br />
Where the "%s" references into xe_mem_type_to_name[]. This is an array of<br />
pointers that should be safe for the event to access. Instead of flagging<br />
this as a bad reference, if a reference points to an array, where the<br />
record field is the index, consider it safe.
Impact
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/3bcdc9039a6e9e6e47ed689a37b8d57894a3c571
- https://git.kernel.org/stable/c/631b1e09e213c86d5a4ce23d45c81af473bb0ac7
- https://git.kernel.org/stable/c/92bd18c74624e5eb9f96e70076aa46293f4b626f
- https://git.kernel.org/stable/c/a64e5295ebc4afdefe69cdf16cc286a60ff8ba4b
- https://git.kernel.org/stable/c/afc6717628f959941d7b33728570568b4af1c4b8