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:   Wed, 12 May 2021 15:28:16 -0400
From:   Sasha Levin <sashal@...nel.org>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Oliver Glitta <glittao@...il.com>,
        David Rientjes <rientjes@...gle.com>,
        Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 5.10 518/530] mm, slub: enable slub_debug static key when
 creating cache with explicit debug flags

On Wed, May 12, 2021 at 07:25:24PM +0200, Vlastimil Babka wrote:
>On 5/12/21 5:50 PM, Greg Kroah-Hartman wrote:
>> On Wed, May 12, 2021 at 05:35:28PM +0200, Vlastimil Babka wrote:
>>> On 5/12/21 4:50 PM, Greg Kroah-Hartman wrote:
>>> > From: Vlastimil Babka <vbabka@...e.cz>
>>> >
>>> > [ Upstream commit 1f0723a4c0df36cbdffc6fac82cd3c5d57e06d66 ]
>>> >
>>> > 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.
>>> >
>>> > [1] https://lore.kernel.org/linux-btrfs/20210315141824.26099-1-dsterba@suse.com/
>>> >
>>> > Link: https://lkml.kernel.org/r/20210315153415.24404-1-vbabka@suse.cz
>>> > Fixes: ca0cab65ea2b ("mm, slub: introduce static key for slub_debug()")
>>> > Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
>>> > Reported-by: Oliver Glitta <glittao@...il.com>
>>> > Acked-by: David Rientjes <rientjes@...gle.com>
>>> > Cc: Christoph Lameter <cl@...ux.com>
>>> > Cc: Pekka Enberg <penberg@...nel.org>
>>> > Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
>>> > Cc: "Paul E. McKenney" <paulmck@...nel.org>
>>> > Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
>>> > Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
>>> > Signed-off-by: Sasha Levin <sashal@...nel.org>
>>>
>>> Uh, rather not release this to stable without the followup fix:
>>> https://lore.kernel.org/linux-mm/20210504120019.26791-1-vbabka@suse.cz/
>>
>> Is that in Linus's tree yet?  If so, what is the git id?
>
>No, it's in mmotm, so no git id yet, but should make it to Linus during 5.13 rc's.

I'll drop it for now, thanks!

-- 
Thanks,
Sasha

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ