Re: [Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()

2019-07-24 Thread Andreas Gruenbacher
On Wed, 24 Jul 2019 at 12:55, Steven Whitehouse wrote: > On 24/07/2019 11:27, Christoph Hellwig wrote: > > On Wed, Jul 24, 2019 at 11:22:46AM +0100, Steven Whitehouse wrote: > >> and it would have the same effect, so far as I can tell. I don't mind > >> changing it, if that is perhaps a clearer

Re: [Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()

2019-07-24 Thread Steven Whitehouse
Hi, On 24/07/2019 11:27, Christoph Hellwig wrote: On Wed, Jul 24, 2019 at 11:22:46AM +0100, Steven Whitehouse wrote: and it would have the same effect, so far as I can tell. I don't mind changing it, if that is perhaps a clearer way to write the same thing, rather than >i_inode; The cleanest

Re: [Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()

2019-07-24 Thread Christoph Hellwig
On Wed, Jul 24, 2019 at 11:22:46AM +0100, Steven Whitehouse wrote: > and it would have the same effect, so far as I can tell. I don't mind > changing it, if that is perhaps a clearer way to write the same thing, > rather than >i_inode; The cleanest thing is to not rely on any of that magic and

Re: [Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()

2019-07-24 Thread Steven Whitehouse
Hi, On 24/07/2019 11:02, Christoph Hellwig wrote: On Wed, Jul 24, 2019 at 09:48:38AM +0100, Steven Whitehouse wrote: Hi, On 24/07/2019 09:43, Jia-Ju Bai wrote: In gfs2_alloc_inode(), when kmem_cache_alloc() on line 1724 returns NULL, ip is assigned to NULL. In this case, "return >i_inode"

Re: [Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()

2019-07-24 Thread Edwin Török
On 24/07/2019 11:02, Christoph Hellwig wrote: > On Wed, Jul 24, 2019 at 09:48:38AM +0100, Steven Whitehouse wrote: >> Hi, >> >> On 24/07/2019 09:43, Jia-Ju Bai wrote: >>> In gfs2_alloc_inode(), when kmem_cache_alloc() on line 1724 returns >>> NULL, ip is assigned to NULL. In this case, "return

Re: [Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()

2019-07-24 Thread Christoph Hellwig
On Wed, Jul 24, 2019 at 09:48:38AM +0100, Steven Whitehouse wrote: > Hi, > > On 24/07/2019 09:43, Jia-Ju Bai wrote: > > In gfs2_alloc_inode(), when kmem_cache_alloc() on line 1724 returns > > NULL, ip is assigned to NULL. In this case, "return >i_inode" will > > cause a null-pointer dereference.

Re: [Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()

2019-07-24 Thread Steven Whitehouse
Hi, On 24/07/2019 09:43, Jia-Ju Bai wrote: In gfs2_alloc_inode(), when kmem_cache_alloc() on line 1724 returns NULL, ip is assigned to NULL. In this case, "return >i_inode" will cause a null-pointer dereference. To fix this null-pointer dereference, NULL is returned when ip is NULL. This bug