Re: [PATCH v4 23/23] trace-cmd: Read at least 8 bytes trace-id option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 25 Mar 2021 08:40:55 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> When reading the trace-id option from trace.dat file, check if the size
> is at least 8 bytes. If the size is greater, use the first 8 bytes only
> and ignore the rest. That way we can safely extend this option in the
> future, without breaking the legacy logic.
> 
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
> ---
>  lib/trace-cmd/trace-input.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
> index 513f6cc3..c0b47345 100644
> --- a/lib/trace-cmd/trace-input.c
> +++ b/lib/trace-cmd/trace-input.c
> @@ -2703,7 +2703,7 @@ static int handle_options(struct tracecmd_input *handle)
>  				trace_pid_map_load(handle, buf);
>  			break;
>  		case TRACECMD_OPTION_TRACEID:
> -			if (size != 8)
> +			if (size < 8)
>  				break;
>  			handle->trace_id = tep_read_number(handle->pevent,
>  							   buf, 8);

This looks like it is unrelated to this patch set. I'm moving it to the
beginning, and will likely even add it to the v2.9 stable branch.

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux