lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 25 Apr 2023 16:21:04 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Ken Lin <lyenting@...gle.com>
Cc:     mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Add missing spaces in trace_print_hex_seq()

On Tue, 25 Apr 2023 10:13:29 +0800
Ken Lin <lyenting@...gle.com> wrote:

> If the buffer length is larger than 16 and concatenate is set to false,
> there would be missing spaces every 16 bytes.
> Example:
>   Before: c5 11 10 50 05 4d 31 40 00 40 00 40 00 4d 31 4000 40 00
>   After:  c5 11 10 50 05 4d 31 40 00 40 00 40 00 4d 31 40 00 40 00
> 

This version of the patch has whitespace issues and sent as HTML. Please
fix.

Also, the subject needs to follow proper formatting:

  tracing: Add missing spaces in trace_print_hex_seq()

And please also Cc: linux-trace-kernel@...r.kernel.org.

Thanks,

-- Steve

> Signed-off-by: Ken Lin <lyenting@...gle.com>
> ---
>  kernel/trace/trace_output.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
> index bd475a00f96d..6e45cf18d816 100644
> --- a/kernel/trace/trace_output.c
> +++ b/kernel/trace/trace_output.c
> @@ -221,8 +221,11 @@ trace_print_hex_seq(struct trace_seq *p, const
> unsigned char *buf, int buf_len,
>         const char *ret = trace_seq_buffer_ptr(p);
>         const char *fmt = concatenate ? "%*phN" : "%*ph";
> 
> -       for (i = 0; i < buf_len; i += 16)
> +       for (i = 0; i < buf_len; i += 16) {
> +               if (!concatenate && i != 0)
> +                       trace_seq_putc(p, ' ');
>                 trace_seq_printf(p, fmt, min(buf_len - i, 16), &buf[i]);
> +       }
>         trace_seq_putc(p, 0);
> 
>         return ret;
> --
> 2.40.0.rc1.284.g88254d51c5-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ