[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240304174721.GQ20455@kvack.org>
Date: Mon, 4 Mar 2024 12:47:21 -0500
From: Benjamin LaHaise <ben@...munityfibre.ca>
To: Bart Van Assche <bvanassche@....org>
Cc: Edward Adam Davis <eadavis@...com>,
syzbot+b91eb2ed18f599dd3c31@...kaller.appspotmail.com,
brauner@...nel.org, jack@...e.cz, linux-aio@...ck.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com, viro@...iv.linux.org.uk
Subject: Re: [PATCH] fs/aio: fix uaf in sys_io_cancel
On Mon, Mar 04, 2024 at 09:40:35AM -0800, Bart Van Assche wrote:
> On 3/4/24 09:31, Benjamin LaHaise wrote:
> >A revert is justified when a series of patches is buggy and had
> >insufficient review prior to merging.
>
> That's not how Linux kernel development works. If a bug can get fixed
> easily, a fix is preferred instead of reverting + reapplying a patch.
Your original "fix" is not right, and it wasn't properly tested. Commit
54cbc058d86beca3515c994039b5c0f0a34f53dd needs to be reverted.
> >Using the "a kernel warning hit" approach for work on cancellation is
> >very much a sign that the patches were half baked.
> Is there perhaps a misunderstanding? My patches fix a kernel warning and
> did not introduce any new WARN*() statements.
The change that introduced that callback by you was incorrect and should
be reverted.
> >Why are you touching the kiocb after ownership has already been
> >passed on to another entity?
> Touching the kiocb after ownership has been passed is the result of an
> oversight. Whether or not kiocb->ki_cancel() transfers ownership depends
> on the I/O type. The use-after-free was not introduced on purpose.
Your fix is still incorrect. You're still touching memory that you don't
own. The event should be generated via the ->ki_cancel method, not in the
io_cancel() syscall.
-ben
> Bart.
>
>
--
"Thought is the essence of where you are now."
Powered by blists - more mailing lists