From: Damien Le Moal <dlemoal@kernel.org>
To: Juefei Pu <juefei.pu@email.ucr.edu>,
cassel@kernel.org, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: BUG: possible deadlock in __ata_sff_interrupt
Date: Mon, 9 Dec 2024 09:34:55 +0900 [thread overview]
Message-ID: <2475124e-d4a1-4836-b5a0-3c00f5a5a94d@kernel.org> (raw)
In-Reply-To: <CANikGpf3VaRCW+m48E+k7CDGKv89gwd12Q1=qM_uP3N=az-T7A@mail.gmail.com>
On 8/27/24 05:46, Juefei Pu wrote:
> Hello,
> We found the following issue using syzkaller on Linux v6.10.
Can you run the same against the latest 6.13-rc2 ?
> A possible deadlock issue was discovered in function
> `__ata_sff_interrupt` when it attempted to acquire lock `host->lock`.
>
> Unfortunately, the syzkaller failed to generate a reproducer.
> But at least we have the report:
>
> sr 1:0:0:0: [sr0] tag#0 FAILED Result: hostbyte=DID_ERROR
> driverbyte=DRIVER_OK cmd_age=0s
> sr 1:0:0:0: [sr0] tag#0 CDB: opcode=0x98 98 61 1e 1d 47 a1 77 90 29 76
> 7f 40 b8 5e 03 63
> =====================================================
> WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
> 6.10.0 #13 Not tainted
> -----------------------------------------------------
> syz.1.961/19801 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
> ffff88802d3a4018 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu
> fs/fcntl.c:1028 [inline]
> ffff88802d3a4018 (&new->fa_lock){....}-{2:2}, at:
> kill_fasync+0x196/0x4d0 fs/fcntl.c:1049
>
> and this task is already holding:
> ffff88801ca06018 (&host->lock){-.-.}-{2:2}, at:
> ata_scsi_queuecmd+0x8a/0x520 drivers/ata/libata-scsi.c:4197
> which would create a new lock dependency:
> (&host->lock){-.-.}-{2:2} -> (&new->fa_lock){....}-{2:2}
[...]
> Chain exists of:
> &host->lock --> &new->fa_lock --> tasklist_lock
>
> Possible interrupt unsafe locking scenario:
>
> CPU0 CPU1
> ---- ----
> lock(tasklist_lock);
> local_irq_disable();
> lock(&host->lock);
> lock(&new->fa_lock);
> <Interrupt>
> lock(&host->lock);
I fail to see how this can happen given that the first thing that
kill_fasync+0x196/0x4d0 fs/fcntl.c:1049 is "write_lock_irq(&fa->fa_lock);" so
IRQs are disabled... Lockdep is confused ?
--
Damien Le Moal
Western Digital Research
prev parent reply other threads:[~2024-12-09 0:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 20:46 Juefei Pu
2024-12-09 0:34 ` Damien Le Moal [this message]
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=2475124e-d4a1-4836-b5a0-3c00f5a5a94d@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=juefei.pu@email.ucr.edu \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®