tracing/histogram: Do not copy the fixed-size char array field over the field size
A message that is not in the archive (sent off-list or not yet received): 163673292822.195747.3696966210526410250.stgit@devnote2
A message that is not in the archive (sent off-list or not yet received): 20211116175359.GA2126@kbox
A message that is not in the archive (sent off-list or not yet received): [email protected]
[ Resending to linux-kernel instead of ilinux-kernel ]
Quoted 34 lines · On Tue, 16 Nov 2021 13:34:31 -0500 Steven Rostedt <[email protected]> wrote:
Quoted 9 lines · On Tue, 16 Nov 2021 09:53:59 -0800 Beau Belgrave <[email protected]>…
Review static inline void __update_field_vars(struct tracing_map_elt *elt, · line 3029
Quoted 6 lines
(quoted diff) +1
-1@@ -3025,7 +3026,7 @@ static inline void __update_field_vars(struct tracing_map_elt *elt, char *str = elt_data->field_var_str[j++]; char *val_str = (char *)(uintptr_t)var_val; - strscpy(str, val_str, STR_VAR_LEN_MAX); + strscpy(str, val_str, val->size);Is it possible for
val->sizeto be larger thanSTR_VAR_LEN_MAX?field_var_stris alloc'd to be the size ofSTR_VAR_LEN_MAX(256).Yes.
;-)
-- Steve
Quoted 12 lines
Review static void hist_trigger_elt_update(struct hist_trigger_data *hist_data, · line 4924
Quoted 10 lines
(quoted diff) +1
-1var_val = (u64)(uintptr_t)str; } tracing_map_set_var(elt, var_idx, var_val);@@ -4920,7 +4921,7 @@ static void hist_trigger_elt_update(struct hist_trigger_data *hist_data, str = elt_data->field_var_str[idx]; val_str = (char *)(uintptr_t)hist_val; - strscpy(str, val_str, STR_VAR_LEN_MAX); + strscpy(str, val_str, hist_field->size);Same as above.