From: Jakub Kicinski <kuba@kernel.org>
To: Chengfeng Ye <dg573847474@gmail.com>
Cc: isdn@linux-pingi.de, alexanderduyck@fb.com, duoming@zju.edu.cn,
yangyingliang@huawei.com, davem@davemloft.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mISDN: hfcpci: Fix potential deadlock on &hc->lock
Date: Wed, 26 Jul 2023 21:46:13 -0700 [thread overview]
Message-ID: <20230726214613.7fee0d7b@kernel.org> (raw)
In-Reply-To: <20230725173728.13816-1-dg573847474@gmail.com>
On Tue, 25 Jul 2023 17:37:28 +0000 Chengfeng Ye wrote:
> As &hc->lock is acquired by both timer _hfcpci_softirq() and hardirq
> hfcpci_int(), the timer should disable irq before lock acquisition
> otherwise deadlock could happen if the timmer is preemtped by the hadr irq.
>
> Possible deadlock scenario:
> hfcpci_softirq() (timer)
> -> _hfcpci_softirq()
> -> spin_lock(&hc->lock);
> <irq interruption>
> -> hfcpci_int()
> -> spin_lock(&hc->lock); (deadlock here)
>
> This flaw was found by an experimental static analysis tool I am developing
> for irq-related deadlock.
>
> The tentative patch fixes the potential deadlock by spin_lock_irq()
> in timer.
>
> But the patch could be not enough since between the lock critical section
> inside the timer, tx_birq() is called in which a lot of stuff is executed
> such as dev_kfree_skb(). I am not sure what's the best way to solve this
> potential deadlock problem.
Yeah, the dev_kfree_skb() should be dev_kfree_skb_any() or _irq()
> Signed-off-by: Chengfeng Ye <dg573847474@gmail.com>
LGTM, but please repost with a Fixes tag added.
--
pw-bot: cr
next prev parent reply other threads:[~2023-07-27 4:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 17:37 [PATCH] mISDN: hfcpci: Fix potential deadlock on &hc->lock Chengfeng Ye
2023-07-27 4:46 ` Jakub Kicinski [this message]
2023-07-27 8:57 ` Chengfeng Ye
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=20230726214613.7fee0d7b@kernel.org \
--to=kuba@kernel.org \
--cc=alexanderduyck@fb.com \
--cc=davem@davemloft.net \
--cc=dg573847474@gmail.com \
--cc=duoming@zju.edu.cn \
--cc=isdn@linux-pingi.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yangyingliang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.