File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -7441,7 +7441,8 @@ static ssize_t write_raw_marker_to_buffer(struct trace_array *tr,
74417441 ssize_t written ;
74427442 size_t size ;
74437443
7444- size = sizeof (* entry ) + cnt ;
7444+ /* cnt includes both the entry->id and the data behind it. */
7445+ size = struct_size (entry , buf , cnt - sizeof (entry -> id ));
74457446
74467447 buffer = tr -> array_buffer .buffer ;
74477448
@@ -7455,7 +7456,10 @@ static ssize_t write_raw_marker_to_buffer(struct trace_array *tr,
74557456 return - EBADF ;
74567457
74577458 entry = ring_buffer_event_data (event );
7458- memcpy (& entry -> id , buf , cnt );
7459+ unsafe_memcpy (& entry -> id , buf , cnt ,
7460+ "id and content already reserved on ring buffer"
7461+ "'buf' includes the 'id' and the data."
7462+ "'entry' was allocated with cnt from 'id'." );
74597463 written = cnt ;
74607464
74617465 __buffer_unlock_commit (buffer , event );
You can’t perform that action at this time.
0 commit comments