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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <791c0b1d-6fc2-43b4-b0fe-484eeef613d8@bootlin.com>
Date: Tue, 25 Feb 2025 12:24:21 +0100
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: Jim Cromie <jim.cromie@...il.com>, linux-kernel@...r.kernel.org,
	jbaron@...mai.com, gregkh@...uxfoundation.org, ukaszb@...omium.org
Cc: intel-gfx-trybot@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
	amd-gfx@...ts.freedesktop.org, intel-gvt-dev@...ts.freedesktop.org,
	intel-gfx@...ts.freedesktop.org, daniel.vetter@...ll.ch,
	tvrtko.ursulin@...ux.intel.com, jani.nikula@...el.com,
	ville.syrjala@...ux.intel.com
Subject: Re: [PATCH 04/63] dyndbg: make ddebug_class_param union members same
 size



Le 25/01/2025 à 07:45, Jim Cromie a écrit :
> struct ddebug_class_param keeps a ref to the state-storage of the
> param; make both class-types use the same unsigned long storage type.
> 
> ISTM this is simpler and safer; it avoids an irrelevant difference,
> and if 2 users somehow get class-type mixed up (or refer to the wrong
> union member), at least they will both see the same value.
> 
> Signed-off-by: Jim Cromie <jim.cromie@...il.com>

Reviewed-by: Louis Chauvet <louis.chauvet@...tlin.com>

> ---
>   include/linux/dynamic_debug.h | 2 +-
>   lib/dynamic_debug.c           | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> index ff44ec346162..b9afc7731b7c 100644
> --- a/include/linux/dynamic_debug.h
> +++ b/include/linux/dynamic_debug.h
> @@ -124,7 +124,7 @@ struct _ddebug_info {
>   struct ddebug_class_param {
>   	union {
>   		unsigned long *bits;
> -		unsigned int *lvl;
> +		unsigned long *lvl;
>   	};
>   	char flags[8];
>   	const struct ddebug_class_map *map;
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index 147540c57154..55df35df093b 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -799,7 +799,7 @@ int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp)
>   
>   	case DD_CLASS_TYPE_LEVEL_NAMES:
>   	case DD_CLASS_TYPE_LEVEL_NUM:
> -		return scnprintf(buffer, PAGE_SIZE, "%d\n", *dcp->lvl);
> +		return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl);
>   	default:
>   		return -1;
>   	}

-- 
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ