netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Deepanshu Kartikey <kartikey406@gmail.com>,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org
Cc: linma@zju.edu.cn, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	syzbot+4ef89409a235d804c6c2@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] net: nfc: fix deadlock between nfc_unregister_device and rfkill_fop_write
Date: Thu, 18 Dec 2025 16:54:43 +0100	[thread overview]
Message-ID: <b4c39e80-0ae5-480b-b2e7-e1b9d33d9e42@kernel.org> (raw)
In-Reply-To: <20251218012355.279940-1-kartikey406@gmail.com>

On 18/12/2025 02:23, Deepanshu Kartikey wrote:
> A deadlock can occur between nfc_unregister_device() and rfkill_fop_write()
> due to lock ordering inversion between device_lock and rfkill_global_mutex.
> 
> The problematic lock order is:
> 
> Thread A (rfkill_fop_write):
>   rfkill_fop_write()
>     mutex_lock(&rfkill_global_mutex)
>       rfkill_set_block()
>         nfc_rfkill_set_block()
>           nfc_dev_down()
>             device_lock(&dev->dev)    <- waits for device_lock
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof

  reply	other threads:[~2025-12-18 15:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18  1:23 [PATCH v2] net: nfc: fix deadlock between nfc_unregister_device and rfkill_fop_write Deepanshu Kartikey
2025-12-18 15:54 ` Krzysztof Kozlowski [this message]
2025-12-28  8:31 ` patchwork-bot+netdevbpf

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=b4c39e80-0ae5-480b-b2e7-e1b9d33d9e42@kernel.org \
    --to=krzk@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kartikey406@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linma@zju.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+4ef89409a235d804c6c2@syzkaller.appspotmail.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;
as well as URLs for NNTP newsgroup(s).