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: <87mskq58l5.ffs@tglx>
Date: Mon, 02 Sep 2024 18:22:30 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Zhen Lei <thunder.leizhen@...wei.com>, Andrew Morton
 <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org
Cc: Zhen Lei <thunder.leizhen@...wei.com>
Subject: Re: [PATCH 1/5] debugobjects: Fix the misuse of global variables in
 fill_pool()

On Mon, Sep 02 2024 at 22:05, Zhen Lei wrote:

> The global variable 'obj_pool_min_free' records the lowest historical
> value of the number of nodes in the global list 'obj_pool', instead of
> being used as the lowest threshold value. This may be a mistake and

Maybe? It's either a bug or not.

> should be replaced with variable 'debug_objects_pool_min_level'.

And if it's a bug then it has to be replaced.

This misses another minor issue:

static int			obj_pool_min_free = ODEBUG_POOL_SIZE;

static int  __data_racy		debug_objects_pool_min_level __read_mostly
				= ODEBUG_POOL_MIN_LEVEL;

As debug_objects_pool_min_level is the minimum level to keep around and
obj_pool_min_free is a statistics mechanism, __data_racy is misplaced
too. The variables should swap their position, because
debug_objects_pool_min_level is functional, but obj_pool_min_free is
pure stats.

Also debug_objects_pool_min_level and debug_objects_pool_size should
be __ro_after_init.

> Fixes: d26bf5056fc0 ("debugobjects: Reduce number of pool_lock acquisitions in fill_pool()")
> Fixes: 36c4ead6f6df ("debugobjects: Add global free list and the counter")

Nice detective work!

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ