public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ian Abbott <abbotti@mev.co.uk>
Cc: syzbot <syzbot+01523a0ae5600aef5895@syzkaller.appspotmail.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com, hsweeten@visionengravers.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_poll_remove_entries
Date: Tue, 22 Jul 2025 07:53:55 -0600	[thread overview]
Message-ID: <8320bd2b-b6d2-4ed8-84c6-cb04999e9f53@kernel.dk> (raw)
In-Reply-To: <20250722134724.6671e45b@ian-deb>

> Thanks for your investigation and initial fix. I think dev->attach_lock
> needs to be write-locked before calling is_device_busy() and released
> after comedi_device_detach() (although that also write-locks it, so we
> need to refactor that). Otherwise, someone could get added to the
> wait_head after is_device_busy() returns.

Looked at this one post coffee, and this looks good to me. If the
->cancel() part is all fine with attach_lock being held, this looks like
the simplest solution to the issue.

I still think the whole busy notion etc needs rethinking in comedi, it
should follow a more idiomatic approach rather than be special. But
that's really separate from this fix.

-- 
Jens Axboe

  parent reply	other threads:[~2025-07-22 13:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-19 17:29 [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_poll_remove_entries syzbot
2025-07-20  0:36 ` Hillf Danton
2025-07-20  0:49   ` syzbot
2025-07-20 18:24 ` Jens Axboe
2025-07-20 18:49   ` Jens Axboe
2025-07-20 19:00     ` Jens Axboe
2025-07-20 19:19       ` [syzbot] [kernel] " syzbot
2025-07-22 12:21       ` [syzbot] [io-uring?] " Jens Axboe
2025-07-22 12:30         ` Ian Abbott
2025-07-22 12:43           ` Jens Axboe
2025-07-22 12:31         ` Greg Kroah-Hartman
2025-07-22 12:44           ` Jens Axboe
2025-07-22 12:47       ` Ian Abbott
2025-07-22 13:00         ` Jens Axboe
2025-07-22 13:07           ` Ian Abbott
2025-07-22 13:31             ` Ian Abbott
2025-07-22 13:50               ` Jens Axboe
2025-07-22 14:03                 ` Ian Abbott
2025-07-22 13:53         ` Jens Axboe [this message]
2025-07-22 14:15           ` Ian Abbott
2025-07-23 14:08     ` Aleksandr Nogikh
2025-07-22 12:47 ` Jens Axboe
2025-07-22 13:14   ` [syzbot] [kernel] " syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8320bd2b-b6d2-4ed8-84c6-cb04999e9f53@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=abbotti@mev.co.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+01523a0ae5600aef5895@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox