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: <8c4f3385-e935-8363-c6bd-ffe6b8c2d6c4@suse.cz>
Date:   Mon, 15 Mar 2021 18:36:34 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     paulmck@...nel.org
Cc:     David Rientjes <rientjes@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org,
        David Sterba <dsterba@...e.com>,
        Oliver Glitta <glittao@...il.com>
Subject: Re: [PATCH] [PATCH] mm, slub: enable slub_debug static key when
 creating cache with explicit debug flags

On 3/15/21 6:32 PM, Paul E. McKenney wrote:
> On Mon, Mar 15, 2021 at 06:28:42PM +0100, Vlastimil Babka wrote:
>> On 3/15/21 6:16 PM, David Rientjes wrote:
>> > On Mon, 15 Mar 2021, Vlastimil Babka wrote:
>> > 
>> >> Commit ca0cab65ea2b ("mm, slub: introduce static key for slub_debug()")
>> >> introduced a static key to optimize the case where no debugging is enabled for
>> >> any cache. The static key is enabled when slub_debug boot parameter is passed,
>> >> or CONFIG_SLUB_DEBUG_ON enabled.
>> >> 
>> >> However, some caches might be created with one or more debugging flags
>> >> explicitly passed to kmem_cache_create(), and the commit missed this. Thus the
>> >> debugging functionality would not be actually performed for these caches unless
>> >> the static key gets enabled by boot param or config.
>> >> 
>> >> This patch fixes it by checking for debugging flags passed to
>> >> kmem_cache_create() and enabling the static key accordingly.
>> >> 
>> >> Note such explicit debugging flags should not be used outside of debugging and
>> >> testing as they will now enable the static key globally. btrfs_init_cachep()
>> >> creates a cache with SLAB_RED_ZONE but that's a mistake that's being corrected
>> >> [1]. rcu_torture_stats() creates a cache with SLAB_STORE_USER, but that is a
>> >> testing module so it's OK and will start working as intended after this patch.
>> >> 
>> >> Also note that in case of backports to kernels before v5.12 that don't have
>> >> 59450bbc12be ("mm, slab, slub: stop taking cpu hotplug lock"),
>> >> static_branch_enable_cpuslocked() should be used.
>> >> 
>> > 
>> > Since this affects 5.9+, is the plan to propose backports to stable with 
>> > static_branch_enable_cpuslocked() once this is merged?  (I notice the 
>> > absence of the stable tag here, which I believe is intended.)
>> 
>> I was thinking about it, and since the rcutorture user is only in -next (AFAICS)
>> and btrfs user was unintended, it didn't seem to meet stable criteria to me. But
>> I won't mind if it's backported.
> 
> I had better ask...  Should rcutorture be doing something different?
> 
> 							Thanx, Paul

No, I think it's fine if a testing module such as rcutorture flips the static
key for the rest of the kernel's uptime. I only CC'd you as FYI in case you were
wondering why you can't see any alloc/free stacks in its output :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ