From: Greg KH <gregkh@linuxfoundation.org>
To: Chengfeng Ye <dg573847474@gmail.com>
Cc: scott.branden@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, arnd@arndb.de,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] misc: bcm_vk: Fix potential deadlock on &vk->ctx_lock
Date: Wed, 28 Jun 2023 13:00:34 +0200 [thread overview]
Message-ID: <2023062851-gutter-rudder-5c2d@gregkh> (raw)
In-Reply-To: <20230628105250.40874-1-dg573847474@gmail.com>
On Wed, Jun 28, 2023 at 10:52:50AM +0000, Chengfeng Ye wrote:
> As &vk->ctx_lock is acquired by timer bcm_vk_hb_poll() under softirq
> context, other process context code should disable irq or bottom-half
> before acquire the same lock, otherwise deadlock could happen if the
> timer preempt the execution while the lock is held in process context
> on the same CPU.
>
> Possible deadlock scenario
> bcm_vk_open()
> -> bcm_vk_get_ctx()
> -> spin_lock(&vk->ctx_lock)
> <timer iterrupt>
> -> bcm_vk_hb_poll()
> -> bcm_vk_blk_drv_access()
> -> spin_lock_irqsave(&vk->ctx_lock, flags) (deadlock here)
>
> This flaw was found using an experimental static analysis tool we are
> developing for irq-related deadlock.
>
> The tentative patch fix the potential deadlock by spin_lock_irqsave().
how was this tested? As per the file,
Documentation/process/researcher-guidelines.rst, you have to show this.
thanks,
greg k-h
next prev parent reply other threads:[~2023-06-28 11:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 10:52 [PATCH] misc: bcm_vk: Fix potential deadlock on &vk->ctx_lock Chengfeng Ye
2023-06-28 11:00 ` Greg KH [this message]
2023-06-28 11:32 ` 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=2023062851-gutter-rudder-5c2d@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dg573847474@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=scott.branden@broadcom.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.