linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco.dolcini@toradex.com>
To: Francesco Dolcini <francesco.dolcini@toradex.com>
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: possible circular locking in kernfs_remove_by_name_ns/devinet_ioctl linux 6.0-rc3
Date: Thu, 1 Sep 2022 21:25:27 +0200	[thread overview]
Message-ID: <20220901192527.GA2269019@francesco-nb.int.toradex.com> (raw)
In-Reply-To: <20220901122129.GA493609@francesco-nb.int.toradex.com>

On Thu, Sep 01, 2022 at 02:21:29PM +0200, Francesco Dolcini wrote:
> [   21.629186] ======================================================
> [   21.635418] WARNING: possible circular locking dependency detected
> [   21.641646] 6.0.0-rc3 #7 Not tainted
> [   21.645256] ------------------------------------------------------
> [   21.651480] connmand/542 is trying to acquire lock:
> [   21.656399] c2ce1d70 (kn->active#9){++++}-{0:0}, at: kernfs_remove_by_name_ns+0x50/0xa0
> [   21.664516]
>                but task is already holding lock:
> [   21.670394] c17af6e0 (rtnl_mutex){+.+.}-{3:3}, at: devinet_ioctl+0xc8/0x870
> [   21.677441]
>                which lock already depends on the new lock.
...
> [   21.945318] Chain exists of:
>                  kn->active#9 --> udc_lock --> rtnl_mutex
> 
> [   21.954902]  Possible unsafe locking scenario:
> 
> [   21.960865]        CPU0                    CPU1
> [   21.965430]        ----                    ----
> [   21.969994]   lock(rtnl_mutex);
> [   21.973174]                                lock(udc_lock);
> [   21.978709]                                lock(rtnl_mutex);
> [   21.984419]   lock(kn->active#9);
> [   21.987779]
>                 *** DEADLOCK ***
> 
> [   21.993745] 1 lock held by connmand/542:
> [   21.997704]  #0: c17af6e0 (rtnl_mutex){+.+.}-{3:3}, at: devinet_ioctl+0xc8/0x870
> [   22.005191]
...
> I have not tried to bisect this yet, just probing if someone has already
> some idea on this.

Commit 2191c00855b0 ("USB: gadget: Fix use-after-free Read in usb_udc_uevent()")
introduced this, see
https://lore.kernel.org/all/20220901192204.GA2268599@francesco-nb.int.toradex.com/

Francesco


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2022-09-01 19:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 12:21 possible circular locking in kernfs_remove_by_name_ns/devinet_ioctl linux 6.0-rc3 Francesco Dolcini
2022-09-01 19:25 ` Francesco Dolcini [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=20220901192527.GA2269019@francesco-nb.int.toradex.com \
    --to=francesco.dolcini@toradex.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).