From: David Miller <davem@davemloft.net>
To: jarkao2@gmail.com
Cc: f6bvp@free.fr, ralf@linux-mips.org, adobriyan@gmail.com,
netdev@vger.kernel.org
Subject: Re: [PATCH][ROSE][AX25] af_ax25: possible circular locking
Date: Sat, 29 Dec 2007 19:14:43 -0800 (PST) [thread overview]
Message-ID: <20071229.191443.10947724.davem@davemloft.net> (raw)
In-Reply-To: <20071228214857.GA3290@ami.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Fri, 28 Dec 2007 22:48:57 +0100
> lockdep is worried about the different order here:
>
> #1 (rose_neigh_list_lock){-+..}:
> #3 (ax25_list_lock){-+..}:
>
> #0 (linkfail_lock){-+..}:
> #1 (rose_neigh_list_lock){-+..}:
>
> #3 (ax25_list_lock){-+..}:
> #0 (linkfail_lock){-+..}:
>
> So, ax25_list_lock could be taken before and after linkfail_lock.
> I don't know if this three-thread clutch is very probable (or
> possible at all), but it seems another bug reported by Bernard
> ("[...] system impossible to reboot with linux-2.6.24-rc5")
> could have similar source - namely ax25_list_lock held by
> ax25_kill_by_device() during ax25_disconnect(). It looks like the
> only place which calls ax25_disconnect() this way, so I guess, it
> isn't necessary.
>
> This patch is breaking the lock for ax25_disconnect(), with some
> failsafe and debugging added to detect unforeseen problems.
>
>
> Reported-and-tested-by: Bernard Pidoux <f6bvp@free.fr>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
I can't apply this fix, sorry.
You can't just drop this linked list lock and expect it to stay
consistent like that.
Once you drop it, any thread of control can get in there and delete
entries from the list.
Since we know it can happen, using a WARN_ON_ONCE(1) is not
appropriate. And if it triggers it will do the wrong thing, because
by branching back to "again" we can call ax25_disconnect() multiple
times on the same entry which isn't right.
You'll thus need to resolve this locking conflict more properly.
I know it's hard, but your current fix is worse because it adds
a new known bug.
next prev parent reply other threads:[~2007-12-30 3:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-17 10:06 [ROSE] [AX25] possible circular locking Bernard Pidoux F6BVP
2007-12-18 13:52 ` Jarek Poplawski
[not found] ` <476837BF.3070207@free.fr>
2007-12-18 22:04 ` Jarek Poplawski
2007-12-28 21:30 ` Pidoux
[not found] ` <47755FDB.2070501@free.fr>
2007-12-28 21:48 ` [PATCH][ROSE][AX25] af_ax25: " Jarek Poplawski
2007-12-30 3:14 ` David Miller [this message]
2007-12-30 14:13 ` Jarek Poplawski
2007-12-31 5:00 ` David Miller
2008-01-11 5:22 ` David Miller
2008-01-11 9:40 ` Jarek Poplawski
2008-01-12 19:48 ` Bernard Pidoux F6BVP
2008-01-11 21:40 ` [PATCH] [ROSE] two extra tab characters removed Bernard Pidoux F6BVP
2008-02-09 18:44 ` [PATCH][AX25] ax25_ds_timer: use mod_timer instead of add_timer Bernard Pidoux F6BVP
2008-02-09 19:39 ` Jarek Poplawski
2008-02-10 18:07 ` Bernard Pidoux F6BVP
2008-02-09 23:50 ` [PATCH][AX25] af_ax25: remove sock lock in ax25_info_show() Jarek Poplawski
2008-02-10 13:10 ` [PATCH v2][AX25] " Jarek Poplawski
2008-02-12 5:25 ` David Miller
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=20071229.191443.10947724.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=adobriyan@gmail.com \
--cc=f6bvp@free.fr \
--cc=jarkao2@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.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).