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]
Date:   Sun, 18 Jul 2021 23:21:41 -0700 (PDT)
From:   David Rientjes <rientjes@...gle.com>
To:     vjitta@...eaurora.org
cc:     cl@...ux.com, penberg@...nel.org, iamjoonsoo.kim@....com,
        akpm@...ux-foundation.org, vbabka@...e.cz, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, vinmenon@...eaurora.org
Subject: Re: [PATCH] mm: slub: Fix slub_debug disablement for list of slabs

On Tue, 13 Jul 2021, vjitta@...eaurora.org wrote:

> From: Vijayanand Jitta <vjitta@...eaurora.org>
> 
> Consider the scenario where CONFIG_SLUB_DEBUG_ON is set
> and we would want to disable slub_debug for few slabs.
> Using boot parameter with slub_debug=-,slab_name syntax
> doesn't work as expected i.e; only disabling debugging for
> the specified list of slabs, instead it disables debugging
> for all slabs. Fix this.
> 
> Signed-off-by: Vijayanand Jitta <vjitta@...eaurora.org>
> ---
>  mm/slub.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index dc863c1..5a88418 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -1429,6 +1429,7 @@ static int __init setup_slub_debug(char *str)
>  	char *slab_list;
>  	bool global_slub_debug_changed = false;
>  	bool slab_list_specified = false;
> +	bool slab_list_debug_disable = true;
>  
>  	slub_debug = DEBUG_DEFAULT_FLAGS;
>  	if (*str++ != '=' || !*str)
> @@ -1436,7 +1437,6 @@ static int __init setup_slub_debug(char *str)
>  		 * No options specified. Switch on full debugging.
>  		 */
>  		goto out;
> -
>  	saved_str = str;
>  	while (str) {
>  		str = parse_slub_debug_flags(str, &flags, &slab_list, true);
> @@ -1445,6 +1445,8 @@ static int __init setup_slub_debug(char *str)
>  			slub_debug = flags;
>  			global_slub_debug_changed = true;
>  		} else {
> +			if (flags || !IS_ENABLED(CONFIG_SLUB_DEBUG_ON))

Could you explain the check for CONFIG_SLUB_DEBUG_ON here?

I don't believe that using `-' for slub_debug is *only* useful when 
CONFIG_SLUB_DEBUG_ON is enabled.

> +				slab_list_debug_disable = false;
>  			slab_list_specified = true;
>  		}
>  	}
> @@ -1456,7 +1458,7 @@ static int __init setup_slub_debug(char *str)
>  	 * long as there is no option specifying flags without a slab list.
>  	 */
>  	if (slab_list_specified) {
> -		if (!global_slub_debug_changed)
> +		if (!global_slub_debug_changed && !slab_list_debug_disable)
>  			slub_debug = 0;
>  		slub_debug_string = saved_str;
>  	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ