[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240304104457.1348-1-hdanton@sina.com>
Date: Mon, 4 Mar 2024 18:44:57 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+b91eb2ed18f599dd3c31@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [fs?] KASAN: slab-use-after-free Read in sys_io_cancel
On Sat, 02 Mar 2024 23:29:23 -0800
> syzbot found the following issue on:
>
> HEAD commit: 5ad3cb0ed525 Merge tag 'for-v6.8-rc2' of git://git.kernel...
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13877412180000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
--- x/fs/aio.c
+++ y/fs/aio.c
@@ -2195,6 +2195,11 @@ SYSCALL_DEFINE3(io_cancel, aio_context_t
if (kiocb->ki_res.obj == obj) {
ret = kiocb->ki_cancel(&kiocb->rw);
list_del_init(&kiocb->ki_list);
+ if (ret == 0 && kiocb->rw.ki_flags & IOCB_AIO_RW) {
+ struct aio_kiocb *iocb = container_of(&kiocb->rw,
+ struct aio_kiocb, rw);
+ refcount_inc(&iocb->ki_refcnt);
+ }
break;
}
}
--
Powered by blists - more mailing lists