<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/netlink, branch v3.10.8</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>genetlink: fix family dump race</title>
<updated>2013-08-20T15:43:03+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=aab4f8d490ef8c184d854d5f630438c10406765c'/>
<id>aab4f8d490ef8c184d854d5f630438c10406765c</id>
<content type='text'>
commit 58ad436fcf49810aa006016107f494c9ac9013db upstream.

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.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 58ad436fcf49810aa006016107f494c9ac9013db upstream.

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.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>genetlink: release cb_lock before requesting additional module</title>
<updated>2013-08-12T01:35:25+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=1aa1e4cd9ea8a50f610c86ea324f9de4263ac4bc'/>
<id>1aa1e4cd9ea8a50f610c86ea324f9de4263ac4bc</id>
<content type='text'>
[ Upstream commit c74f2b2678f40b80265dd53556f1f778c8e1823f ]

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit c74f2b2678f40b80265dd53556f1f778c8e1823f ]

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: fix error propagation in netlink_mmap()</title>
<updated>2013-06-11T09:52:47+00:00</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2013-06-11T09:52:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7cdbac71f911494aa7d0343be23c092ca84a5ed4'/>
<id>7cdbac71f911494aa7d0343be23c092ca84a5ed4</id>
<content type='text'>
Return the error if something went wrong instead of unconditionally
returning 0.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&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>
Return the error if something went wrong instead of unconditionally
returning 0.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: fix sk_buff head without data area</title>
<updated>2013-06-05T00:26:49+00:00</updated>
<author>
<name>Pablo Neira</name>
<email>pablo@netfilter.org</email>
</author>
<published>2013-06-03T09:28:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5e71d9d77c07fa7d4c42287a177f7b738d0cd4b9'/>
<id>5e71d9d77c07fa7d4c42287a177f7b738d0cd4b9</id>
<content type='text'>
Eric Dumazet spotted that we have to check skb-&gt;head instead
of skb-&gt;data as skb-&gt;head points to the beginning of the
data area of the skbuff. Similarly, we have to initialize the
skb-&gt;head pointer, not skb-&gt;data in __alloc_skb_head.

After this fix, netlink crashes in the release path of the
sk_buff, so let's fix that as well.

This bug was introduced in (0ebd0ac net: add function to
allocate sk_buff head without data area).

Reported-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
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>
Eric Dumazet spotted that we have to check skb-&gt;head instead
of skb-&gt;data as skb-&gt;head points to the beginning of the
data area of the skbuff. Similarly, we have to initialize the
skb-&gt;head pointer, not skb-&gt;data in __alloc_skb_head.

After this fix, netlink crashes in the release path of the
sk_buff, so let's fix that as well.

This bug was introduced in (0ebd0ac net: add function to
allocate sk_buff head without data area).

Reported-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
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>netlink: kconfig: move mmap i/o into netlink kconfig</title>
<updated>2013-05-01T19:02:42+00:00</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2013-05-01T01:37:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ee1bec9b3b49ea05e97ef40a3d38b70628cb947a'/>
<id>ee1bec9b3b49ea05e97ef40a3d38b70628cb947a</id>
<content type='text'>
Currently, in menuconfig, Netlink's new mmaped IO is the very first
entry under the ``Networking support'' item and comes even before
``Networking options'':

  [ ]   Netlink: mmaped IO
  Networking options  ---&gt;
  ...

Lets move this into ``Networking options'' under netlink's Kconfig,
since this might be more appropriate. Introduced by commit ccdfcc398
(``netlink: mmaped netlink: ring setup'').

Signed-off-by: Daniel Borkmann &lt;dborkman@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>
Currently, in menuconfig, Netlink's new mmaped IO is the very first
entry under the ``Networking support'' item and comes even before
``Networking options'':

  [ ]   Netlink: mmaped IO
  Networking options  ---&gt;
  ...

Lets move this into ``Networking options'' under netlink's Kconfig,
since this might be more appropriate. Introduced by commit ccdfcc398
(``netlink: mmaped netlink: ring setup'').

Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Fix skb ref counting.</title>
<updated>2013-05-01T18:57:03+00:00</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2013-04-29T20:52:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ae6164adeb559db1828d4abd917971b61130f72e'/>
<id>ae6164adeb559db1828d4abd917971b61130f72e</id>
<content type='text'>
Commit f9c2288837ba072b21dba955f04a4c97eaa77b1e (netlink:
implement memory mapped recvmsg) increamented skb-&gt;users
ref count twice for a dump op which does not look right.

Following patch fixes that.

CC: Patrick McHardy &lt;kaber@trash.net&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>
Commit f9c2288837ba072b21dba955f04a4c97eaa77b1e (netlink:
implement memory mapped recvmsg) increamented skb-&gt;users
ref count twice for a dump op which does not look right.

Following patch fixes that.

CC: Patrick McHardy &lt;kaber@trash.net&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>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>netlink: fix compilation after memory mapped patches</title>
<updated>2013-04-24T18:26:55+00:00</updated>
<author>
<name>Nicolas Dichtel</name>
<email>nicolas.dichtel@6wind.com</email>
</author>
<published>2013-04-24T08:36:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1bf9310a1336c26873dc3eb5fa188d4263897929'/>
<id>1bf9310a1336c26873dc3eb5fa188d4263897929</id>
<content type='text'>
Depending of the kernel configuration (CONFIG_UIDGID_STRICT_TYPE_CHECKS), we can
get the following errors:

net/netlink/af_netlink.c: In function ‘netlink_queue_mmaped_skb’:
net/netlink/af_netlink.c:663:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kuid_t’
net/netlink/af_netlink.c:664:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kgid_t’
net/netlink/af_netlink.c: In function ‘netlink_ring_set_copied’:
net/netlink/af_netlink.c:693:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kuid_t’
net/netlink/af_netlink.c:694:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kgid_t’

We must use the helpers to get the uid and gid, and also take care of user_ns.

Fix suggested by Eric W. Biederman &lt;ebiederm@xmission.com&gt;.

Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.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>
Depending of the kernel configuration (CONFIG_UIDGID_STRICT_TYPE_CHECKS), we can
get the following errors:

net/netlink/af_netlink.c: In function ‘netlink_queue_mmaped_skb’:
net/netlink/af_netlink.c:663:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kuid_t’
net/netlink/af_netlink.c:664:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kgid_t’
net/netlink/af_netlink.c: In function ‘netlink_ring_set_copied’:
net/netlink/af_netlink.c:693:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kuid_t’
net/netlink/af_netlink.c:694:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kgid_t’

We must use the helpers to get the uid and gid, and also take care of user_ns.

Fix suggested by Eric W. Biederman &lt;ebiederm@xmission.com&gt;.

Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Fix build with mmap disabled.</title>
<updated>2013-04-23T19:39:03+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2013-04-23T19:39:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3dec2246c2ff11beb24ca1950f074b2bcbc85953'/>
<id>3dec2246c2ff11beb24ca1950f074b2bcbc85953</id>
<content type='text'>
net/netlink/diag.c: In function 'sk_diag_put_rings_cfg':
net/netlink/diag.c:28:17: error: 'struct netlink_sock' has no member named 'pg_vec_lock'
net/netlink/diag.c:29:29: error: 'struct netlink_sock' has no member named 'rx_ring'
net/netlink/diag.c:31:30: error: 'struct netlink_sock' has no member named 'tx_ring'
net/netlink/diag.c:33:19: error: 'struct netlink_sock' has no member named 'pg_vec_lock'

Reported-by: Randy Dunlap &lt;rdunlap@infradead.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>
net/netlink/diag.c: In function 'sk_diag_put_rings_cfg':
net/netlink/diag.c:28:17: error: 'struct netlink_sock' has no member named 'pg_vec_lock'
net/netlink/diag.c:29:29: error: 'struct netlink_sock' has no member named 'rx_ring'
net/netlink/diag.c:31:30: error: 'struct netlink_sock' has no member named 'tx_ring'
net/netlink/diag.c:33:19: error: 'struct netlink_sock' has no member named 'pg_vec_lock'

Reported-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
