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] [day] [month] [year] [list]
Date:   Thu, 30 Jan 2020 14:16:34 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Christopher Lameter <cl@...ux.com>,
        Michal Koutný <mkoutny@...e.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Michal Hocko <mhocko@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: SLUB: purpose of sysfs events on cache creation/removal

On 1/28/20 7:13 PM, Christopher Lameter wrote:
> On Tue, 28 Jan 2020, Michal Koutný wrote:
> 
>> On Mon, Jan 27, 2020 at 11:04:53PM +0000, Christopher Lameter <cl@...ux.com> wrote:
>>> The patch exposes details of cgroup caches? Which patch are we talking
>>> about?
>> Sorry, that's misunderstanding. I mean the current state (sending
>> uevents) exposes the internals (creation of caches per cgroup). The
>> patch [1] removing uevent notifications is rectifying it.
> 
> 
> From: Christoph Lameter <cl@...ux.com>
> Subject: slub: Remove userspace notifier for cache add/remove
> 
> Kmem caches are internal kernel structures so it is strange that
> userspace notifiers would be needed. And I am not aware of any use
> of these notifiers. These notifiers may just exist because in the
> initial slub release the sysfs code was copied from another
> subsystem.
> 
> Signed-off-by: Christoph Lameter <cl@...ux.com>

Acked-by: Vlastimil Babka <vbabka@...e.cz>

> Index: linux/mm/slub.c
> ===================================================================
> --- linux.orig/mm/slub.c	2020-01-28 18:13:02.134506141 +0000
> +++ linux/mm/slub.c	2020-01-28 18:13:02.134506141 +0000
> @@ -5632,19 +5632,6 @@ static struct kobj_type slab_ktype = {
>  	.release = kmem_cache_release,
>  };
> 
> -static int uevent_filter(struct kset *kset, struct kobject *kobj)
> -{
> -	struct kobj_type *ktype = get_ktype(kobj);
> -
> -	if (ktype == &slab_ktype)
> -		return 1;
> -	return 0;
> -}
> -
> -static const struct kset_uevent_ops slab_uevent_ops = {
> -	.filter = uevent_filter,
> -};
> -
>  static struct kset *slab_kset;
> 
>  static inline struct kset *cache_kset(struct kmem_cache *s)
> @@ -5712,7 +5699,6 @@ static void sysfs_slab_remove_workfn(str
>  #ifdef CONFIG_MEMCG
>  	kset_unregister(s->memcg_kset);
>  #endif
> -	kobject_uevent(&s->kobj, KOBJ_REMOVE);
>  out:
>  	kobject_put(&s->kobj);
>  }
> @@ -5770,7 +5756,6 @@ static int sysfs_slab_add(struct kmem_ca
>  	}
>  #endif
> 
> -	kobject_uevent(&s->kobj, KOBJ_ADD);
>  	if (!unmergeable) {
>  		/* Setup first alias */
>  		sysfs_slab_alias(s, s->name);
> @@ -5851,7 +5836,7 @@ static int __init slab_sysfs_init(void)
> 
>  	mutex_lock(&slab_mutex);
> 
> -	slab_kset = kset_create_and_add("slab", &slab_uevent_ops, kernel_kobj);
> +	slab_kset = kset_create_and_add("slab", NULL, kernel_kobj);
>  	if (!slab_kset) {
>  		mutex_unlock(&slab_mutex);
>  		pr_err("Cannot register slab subsystem.\n");
> 

Powered by blists - more mailing lists