Re: [PATCH] bcachefs: fix NULL pointer dereference in try_alloc_bucket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 30, 2023 at 08:15:41AM -0400, Mikulas Patocka wrote:
> 
> 
> On Mon, 29 May 2023, Mikulas Patocka wrote:
> 
> > The oops happens in set_btree_iter_dontneed and it is caused by the fact 
> > that iter->path is NULL. The code in try_alloc_bucket is buggy because it 
> > sets "struct btree_iter iter = { NULL };" and then jumps to the "err" 
> > label that tries to dereference values in "iter".
> 
> Here I'm sending a patch for it.
> 
> 
> 
> +		set_btree_iter_dontneed(&iter);
>  	bch2_trans_iter_exit(trans, &iter);

I need to look at this code a bit more, perhaps we'll want to move the
check into set_btree_iter_dontneed(), since iter_exit() is safe to call
on an uninitialized-but-zeroed iterator



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux