Re: [PATCH RFC] ubifs: Fix use-after-free in ubifs_tnc_end_commit

Waqar Hameed
2024-11-07T22:11:23Z

On Thu, Nov 07, 2024 at 15:14 +0800 Zhihao Cheng <chengzhihao1@huawei.com> wrote:

> 在 2024/11/7 0:36, Waqar Hameed 写道:

[...]

>> Did you manage to reproduce the issue with this?
>
> I tried, but I still cannot reproduce it on my local machine.

That's a bummer! Sometimes it really could take a while. For example, my
last attempt needed 248 iterations (almost 4 hours)...

[...]

> @@ -662,6 +662,10 @@ static int get_znodes_to_commit(struct ubifs_info *c)
> }
> znode->cparent = znode->parent;
> znode->ciip = znode->iip;
> + if (znode->cparent) {
> + ubifs_assert(c, ubifs_zn_dirty(znode->cparent));
> + }
> + ubifs_assert(c, znode->ciip < c->fantout);
> znode->cnext = cnext;
> znode = cnext;
> cnt += 1;

None of the asserts got hit during my last run, but KASAN still
complained.