Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Michal Hocko
On Thu 23-11-17 14:47:35, Al Viro wrote: > On Thu, Nov 23, 2017 at 12:52:47PM +0100, Michal Hocko wrote: > > @@ -503,12 +504,18 @@ struct super_block *sget_userns(struct > > file_system_type *type, > > s = alloc_super(type, (flags & ~SB_SUBMOUNT), user_ns); > > if (!s) > >

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Al Viro
On Thu, Nov 23, 2017 at 12:52:47PM +0100, Michal Hocko wrote: > @@ -503,12 +504,18 @@ struct super_block *sget_userns(struct file_system_type > *type, > s = alloc_super(type, (flags & ~SB_SUBMOUNT), user_ns); > if (!s) > return ERR_PTR(-ENOMEM); >

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Tetsuo Handa
Michal Hocko wrote: > On Thu 23-11-17 22:57:06, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > > @@ -260,9 +261,8 @@ static struct super_block *alloc_super(struct > > > > file_system_type *type, int flags, > > > > s->s_shrink.count_objects = super_cache_count; > > > > s->s_shrin

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Michal Hocko
On Thu 23-11-17 22:57:06, Tetsuo Handa wrote: > Michal Hocko wrote: > > > @@ -260,9 +261,8 @@ static struct super_block *alloc_super(struct > > > file_system_type *type, int flags, > > > s->s_shrink.count_objects = super_cache_count; > > > s->s_shrink.batch = 1024; > > > s->s_shrink.flags =

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Tetsuo Handa
Michal Hocko wrote: > > @@ -260,9 +261,8 @@ static struct super_block *alloc_super(struct > > file_system_type *type, int flags, > > s->s_shrink.count_objects = super_cache_count; > > s->s_shrink.batch = 1024; > > s->s_shrink.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE; > > -

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Michal Hocko
On Thu 23-11-17 22:35:34, Tetsuo Handa wrote: > Jan Kara wrote: > > Looks good to me now. You can add: > > > > Reviewed-by: Jan Kara > > > > It does not look good to me, for "goto fail" can call > destroy_unused_super() before s->s_shrink.list is initialized. > Also, the comment block saying "t

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Tetsuo Handa
Jan Kara wrote: > Looks good to me now. You can add: > > Reviewed-by: Jan Kara > It does not look good to me, for "goto fail" can call destroy_unused_super() before s->s_shrink.list is initialized. Also, the comment block saying "this object isn't exposed yet" wants to be updated? --- fs/supe

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Jan Kara
c5 Mon Sep 17 00:00:00 2001 > From: Michal Hocko > Date: Thu, 23 Nov 2017 12:28:35 +0100 > Subject: [PATCH] fs: handle shrinker registration failure in sget_userns > > Syzbot has reported NULL ptr dereference during mntput because of > sb shrinker being NULL > CPU: 1 PID:

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Michal Hocko
+0100 Subject: [PATCH] fs: handle shrinker registration failure in sget_userns Syzbot has reported NULL ptr dereference during mntput because of sb shrinker being NULL CPU: 1 PID: 13231 Comm: syz-executor1 Not tainted 4.14.0-rc8+ #82 Hardware name: Google Google Compute Engine/Google Compute Engine

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Michal Hocko
;t use RCU to access > the superblock, we are fine. But still comment before > destroy_unused_super() should be probably updated. Right. Thanks a lot for the review Jan! What about the following? --- >From cffea62e7f8605c370c8115afae530a1831e75f3 Mon Sep 17 00:00:00 2001 From: Michal Hocko

Re: [PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Jan Kara
On Thu 23-11-17 12:52:47, Michal Hocko wrote: > From: Michal Hocko > > Syzbot has reported NULL ptr dereference during mntput because of > sb shrinker being NULL > CPU: 1 PID: 13231 Comm: syz-executor1 Not tainted 4.14.0-rc8+ #82 > Hardware name: Google Google Compute Engine/Google Compute Engine

[PATCH] fs: handle shrinker registration failure in sget_userns

2017-11-23 Thread Michal Hocko
From: Michal Hocko Syzbot has reported NULL ptr dereference during mntput because of sb shrinker being NULL CPU: 1 PID: 13231 Comm: syz-executor1 Not tainted 4.14.0-rc8+ #82 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: 8801d1dbe5c0 task.stack