login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
September
»
6
Re: [PATCH 0/2] Fix (improve) deadlock condition on module removal netfilter socket option removal
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Patrick McHardy
Subject:
Re: [PATCH 0/2] Fix (improve) deadlock condition on module removal netfilter socket option removal
Date: Thursday, September 6, 2007 - 3:33 am
Neil Horman wrote:
quoted text
> On Thu, Sep 06, 2007 at 02:13:26AM +1000, Rusty Russell wrote: > >>On Wed, 2007-09-05 at 17:22 +0200, Patrick McHardy wrote: >> >>>But I'm wondering, wouldn't module refcounting alone fix this problem? >>>If we make nf_sockopt() call try_module_get(ops->owner), remove_module() >>>on ip_tables.ko would simply fail because the refcount is above zero >>>(so it would fail at point 3 above). Am I missing something important? >> >>Yes, that seems the correct solution to me, too. ISTR that this code >>predates the current module code. >> >>Rusty. > > > Thanks guys- > When I first started looking at this problem I would have agreed with > you, that module reference counting alone would fix the problem. However, > delete_module can work in either a non-blocking or a blocking mode. rmmod > passes O_NONBLOCK to delete module, and so is fine, but modprobe does not. So > if you currently use modprobe -r to remove modules (as the iptables service > script nominally does), modprobe winds up waiting in the kernel for the module > reference count to become zero. Since we can hold a reference to the module > being removed in the same path that forks a modprobe request to load that same > module (which then blocks on the first modprobes fcntl lock), we still get > deadlock. The way I fixed this was by use of the second patch, which brings > modprobes behavior into line with the rmmod utility (which is to default to > non-blocking operation), leading to the remove_module failure and breaking of > the deadlock that you describe above.
Thanks for the explanation, I've applied your patch. -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/2] Fix (improve) deadlock condition on module rem ...
, Neil Horman
, (Tue Sep 4, 1:24 pm)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Patrick McHardy
, (Wed Sep 5, 8:22 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Rusty Russell
, (Wed Sep 5, 9:13 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Neil Horman
, (Wed Sep 5, 10:08 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Rusty Russell
, (Wed Sep 5, 10:41 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Jon Masters
, (Wed Sep 5, 11:19 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Neil Horman
, (Wed Sep 5, 12:27 pm)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Jon Masters
, (Wed Sep 5, 1:17 pm)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Rusty Russell
, (Wed Sep 5, 1:51 pm)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Jon Masters
, (Wed Sep 5, 1:59 pm)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Jon Masters
, (Wed Sep 5, 2:39 pm)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Neil Horman
, (Wed Sep 5, 5:17 pm)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Patrick McHardy
, (Thu Sep 6, 3:33 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Neil Horman
, (Thu Sep 6, 4:08 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Neil Horman
, (Thu Sep 6, 5:55 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Jon Masters
, (Thu Sep 6, 6:35 am)
Re: [PATCH 0/2] Fix (improve) deadlock condition on module ...
, Neil Horman
, (Thu Sep 6, 8:40 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
FUJITA Tomonori
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Uwe Kleine-König
Re: [PATCH v2] ARM: allow, but warn, when issuing ioremap() on RAM
Ingo Molnar
Re: [RFC/RFT PATCH] sched: automated per tty task groups
Bart Van Assche
Re: Integration of SCST in the mainstream Linux kernel
Rafael J. Wysocki
Re: Why do so many machines need "noapic"?
git
:
Mike Miller
git message
Junio C Hamano
Re: [PATCH] Detached HEAD (experimental)
Stefan Richter
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Petr Baudis
Re: PPC SHA-1 Updates in "pu"
git-commits-head
:
Linux Kernel Mailing List
libata: disable ATAPI AN by default
Linux Kernel Mailing List
ARM: 5905/1: ARM: Global ASID allocation on SMP
Linux Kernel Mailing List
Disallow gcc versions 4.1.{0,1}
Linux Kernel Mailing List
timer: Try to survive timer callback preempt_count leak
Linux Kernel Mailing List
Documentation/timers/hpet_example.c: only build on X86
linux-netdev
:
Arnaldo Carvalho de Melo
Re: [PATCH 06/37] dccp: Limit feature negotiation to connection setup phase
Gerrit Renker
[PATCH 1/5] dccp: Initialisation framework for feature negotiation
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Badalian Vyacheslav
Re: tc filter flow hash question
openbsd-misc
:
Stuart Henderson
Re: Kuro5hin: OpenBSD Founder Theo deRaadt Has Conflict of Interest With AMD
Christian Weisgerber
Re: CARP with a single public IP address
Darrin Chandler
Re: strange output on openbsd C code
KURS ENGLESKOG JEZIKA NA 10 CD-a
AUDIO-VIZUELNA METODA UCENJA ENGLESKOG JEZIKA na 10 CD-a
Marco Peereboom
Re: OpenBSD culture?
Colocation donated by:
Syndicate