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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210425090751.2jqj4yqx5ztyqhvg@pengutronix.de>
Date:   Sun, 25 Apr 2021 11:07:51 +0200
From:   Marc Kleine-Budde <mkl@...gutronix.de>
To:     Erik Flodin <erik@...din.me>
Cc:     Oliver Hartkopp <socketcan@...tkopp.net>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, linux-can@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH] can: fix proc/can/net/rcvlist_* header alignment on
 64-bit system

Hey Erik,

the subject is not 100% correct, actually it is /proc/net/can/rcvlist_*

On 25.04.2021 10:49:29, Erik Flodin wrote:
> Before this fix, the function and userdata columns weren't aligned:
>   device   can_id   can_mask  function  userdata   matches  ident
>    vcan0  92345678  9fffffff  0000000000000000  0000000000000000         0  raw
>    vcan0     123    00000123  0000000000000000  0000000000000000         0  raw
> 
> After the fix they are:
>   device   can_id   can_mask      function          userdata       matches  ident
>    vcan0  92345678  9fffffff  0000000000000000  0000000000000000         0  raw
>    vcan0     123    00000123  0000000000000000  0000000000000000         0  raw
> 
> Signed-off-by: Erik Flodin <erik@...din.me>
> ---
>  net/can/proc.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/can/proc.c b/net/can/proc.c
> index 5ea8695f507e..97901e56c429 100644
> --- a/net/can/proc.c
> +++ b/net/can/proc.c
> @@ -205,8 +205,11 @@ static void can_print_recv_banner(struct seq_file *m)
>  	 *                  can1.  00000000  00000000  00000000
>  	 *                 .......          0  tp20
>  	 */
> -	seq_puts(m, "  device   can_id   can_mask  function"
> -			"  userdata   matches  ident\n");
> +	const char *pad = sizeof(void *) == 8 ? "    " : "";

nitpick: please move this to the beginning of the function, even before
the comment.

> +
> +	seq_printf(m, "  device   can_id   can_mask  %sfunction%s"
> +		   "  %suserdata%s   matches  ident\n",

nitpick:
For printed strings it's better to have them in a single line, so that
grepping for them is easier.

> +		   pad, pad, pad, pad);
>  }
>  
>  static int can_stats_proc_show(struct seq_file *m, void *v)
> -- 
> 2.31.0
> 
> 

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ