Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Minchan Kim
On Tue, Apr 10, 2018 at 05:05:28AM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 10:26:43AM +0200, Michal Hocko wrote: > > On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > > > The problem is that the mapping gfp flags are used not only for allocating > > > pages, but also for allocating

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Minchan Kim
On Tue, Apr 10, 2018 at 05:05:28AM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 10:26:43AM +0200, Michal Hocko wrote: > > On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > > > The problem is that the mapping gfp flags are used not only for allocating > > > pages, but also for allocating

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Johannes Weiner
On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > @@ -2714,8 +2714,10 @@ static __always_inline void *slab_alloc_node(struct > kmem_cache *s, > stat(s, ALLOC_FASTPATH); > } > > - if (unlikely(gfpflags & __GFP_ZERO) && object) > -

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Johannes Weiner
On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > @@ -2714,8 +2714,10 @@ static __always_inline void *slab_alloc_node(struct > kmem_cache *s, > stat(s, ALLOC_FASTPATH); > } > > - if (unlikely(gfpflags & __GFP_ZERO) && object) > -

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Johannes Weiner
On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > @@ -428,6 +428,7 @@ radix_tree_node_alloc(gfp_t gfp_mask, struct > radix_tree_node *parent, > ret->exceptional = exceptional; > ret->parent = parent; > ret->root = root; > +

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Johannes Weiner
On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > @@ -428,6 +428,7 @@ radix_tree_node_alloc(gfp_t gfp_mask, struct > radix_tree_node *parent, > ret->exceptional = exceptional; > ret->parent = parent; > ret->root = root; > +

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Tue 10-04-18 04:56:51, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 11:59:03AM +0900, Minchan Kim wrote: > > Okay, I hope this version clear current concerns. > > It doesn't. The right place to warn about GFP_ZERO used with a > constructor is _slab_, like the patch I already sent. We have

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Tue 10-04-18 04:56:51, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 11:59:03AM +0900, Minchan Kim wrote: > > Okay, I hope this version clear current concerns. > > It doesn't. The right place to warn about GFP_ZERO used with a > constructor is _slab_, like the patch I already sent. We have

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Johannes Weiner
On Tue, Apr 10, 2018 at 05:05:28AM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 10:26:43AM +0200, Michal Hocko wrote: > > On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > > > The problem is that the mapping gfp flags are used not only for allocating > > > pages, but also for allocating

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Johannes Weiner
On Tue, Apr 10, 2018 at 05:05:28AM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 10:26:43AM +0200, Michal Hocko wrote: > > On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > > > The problem is that the mapping gfp flags are used not only for allocating > > > pages, but also for allocating

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Tue 10-04-18 05:05:28, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 10:26:43AM +0200, Michal Hocko wrote: > > On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > > > The problem is that the mapping gfp flags are used not only for allocating > > > pages, but also for allocating the page cache

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Tue 10-04-18 05:05:28, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 10:26:43AM +0200, Michal Hocko wrote: > > On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > > > The problem is that the mapping gfp flags are used not only for allocating > > > pages, but also for allocating the page cache

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 08:19:31PM +0900, Minchan Kim wrote: > If you're okay for that, I really want to go my original patch > Michal already gave Acked-by. I NAK this patch. It is completely wrong.

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 08:19:31PM +0900, Minchan Kim wrote: > If you're okay for that, I really want to go my original patch > Michal already gave Acked-by. I NAK this patch. It is completely wrong.

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 10:26:43AM +0200, Michal Hocko wrote: > On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > > The problem is that the mapping gfp flags are used not only for allocating > > pages, but also for allocating the page cache data structures that hold > > the pages. F2FS is the

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 10:26:43AM +0200, Michal Hocko wrote: > On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > > The problem is that the mapping gfp flags are used not only for allocating > > pages, but also for allocating the page cache data structures that hold > > the pages. F2FS is the

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 11:59:03AM +0900, Minchan Kim wrote: > Okay, I hope this version clear current concerns. It doesn't. The right place to warn about GFP_ZERO used with a constructor is _slab_, like the patch I already sent. We have no idea what other places might have the same bug, and

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 11:59:03AM +0900, Minchan Kim wrote: > Okay, I hope this version clear current concerns. It doesn't. The right place to warn about GFP_ZERO used with a constructor is _slab_, like the patch I already sent. We have no idea what other places might have the same bug, and

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Minchan Kim
On Tue, Apr 10, 2018 at 12:28:45PM +0200, Jan Kara wrote: > On Tue 10-04-18 11:32:41, Michal Hocko wrote: > > On Tue 10-04-18 10:55:31, Jan Kara wrote: > > > On Tue 10-04-18 10:22:43, Michal Hocko wrote: > > > > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > > > > > Recently, I got a report like

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Minchan Kim
On Tue, Apr 10, 2018 at 12:28:45PM +0200, Jan Kara wrote: > On Tue 10-04-18 11:32:41, Michal Hocko wrote: > > On Tue 10-04-18 10:55:31, Jan Kara wrote: > > > On Tue 10-04-18 10:22:43, Michal Hocko wrote: > > > > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > > > > > Recently, I got a report like

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Jan Kara
On Tue 10-04-18 11:32:41, Michal Hocko wrote: > On Tue 10-04-18 10:55:31, Jan Kara wrote: > > On Tue 10-04-18 10:22:43, Michal Hocko wrote: > > > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > > > > Recently, I got a report like below. > > > > > > > > [ 7858.792946] [] __list_del_entry+0x30/0xd0

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Jan Kara
On Tue 10-04-18 11:32:41, Michal Hocko wrote: > On Tue 10-04-18 10:55:31, Jan Kara wrote: > > On Tue 10-04-18 10:22:43, Michal Hocko wrote: > > > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > > > > Recently, I got a report like below. > > > > > > > > [ 7858.792946] [] __list_del_entry+0x30/0xd0

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Tue 10-04-18 10:55:31, Jan Kara wrote: > On Tue 10-04-18 10:22:43, Michal Hocko wrote: > > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > > > Recently, I got a report like below. > > > > > > [ 7858.792946] [] __list_del_entry+0x30/0xd0 > > > [ 7858.792951] [] list_lru_del+0xac/0x1ac > > > [

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Tue 10-04-18 10:55:31, Jan Kara wrote: > On Tue 10-04-18 10:22:43, Michal Hocko wrote: > > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > > > Recently, I got a report like below. > > > > > > [ 7858.792946] [] __list_del_entry+0x30/0xd0 > > > [ 7858.792951] [] list_lru_del+0xac/0x1ac > > > [

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Jan Kara
On Tue 10-04-18 10:22:43, Michal Hocko wrote: > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > > Recently, I got a report like below. > > > > [ 7858.792946] [] __list_del_entry+0x30/0xd0 > > [ 7858.792951] [] list_lru_del+0xac/0x1ac > > [ 7858.792957] [] page_cache_tree_insert+0xd8/0x110 > > [

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Jan Kara
On Tue 10-04-18 10:22:43, Michal Hocko wrote: > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > > Recently, I got a report like below. > > > > [ 7858.792946] [] __list_del_entry+0x30/0xd0 > > [ 7858.792951] [] list_lru_del+0xac/0x1ac > > [ 7858.792957] [] page_cache_tree_insert+0xd8/0x110 > > [

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Jan Kara
On Tue 10-04-18 11:59:03, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 07:41:52PM -0700, Matthew Wilcox wrote: > > On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > > > @@ -522,7 +532,7 @@ EXPORT_SYMBOL(radix_tree_preload); > > > */ > > > int radix_tree_maybe_preload(gfp_t

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Jan Kara
On Tue 10-04-18 11:59:03, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 07:41:52PM -0700, Matthew Wilcox wrote: > > On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > > > @@ -522,7 +532,7 @@ EXPORT_SYMBOL(radix_tree_preload); > > > */ > > > int radix_tree_maybe_preload(gfp_t

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 11:38:27AM -0700, Jaegeuk Kim wrote: > > On 04/09, Minchan Kim wrote: > > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > > > > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > > > > On

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Mon 09-04-18 12:40:44, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 11:38:27AM -0700, Jaegeuk Kim wrote: > > On 04/09, Minchan Kim wrote: > > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > > > > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > > > > On

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Mon 09-04-18 10:58:15, Minchan Kim wrote: > Recently, I got a report like below. > > [ 7858.792946] [] __list_del_entry+0x30/0xd0 > [ 7858.792951] [] list_lru_del+0xac/0x1ac > [ 7858.792957] [] page_cache_tree_insert+0xd8/0x110 > [ 7858.792962] [] __add_to_page_cache_locked+0xf8/0x4e0 > [

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-10 Thread Michal Hocko
On Mon 09-04-18 10:58:15, Minchan Kim wrote: > Recently, I got a report like below. > > [ 7858.792946] [] __list_del_entry+0x30/0xd0 > [ 7858.792951] [] list_lru_del+0xac/0x1ac > [ 7858.792957] [] page_cache_tree_insert+0xd8/0x110 > [ 7858.792962] [] __add_to_page_cache_locked+0xf8/0x4e0 > [

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 07:41:52PM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > > @@ -522,7 +532,7 @@ EXPORT_SYMBOL(radix_tree_preload); > > */ > > int radix_tree_maybe_preload(gfp_t gfp_mask) > > { > > - if (gfpflags_allow_blocking(gfp_mask))

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 07:41:52PM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > > @@ -522,7 +532,7 @@ EXPORT_SYMBOL(radix_tree_preload); > > */ > > int radix_tree_maybe_preload(gfp_t gfp_mask) > > { > > - if (gfpflags_allow_blocking(gfp_mask))

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > @@ -522,7 +532,7 @@ EXPORT_SYMBOL(radix_tree_preload); > */ > int radix_tree_maybe_preload(gfp_t gfp_mask) > { > - if (gfpflags_allow_blocking(gfp_mask)) > + if (gfpflags_allow_blocking(gfp_mask) && !(gfp_mask &

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > @@ -522,7 +532,7 @@ EXPORT_SYMBOL(radix_tree_preload); > */ > int radix_tree_maybe_preload(gfp_t gfp_mask) > { > - if (gfpflags_allow_blocking(gfp_mask)) > + if (gfpflags_allow_blocking(gfp_mask) && !(gfp_mask &

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 06:12:11PM -0700, Matthew Wilcox wrote: > > On Tue, Apr 10, 2018 at 08:04:09AM +0900, Minchan Kim wrote: > > > On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > > > > I don't think this is

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 06:12:11PM -0700, Matthew Wilcox wrote: > > On Tue, Apr 10, 2018 at 08:04:09AM +0900, Minchan Kim wrote: > > > On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > > > > I don't think this is

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 06:12:11PM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 08:04:09AM +0900, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > > > I don't think this is something the radix tree should know about. > > > > Because shadow entry

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 06:12:11PM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 08:04:09AM +0900, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > > > I don't think this is something the radix tree should know about. > > > > Because shadow entry

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 08:04:09AM +0900, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > > I don't think this is something the radix tree should know about. > > Because shadow entry implementation is hidden by radix tree implemetation. > IOW, radix tree

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 08:04:09AM +0900, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > > I don't think this is something the radix tree should know about. > > Because shadow entry implementation is hidden by radix tree implemetation. > IOW, radix tree

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 11:49:58PM +0900, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > > > On 2018/4/9 19:25, Minchan Kim wrote: > > > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 11:49:58PM +0900, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > > > On 2018/4/9 19:25, Minchan Kim wrote: > > > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 11:38:27AM -0700, Jaegeuk Kim wrote: > On 04/09, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > > > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > > > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote:

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 11:38:27AM -0700, Jaegeuk Kim wrote: > On 04/09, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > > > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > > > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote:

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Jaegeuk Kim
On 04/09, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > > > > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote:

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Jaegeuk Kim
On 04/09, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > > > > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote:

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread David Sterba
On Mon, Apr 09, 2018 at 03:52:15PM +0200, Michal Hocko wrote: > On Mon 09-04-18 06:41:14, Matthew Wilcox wrote: > > On Mon, Apr 09, 2018 at 02:48:52PM +0200, Michal Hocko wrote: > > > On Mon 09-04-18 20:25:06, Chao Yu wrote: > > > [...] > > > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread David Sterba
On Mon, Apr 09, 2018 at 03:52:15PM +0200, Michal Hocko wrote: > On Mon 09-04-18 06:41:14, Matthew Wilcox wrote: > > On Mon, Apr 09, 2018 at 02:48:52PM +0200, Michal Hocko wrote: > > > On Mon 09-04-18 20:25:06, Chao Yu wrote: > > > [...] > > > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 11:49:58PM +0900, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > > On 2018/4/9 19:25, Minchan Kim wrote: > > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > > >> On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 11:49:58PM +0900, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > > On 2018/4/9 19:25, Minchan Kim wrote: > > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > > >> On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > On 2018/4/9 19:25, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > >> On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > >>> On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > On 2018/4/9 19:25, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > >> On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > >>> On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Michal Hocko
On Mon 09-04-18 06:41:14, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 02:48:52PM +0200, Michal Hocko wrote: > > On Mon 09-04-18 20:25:06, Chao Yu wrote: > > [...] > > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > > index c852e800..cc63f8c448f0 100644 > > > --- a/fs/f2fs/inode.c > >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Michal Hocko
On Mon 09-04-18 06:41:14, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 02:48:52PM +0200, Michal Hocko wrote: > > On Mon 09-04-18 20:25:06, Chao Yu wrote: > > [...] > > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > > index c852e800..cc63f8c448f0 100644 > > > --- a/fs/f2fs/inode.c > >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Christoph Hellwig
On Mon, Apr 09, 2018 at 06:41:14AM -0700, Matthew Wilcox wrote: > It's worth noting that this is endemic in filesystems. For the rationale in XFS take a look at commit ad22c7a043c2cc6792820e6c5da699935933e87d

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Christoph Hellwig
On Mon, Apr 09, 2018 at 06:41:14AM -0700, Matthew Wilcox wrote: > It's worth noting that this is endemic in filesystems. For the rationale in XFS take a look at commit ad22c7a043c2cc6792820e6c5da699935933e87d

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 02:48:52PM +0200, Michal Hocko wrote: > On Mon 09-04-18 20:25:06, Chao Yu wrote: > [...] > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > index c852e800..cc63f8c448f0 100644 > > --- a/fs/f2fs/inode.c > > +++ b/fs/f2fs/inode.c > > @@ -339,10 +339,10 @@ struct inode

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 02:48:52PM +0200, Michal Hocko wrote: > On Mon 09-04-18 20:25:06, Chao Yu wrote: > [...] > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > index c852e800..cc63f8c448f0 100644 > > --- a/fs/f2fs/inode.c > > +++ b/fs/f2fs/inode.c > > @@ -339,10 +339,10 @@ struct inode

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Michal Hocko
On Mon 09-04-18 20:25:06, Chao Yu wrote: [...] > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > index c852e800..cc63f8c448f0 100644 > --- a/fs/f2fs/inode.c > +++ b/fs/f2fs/inode.c > @@ -339,10 +339,10 @@ struct inode *f2fs_iget(struct super_block *sb, > unsigned long ino) > make_now: >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Michal Hocko
On Mon 09-04-18 20:25:06, Chao Yu wrote: [...] > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > index c852e800..cc63f8c448f0 100644 > --- a/fs/f2fs/inode.c > +++ b/fs/f2fs/inode.c > @@ -339,10 +339,10 @@ struct inode *f2fs_iget(struct super_block *sb, > unsigned long ino) > make_now: >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Chao Yu
On 2018/4/9 19:25, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: >> On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: >>> On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Chao Yu
On 2018/4/9 19:25, Minchan Kim wrote: > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: >> On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: >>> On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > > > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > > > It assumes shadow entry of

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > > > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > > > It assumes shadow entry of

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > > It assumes shadow entry of radix tree relies on the init state > > > that node->private_list

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > > It assumes shadow entry of radix tree relies on the init state > > > that node->private_list

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > It assumes shadow entry of radix tree relies on the init state > > that node->private_list allocated should be list_empty state. > > Currently, it's initailized in

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > It assumes shadow entry of radix tree relies on the init state > > that node->private_list allocated should be list_empty state. > > Currently, it's initailized in

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > It assumes shadow entry of radix tree relies on the init state > that node->private_list allocated should be list_empty state. > Currently, it's initailized in SLAB constructor which means > node of radix tree would be initialized only

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Matthew Wilcox
On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > It assumes shadow entry of radix tree relies on the init state > that node->private_list allocated should be list_empty state. > Currently, it's initailized in SLAB constructor which means > node of radix tree would be initialized only

[PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
Recently, I got a report like below. [ 7858.792946] [] __list_del_entry+0x30/0xd0 [ 7858.792951] [] list_lru_del+0xac/0x1ac [ 7858.792957] [] page_cache_tree_insert+0xd8/0x110 [ 7858.792962] [] __add_to_page_cache_locked+0xf8/0x4e0 [ 7858.792967] [] add_to_page_cache_lru+0x50/0x1ac [ 7858.792972]

[PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
Recently, I got a report like below. [ 7858.792946] [] __list_del_entry+0x30/0xd0 [ 7858.792951] [] list_lru_del+0xac/0x1ac [ 7858.792957] [] page_cache_tree_insert+0xd8/0x110 [ 7858.792962] [] __add_to_page_cache_locked+0xf8/0x4e0 [ 7858.792967] [] add_to_page_cache_lru+0x50/0x1ac [ 7858.792972]