<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/netlink/genetlink.c, branch v3.12.27</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>net: Use netlink_ns_capable to verify the permisions of netlink messages</title>
<updated>2014-06-23T08:27:57+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2014-04-23T21:29:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=50b8b6e75fa0c08cef1e1ed30a7ab91f05bcb779'/>
<id>50b8b6e75fa0c08cef1e1ed30a7ab91f05bcb779</id>
<content type='text'>
[ Upstream commit 90f62cf30a78721641e08737bda787552428061e ]

It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.

To keep this from happening replace bare capable and ns_capable calls
with netlink_capable, netlink_net_calls and netlink_ns_capable calls.
Which act the same as the previous calls except they verify that the
opener of the socket had the desired permissions as well.

Reported-by: Andy Lutomirski &lt;luto@amacapital.net&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 90f62cf30a78721641e08737bda787552428061e ]

It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.

To keep this from happening replace bare capable and ns_capable calls
with netlink_capable, netlink_net_calls and netlink_ns_capable calls.
Which act the same as the previous calls except they verify that the
opener of the socket had the desired permissions as well.

Reported-by: Andy Lutomirski &lt;luto@amacapital.net&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genl: Hold reference on correct module while netlink-dump.</title>
<updated>2013-08-28T21:19:17+00:00</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2013-08-23T19:45:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=33c6b1f6b154894321f5734e50c66621e9134e7e'/>
<id>33c6b1f6b154894321f5734e50c66621e9134e7e</id>
<content type='text'>
netlink dump operations take module as parameter to hold
reference for entire netlink dump duration.
Currently it holds ref only on genl module which is not correct
when we use ops registered to genl from another module.
Following patch adds module pointer to genl_ops so that netlink
can hold ref count on it.

CC: Jesse Gross &lt;jesse@nicira.com&gt;
CC: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
netlink dump operations take module as parameter to hold
reference for entire netlink dump duration.
Currently it holds ref only on genl module which is not correct
when we use ops registered to genl from another module.
Following patch adds module pointer to genl_ops so that netlink
can hold ref count on it.

CC: Jesse Gross &lt;jesse@nicira.com&gt;
CC: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genl: Fix genl dumpit() locking.</title>
<updated>2013-08-28T21:19:17+00:00</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2013-08-23T19:44:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9b96309c5b0b9e466773c07a5bc8b7b68fcf010a'/>
<id>9b96309c5b0b9e466773c07a5bc8b7b68fcf010a</id>
<content type='text'>
In case of genl-family with parallel ops off, dumpif() callback
is expected to run under genl_lock, But commit def3117493eafd9df
(genl: Allow concurrent genl callbacks.) changed this behaviour
where only first dumpit() op was called under genl-lock.
For subsequent dump, only nlk-&gt;cb_lock was taken.
Following patch fixes it by defining locked dumpit() and done()
callback which takes care of genl-locking.

CC: Jesse Gross &lt;jesse@nicira.com&gt;
CC: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In case of genl-family with parallel ops off, dumpif() callback
is expected to run under genl_lock, But commit def3117493eafd9df
(genl: Allow concurrent genl callbacks.) changed this behaviour
where only first dumpit() op was called under genl-lock.
For subsequent dump, only nlk-&gt;cb_lock was taken.
Following patch fixes it by defining locked dumpit() and done()
callback which takes care of genl-locking.

CC: Jesse Gross &lt;jesse@nicira.com&gt;
CC: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "genetlink: fix family dump race"</title>
<updated>2013-08-22T20:24:02+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-08-21T14:08:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9d47b380563174e5c15776ce6ca9bab4ee7d59e3'/>
<id>9d47b380563174e5c15776ce6ca9bab4ee7d59e3</id>
<content type='text'>
This reverts commit 58ad436fcf49810aa006016107f494c9ac9013db.

It turns out that the change introduced a potential deadlock
by causing a locking dependency with netlink's cb_mutex. I
can't seem to find a way to resolve this without doing major
changes to the locking, so revert this.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 58ad436fcf49810aa006016107f494c9ac9013db.

It turns out that the change introduced a potential deadlock
by causing a locking dependency with netlink's cb_mutex. I
can't seem to find a way to resolve this without doing major
changes to the locking, so revert this.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genetlink: fix family dump race</title>
<updated>2013-08-13T07:57:06+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-08-13T07:04:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=58ad436fcf49810aa006016107f494c9ac9013db'/>
<id>58ad436fcf49810aa006016107f494c9ac9013db</id>
<content type='text'>
When dumping generic netlink families, only the first dump call
is locked with genl_lock(), which protects the list of families,
and thus subsequent calls can access the data without locking,
racing against family addition/removal. This can cause a crash.
Fix it - the locking needs to be conditional because the first
time around it's already locked.

A similar bug was reported to me on an old kernel (3.4.47) but
the exact scenario that happened there is no longer possible,
on those kernels the first round wasn't locked either. Looking
at the current code I found the race described above, which had
also existed on the old kernel.

Cc: stable@vger.kernel.org
Reported-by: Andrei Otcheretianski &lt;andrei.otcheretianski@intel.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When dumping generic netlink families, only the first dump call
is locked with genl_lock(), which protects the list of families,
and thus subsequent calls can access the data without locking,
racing against family addition/removal. This can cause a crash.
Fix it - the locking needs to be conditional because the first
time around it's already locked.

A similar bug was reported to me on an old kernel (3.4.47) but
the exact scenario that happened there is no longer possible,
on those kernels the first round wasn't locked either. Looking
at the current code I found the race described above, which had
also existed on the old kernel.

Cc: stable@vger.kernel.org
Reported-by: Andrei Otcheretianski &lt;andrei.otcheretianski@intel.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genetlink: fix usage of NLM_F_EXCL or NLM_F_REPLACE</title>
<updated>2013-07-30T23:43:19+00:00</updated>
<author>
<name>Pablo Neira</name>
<email>pablo@netfilter.org</email>
</author>
<published>2013-07-29T10:30:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e1ee3673a83cc02b6b5e43c9e647d8dd5e1c4e26'/>
<id>e1ee3673a83cc02b6b5e43c9e647d8dd5e1c4e26</id>
<content type='text'>
Currently, it is not possible to use neither NLM_F_EXCL nor
NLM_F_REPLACE from genetlink. This is due to this checking in
genl_family_rcv_msg:

	if (nlh-&gt;nlmsg_flags &amp; NLM_F_DUMP)

NLM_F_DUMP is NLM_F_MATCH|NLM_F_ROOT. Thus, if NLM_F_EXCL or
NLM_F_REPLACE flag is set, genetlink believes that you're
requesting a dump and it calls the .dumpit callback.

The solution that I propose is to refine this checking to
make it stricter:

	if ((nlh-&gt;nlmsg_flags &amp; NLM_F_DUMP) == NLM_F_DUMP)

And given the combination NLM_F_REPLACE and NLM_F_EXCL does
not make sense to me, it removes the ambiguity.

There was a patch that tried to fix this some time ago (0ab03c2
netlink: test for all flags of the NLM_F_DUMP composite) but it
tried to resolve this ambiguity in *all* existing netlink subsystems,
not only genetlink. That patch was reverted since it broke iproute2,
which is using NLM_F_ROOT to request the dump of the routing cache.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, it is not possible to use neither NLM_F_EXCL nor
NLM_F_REPLACE from genetlink. This is due to this checking in
genl_family_rcv_msg:

	if (nlh-&gt;nlmsg_flags &amp; NLM_F_DUMP)

NLM_F_DUMP is NLM_F_MATCH|NLM_F_ROOT. Thus, if NLM_F_EXCL or
NLM_F_REPLACE flag is set, genetlink believes that you're
requesting a dump and it calls the .dumpit callback.

The solution that I propose is to refine this checking to
make it stricter:

	if ((nlh-&gt;nlmsg_flags &amp; NLM_F_DUMP) == NLM_F_DUMP)

And given the combination NLM_F_REPLACE and NLM_F_EXCL does
not make sense to me, it removes the ambiguity.

There was a patch that tried to fix this some time ago (0ab03c2
netlink: test for all flags of the NLM_F_DUMP composite) but it
tried to resolve this ambiguity in *all* existing netlink subsystems,
not only genetlink. That patch was reverted since it broke iproute2,
which is using NLM_F_ROOT to request the dump of the routing cache.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genetlink: release cb_lock before requesting additional module</title>
<updated>2013-07-28T05:19:20+00:00</updated>
<author>
<name>Stanislaw Gruszka</name>
<email>sgruszka@redhat.com</email>
</author>
<published>2013-07-26T09:00:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c74f2b2678f40b80265dd53556f1f778c8e1823f'/>
<id>c74f2b2678f40b80265dd53556f1f778c8e1823f</id>
<content type='text'>
Requesting external module with cb_lock taken can result in
the deadlock like showed below:

[ 2458.111347] Showing all locks held in the system:
[ 2458.111347] 1 lock held by NetworkManager/582:
[ 2458.111347]  #0:  (cb_lock){++++++}, at: [&lt;ffffffff8162bc79&gt;] genl_rcv+0x19/0x40
[ 2458.111347] 1 lock held by modprobe/603:
[ 2458.111347]  #0:  (cb_lock){++++++}, at: [&lt;ffffffff8162baa5&gt;] genl_lock_all+0x15/0x30

[ 2461.579457] SysRq : Show Blocked State
[ 2461.580103]   task                        PC stack   pid father
[ 2461.580103] NetworkManager  D ffff880034b84500  4040   582      1 0x00000080
[ 2461.580103]  ffff8800197ff720 0000000000000046 00000000001d5340 ffff8800197fffd8
[ 2461.580103]  ffff8800197fffd8 00000000001d5340 ffff880019631700 7fffffffffffffff
[ 2461.580103]  ffff8800197ff880 ffff8800197ff878 ffff880019631700 ffff880019631700
[ 2461.580103] Call Trace:
[ 2461.580103]  [&lt;ffffffff817355f9&gt;] schedule+0x29/0x70
[ 2461.580103]  [&lt;ffffffff81731ad1&gt;] schedule_timeout+0x1c1/0x360
[ 2461.580103]  [&lt;ffffffff810e69eb&gt;] ? mark_held_locks+0xbb/0x140
[ 2461.580103]  [&lt;ffffffff817377ac&gt;] ? _raw_spin_unlock_irq+0x2c/0x50
[ 2461.580103]  [&lt;ffffffff810e6b6d&gt;] ? trace_hardirqs_on_caller+0xfd/0x1c0
[ 2461.580103]  [&lt;ffffffff81736398&gt;] wait_for_completion_killable+0xe8/0x170
[ 2461.580103]  [&lt;ffffffff810b7fa0&gt;] ? wake_up_state+0x20/0x20
[ 2461.580103]  [&lt;ffffffff81095825&gt;] call_usermodehelper_exec+0x1a5/0x210
[ 2461.580103]  [&lt;ffffffff817362ed&gt;] ? wait_for_completion_killable+0x3d/0x170
[ 2461.580103]  [&lt;ffffffff81095cc3&gt;] __request_module+0x1b3/0x370
[ 2461.580103]  [&lt;ffffffff810e6b6d&gt;] ? trace_hardirqs_on_caller+0xfd/0x1c0
[ 2461.580103]  [&lt;ffffffff8162c5c9&gt;] ctrl_getfamily+0x159/0x190
[ 2461.580103]  [&lt;ffffffff8162d8a4&gt;] genl_family_rcv_msg+0x1f4/0x2e0
[ 2461.580103]  [&lt;ffffffff8162d990&gt;] ? genl_family_rcv_msg+0x2e0/0x2e0
[ 2461.580103]  [&lt;ffffffff8162da1e&gt;] genl_rcv_msg+0x8e/0xd0
[ 2461.580103]  [&lt;ffffffff8162b729&gt;] netlink_rcv_skb+0xa9/0xc0
[ 2461.580103]  [&lt;ffffffff8162bc88&gt;] genl_rcv+0x28/0x40
[ 2461.580103]  [&lt;ffffffff8162ad6d&gt;] netlink_unicast+0xdd/0x190
[ 2461.580103]  [&lt;ffffffff8162b149&gt;] netlink_sendmsg+0x329/0x750
[ 2461.580103]  [&lt;ffffffff815db849&gt;] sock_sendmsg+0x99/0xd0
[ 2461.580103]  [&lt;ffffffff810bb58f&gt;] ? local_clock+0x5f/0x70
[ 2461.580103]  [&lt;ffffffff810e96e8&gt;] ? lock_release_non_nested+0x308/0x350
[ 2461.580103]  [&lt;ffffffff815dbc6e&gt;] ___sys_sendmsg+0x39e/0x3b0
[ 2461.580103]  [&lt;ffffffff810565af&gt;] ? kvm_clock_read+0x2f/0x50
[ 2461.580103]  [&lt;ffffffff810218b9&gt;] ? sched_clock+0x9/0x10
[ 2461.580103]  [&lt;ffffffff810bb2bd&gt;] ? sched_clock_local+0x1d/0x80
[ 2461.580103]  [&lt;ffffffff810bb448&gt;] ? sched_clock_cpu+0xa8/0x100
[ 2461.580103]  [&lt;ffffffff810e33ad&gt;] ? trace_hardirqs_off+0xd/0x10
[ 2461.580103]  [&lt;ffffffff810bb58f&gt;] ? local_clock+0x5f/0x70
[ 2461.580103]  [&lt;ffffffff810e3f7f&gt;] ? lock_release_holdtime.part.28+0xf/0x1a0
[ 2461.580103]  [&lt;ffffffff8120fec9&gt;] ? fget_light+0xf9/0x510
[ 2461.580103]  [&lt;ffffffff8120fe0c&gt;] ? fget_light+0x3c/0x510
[ 2461.580103]  [&lt;ffffffff815dd1d2&gt;] __sys_sendmsg+0x42/0x80
[ 2461.580103]  [&lt;ffffffff815dd222&gt;] SyS_sendmsg+0x12/0x20
[ 2461.580103]  [&lt;ffffffff81741ad9&gt;] system_call_fastpath+0x16/0x1b
[ 2461.580103] modprobe        D ffff88000f2c8000  4632   603    602 0x00000080
[ 2461.580103]  ffff88000f04fba8 0000000000000046 00000000001d5340 ffff88000f04ffd8
[ 2461.580103]  ffff88000f04ffd8 00000000001d5340 ffff8800377d4500 ffff8800377d4500
[ 2461.580103]  ffffffff81d0b260 ffffffff81d0b268 ffffffff00000000 ffffffff81d0b2b0
[ 2461.580103] Call Trace:
[ 2461.580103]  [&lt;ffffffff817355f9&gt;] schedule+0x29/0x70
[ 2461.580103]  [&lt;ffffffff81736d4d&gt;] rwsem_down_write_failed+0xed/0x1a0
[ 2461.580103]  [&lt;ffffffff810bb200&gt;] ? update_cpu_load_active+0x10/0xb0
[ 2461.580103]  [&lt;ffffffff8137b473&gt;] call_rwsem_down_write_failed+0x13/0x20
[ 2461.580103]  [&lt;ffffffff8173492d&gt;] ? down_write+0x9d/0xb2
[ 2461.580103]  [&lt;ffffffff8162baa5&gt;] ? genl_lock_all+0x15/0x30
[ 2461.580103]  [&lt;ffffffff8162baa5&gt;] genl_lock_all+0x15/0x30
[ 2461.580103]  [&lt;ffffffff8162cbb3&gt;] genl_register_family+0x53/0x1f0
[ 2461.580103]  [&lt;ffffffffa01dc000&gt;] ? 0xffffffffa01dbfff
[ 2461.580103]  [&lt;ffffffff8162d650&gt;] genl_register_family_with_ops+0x20/0x80
[ 2461.580103]  [&lt;ffffffffa01dc000&gt;] ? 0xffffffffa01dbfff
[ 2461.580103]  [&lt;ffffffffa017fe84&gt;] nl80211_init+0x24/0xf0 [cfg80211]
[ 2461.580103]  [&lt;ffffffffa01dc000&gt;] ? 0xffffffffa01dbfff
[ 2461.580103]  [&lt;ffffffffa01dc043&gt;] cfg80211_init+0x43/0xdb [cfg80211]
[ 2461.580103]  [&lt;ffffffff810020fa&gt;] do_one_initcall+0xfa/0x1b0
[ 2461.580103]  [&lt;ffffffff8105cb93&gt;] ? set_memory_nx+0x43/0x50
[ 2461.580103]  [&lt;ffffffff810f75af&gt;] load_module+0x1c6f/0x27f0
[ 2461.580103]  [&lt;ffffffff810f2c90&gt;] ? store_uevent+0x40/0x40
[ 2461.580103]  [&lt;ffffffff810f82c6&gt;] SyS_finit_module+0x86/0xb0
[ 2461.580103]  [&lt;ffffffff81741ad9&gt;] system_call_fastpath+0x16/0x1b
[ 2461.580103] Sched Debug Version: v0.10, 3.11.0-0.rc1.git4.1.fc20.x86_64 #1

Problem start to happen after adding net-pf-16-proto-16-family-nl80211
alias name to cfg80211 module by below commit (though that commit
itself is perfectly fine):

commit fb4e156886ce6e8309e912d8b370d192330d19d3
Author: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Date:   Sun Apr 28 16:22:06 2013 -0700

    nl80211: Add generic netlink module alias for cfg80211/nl80211

Reported-and-tested-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reported-by: Richard W.M. Jones &lt;rjones@redhat.com&gt;
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Reviewed-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Requesting external module with cb_lock taken can result in
the deadlock like showed below:

[ 2458.111347] Showing all locks held in the system:
[ 2458.111347] 1 lock held by NetworkManager/582:
[ 2458.111347]  #0:  (cb_lock){++++++}, at: [&lt;ffffffff8162bc79&gt;] genl_rcv+0x19/0x40
[ 2458.111347] 1 lock held by modprobe/603:
[ 2458.111347]  #0:  (cb_lock){++++++}, at: [&lt;ffffffff8162baa5&gt;] genl_lock_all+0x15/0x30

[ 2461.579457] SysRq : Show Blocked State
[ 2461.580103]   task                        PC stack   pid father
[ 2461.580103] NetworkManager  D ffff880034b84500  4040   582      1 0x00000080
[ 2461.580103]  ffff8800197ff720 0000000000000046 00000000001d5340 ffff8800197fffd8
[ 2461.580103]  ffff8800197fffd8 00000000001d5340 ffff880019631700 7fffffffffffffff
[ 2461.580103]  ffff8800197ff880 ffff8800197ff878 ffff880019631700 ffff880019631700
[ 2461.580103] Call Trace:
[ 2461.580103]  [&lt;ffffffff817355f9&gt;] schedule+0x29/0x70
[ 2461.580103]  [&lt;ffffffff81731ad1&gt;] schedule_timeout+0x1c1/0x360
[ 2461.580103]  [&lt;ffffffff810e69eb&gt;] ? mark_held_locks+0xbb/0x140
[ 2461.580103]  [&lt;ffffffff817377ac&gt;] ? _raw_spin_unlock_irq+0x2c/0x50
[ 2461.580103]  [&lt;ffffffff810e6b6d&gt;] ? trace_hardirqs_on_caller+0xfd/0x1c0
[ 2461.580103]  [&lt;ffffffff81736398&gt;] wait_for_completion_killable+0xe8/0x170
[ 2461.580103]  [&lt;ffffffff810b7fa0&gt;] ? wake_up_state+0x20/0x20
[ 2461.580103]  [&lt;ffffffff81095825&gt;] call_usermodehelper_exec+0x1a5/0x210
[ 2461.580103]  [&lt;ffffffff817362ed&gt;] ? wait_for_completion_killable+0x3d/0x170
[ 2461.580103]  [&lt;ffffffff81095cc3&gt;] __request_module+0x1b3/0x370
[ 2461.580103]  [&lt;ffffffff810e6b6d&gt;] ? trace_hardirqs_on_caller+0xfd/0x1c0
[ 2461.580103]  [&lt;ffffffff8162c5c9&gt;] ctrl_getfamily+0x159/0x190
[ 2461.580103]  [&lt;ffffffff8162d8a4&gt;] genl_family_rcv_msg+0x1f4/0x2e0
[ 2461.580103]  [&lt;ffffffff8162d990&gt;] ? genl_family_rcv_msg+0x2e0/0x2e0
[ 2461.580103]  [&lt;ffffffff8162da1e&gt;] genl_rcv_msg+0x8e/0xd0
[ 2461.580103]  [&lt;ffffffff8162b729&gt;] netlink_rcv_skb+0xa9/0xc0
[ 2461.580103]  [&lt;ffffffff8162bc88&gt;] genl_rcv+0x28/0x40
[ 2461.580103]  [&lt;ffffffff8162ad6d&gt;] netlink_unicast+0xdd/0x190
[ 2461.580103]  [&lt;ffffffff8162b149&gt;] netlink_sendmsg+0x329/0x750
[ 2461.580103]  [&lt;ffffffff815db849&gt;] sock_sendmsg+0x99/0xd0
[ 2461.580103]  [&lt;ffffffff810bb58f&gt;] ? local_clock+0x5f/0x70
[ 2461.580103]  [&lt;ffffffff810e96e8&gt;] ? lock_release_non_nested+0x308/0x350
[ 2461.580103]  [&lt;ffffffff815dbc6e&gt;] ___sys_sendmsg+0x39e/0x3b0
[ 2461.580103]  [&lt;ffffffff810565af&gt;] ? kvm_clock_read+0x2f/0x50
[ 2461.580103]  [&lt;ffffffff810218b9&gt;] ? sched_clock+0x9/0x10
[ 2461.580103]  [&lt;ffffffff810bb2bd&gt;] ? sched_clock_local+0x1d/0x80
[ 2461.580103]  [&lt;ffffffff810bb448&gt;] ? sched_clock_cpu+0xa8/0x100
[ 2461.580103]  [&lt;ffffffff810e33ad&gt;] ? trace_hardirqs_off+0xd/0x10
[ 2461.580103]  [&lt;ffffffff810bb58f&gt;] ? local_clock+0x5f/0x70
[ 2461.580103]  [&lt;ffffffff810e3f7f&gt;] ? lock_release_holdtime.part.28+0xf/0x1a0
[ 2461.580103]  [&lt;ffffffff8120fec9&gt;] ? fget_light+0xf9/0x510
[ 2461.580103]  [&lt;ffffffff8120fe0c&gt;] ? fget_light+0x3c/0x510
[ 2461.580103]  [&lt;ffffffff815dd1d2&gt;] __sys_sendmsg+0x42/0x80
[ 2461.580103]  [&lt;ffffffff815dd222&gt;] SyS_sendmsg+0x12/0x20
[ 2461.580103]  [&lt;ffffffff81741ad9&gt;] system_call_fastpath+0x16/0x1b
[ 2461.580103] modprobe        D ffff88000f2c8000  4632   603    602 0x00000080
[ 2461.580103]  ffff88000f04fba8 0000000000000046 00000000001d5340 ffff88000f04ffd8
[ 2461.580103]  ffff88000f04ffd8 00000000001d5340 ffff8800377d4500 ffff8800377d4500
[ 2461.580103]  ffffffff81d0b260 ffffffff81d0b268 ffffffff00000000 ffffffff81d0b2b0
[ 2461.580103] Call Trace:
[ 2461.580103]  [&lt;ffffffff817355f9&gt;] schedule+0x29/0x70
[ 2461.580103]  [&lt;ffffffff81736d4d&gt;] rwsem_down_write_failed+0xed/0x1a0
[ 2461.580103]  [&lt;ffffffff810bb200&gt;] ? update_cpu_load_active+0x10/0xb0
[ 2461.580103]  [&lt;ffffffff8137b473&gt;] call_rwsem_down_write_failed+0x13/0x20
[ 2461.580103]  [&lt;ffffffff8173492d&gt;] ? down_write+0x9d/0xb2
[ 2461.580103]  [&lt;ffffffff8162baa5&gt;] ? genl_lock_all+0x15/0x30
[ 2461.580103]  [&lt;ffffffff8162baa5&gt;] genl_lock_all+0x15/0x30
[ 2461.580103]  [&lt;ffffffff8162cbb3&gt;] genl_register_family+0x53/0x1f0
[ 2461.580103]  [&lt;ffffffffa01dc000&gt;] ? 0xffffffffa01dbfff
[ 2461.580103]  [&lt;ffffffff8162d650&gt;] genl_register_family_with_ops+0x20/0x80
[ 2461.580103]  [&lt;ffffffffa01dc000&gt;] ? 0xffffffffa01dbfff
[ 2461.580103]  [&lt;ffffffffa017fe84&gt;] nl80211_init+0x24/0xf0 [cfg80211]
[ 2461.580103]  [&lt;ffffffffa01dc000&gt;] ? 0xffffffffa01dbfff
[ 2461.580103]  [&lt;ffffffffa01dc043&gt;] cfg80211_init+0x43/0xdb [cfg80211]
[ 2461.580103]  [&lt;ffffffff810020fa&gt;] do_one_initcall+0xfa/0x1b0
[ 2461.580103]  [&lt;ffffffff8105cb93&gt;] ? set_memory_nx+0x43/0x50
[ 2461.580103]  [&lt;ffffffff810f75af&gt;] load_module+0x1c6f/0x27f0
[ 2461.580103]  [&lt;ffffffff810f2c90&gt;] ? store_uevent+0x40/0x40
[ 2461.580103]  [&lt;ffffffff810f82c6&gt;] SyS_finit_module+0x86/0xb0
[ 2461.580103]  [&lt;ffffffff81741ad9&gt;] system_call_fastpath+0x16/0x1b
[ 2461.580103] Sched Debug Version: v0.10, 3.11.0-0.rc1.git4.1.fc20.x86_64 #1

Problem start to happen after adding net-pf-16-proto-16-family-nl80211
alias name to cfg80211 module by below commit (though that commit
itself is perfectly fine):

commit fb4e156886ce6e8309e912d8b370d192330d19d3
Author: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Date:   Sun Apr 28 16:22:06 2013 -0700

    nl80211: Add generic netlink module alias for cfg80211/nl80211

Reported-and-tested-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reported-by: Richard W.M. Jones &lt;rjones@redhat.com&gt;
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Reviewed-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genetlink: fix possible memory leak in genl_family_rcv_msg()</title>
<updated>2013-04-27T03:25:39+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>yongjun_wei@trendmicro.com.cn</email>
</author>
<published>2013-04-26T15:34:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=50754d2188b04a679a249fb57751542643a436e0'/>
<id>50754d2188b04a679a249fb57751542643a436e0</id>
<content type='text'>
'attrbuf' is malloced in genl_family_rcv_msg() when family-&gt;maxattr &amp;&amp;
family-&gt;parallel_ops, thus should be freed before leaving from the error
handling cases, otherwise it will cause memory leak.

Introduced by commit def3117493eafd9dfa1f809d861e0031b2cc8a07
(genl: Allow concurrent genl callbacks.)

Signed-off-by: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'attrbuf' is malloced in genl_family_rcv_msg() when family-&gt;maxattr &amp;&amp;
family-&gt;parallel_ops, thus should be freed before leaving from the error
handling cases, otherwise it will cause memory leak.

Introduced by commit def3117493eafd9dfa1f809d861e0031b2cc8a07
(genl: Allow concurrent genl callbacks.)

Signed-off-by: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genl: Allow concurrent genl callbacks.</title>
<updated>2013-04-25T05:43:15+00:00</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2013-04-23T07:48:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=def3117493eafd9dfa1f809d861e0031b2cc8a07'/>
<id>def3117493eafd9dfa1f809d861e0031b2cc8a07</id>
<content type='text'>
All genl callbacks are serialized by genl-mutex. This can become
bottleneck in multi threaded case.
Following patch adds an parameter to genl_family so that a
particular family can get concurrent netlink callback without
genl_lock held.
New rw-sem is used to protect genl callback from genl family unregister.
in case of parallel_ops genl-family read-lock is taken for callbacks and
write lock is taken for register or unregistration for any family.
In case of locked genl family semaphore and gel-mutex is locked for
any openration.

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All genl callbacks are serialized by genl-mutex. This can become
bottleneck in multi threaded case.
Following patch adds an parameter to genl_family so that a
particular family can get concurrent netlink callback without
genl_lock held.
New rw-sem is used to protect genl callback from genl family unregister.
in case of parallel_ops genl-family read-lock is taken for callbacks and
write lock is taken for register or unregistration for any family.
In case of locked genl family semaphore and gel-mutex is locked for
any openration.

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genetlink: trigger BUG_ON if a group name is too long</title>
<updated>2013-03-20T16:05:51+00:00</updated>
<author>
<name>Masatake YAMATO</name>
<email>yamato@redhat.com</email>
</author>
<published>2013-03-19T01:47:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f1e79e208076ffe7bad97158275f1c572c04f5c7'/>
<id>f1e79e208076ffe7bad97158275f1c572c04f5c7</id>
<content type='text'>
Trigger BUG_ON if a group name is longer than GENL_NAMSIZ.

Signed-off-by: Masatake YAMATO &lt;yamato@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trigger BUG_ON if a group name is longer than GENL_NAMSIZ.

Signed-off-by: Masatake YAMATO &lt;yamato@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
