<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/net/netlink.h, branch v2.6.34</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v2.6.34</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v2.6.34'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2010-03-20T05:47:23+00:00</updated>
<entry>
<title>netlink: fix unaligned access in nla_get_be64()</title>
<updated>2010-03-20T05:47:23+00:00</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2010-03-16T13:30:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f5d410f2ea7ba340f11815a56e05b9fa9421c421'/>
<id>urn:sha1:f5d410f2ea7ba340f11815a56e05b9fa9421c421</id>
<content type='text'>
This patch fixes a unaligned access in nla_get_be64() that was
introduced by myself in a17c859849402315613a0015ac8fbf101acf0cc1.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>const: struct nla_policy</title>
<updated>2010-02-18T22:30:18+00:00</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2010-02-18T08:14:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b54452b07a7b1b8cc1385edba3ef2ef6d4679d5a'/>
<id>urn:sha1:b54452b07a7b1b8cc1385edba3ef2ef6d4679d5a</id>
<content type='text'>
Make remaining netlink policies as const.
Fixup coding style where needed.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: constify nlmsghdr arguments</title>
<updated>2009-08-25T14:07:40+00:00</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2009-08-25T14:07:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3a6c2b419b7768703cfb2cabdb894517c5065e33'/>
<id>urn:sha1:3a6c2b419b7768703cfb2cabdb894517c5065e33</id>
<content type='text'>
Consitfy nlmsghdr arguments to a couple of functions as preparation
for the next patch, which will constify the netlink message data in
all nfnetlink users.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: add support for DCCP handshake sequence to ctnetlink</title>
<updated>2009-05-27T15:50:35+00:00</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2009-05-27T15:50:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a17c859849402315613a0015ac8fbf101acf0cc1'/>
<id>urn:sha1:a17c859849402315613a0015ac8fbf101acf0cc1</id>
<content type='text'>
This patch adds CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ that exposes
the u64 handshake sequence number to user-space.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
</entry>
<entry>
<title>netlink: add nla_policy_len()</title>
<updated>2009-03-25T17:26:30+00:00</updated>
<author>
<name>Holger Eitzenberger</name>
<email>holger@eitzenberger.org</email>
</author>
<published>2009-03-25T17:26:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e487eb99cf9381a4f8254fa01747a85818da612b'/>
<id>urn:sha1:e487eb99cf9381a4f8254fa01747a85818da612b</id>
<content type='text'>
It calculates the max. length of a Netlink policy, which is usefull
for allocating Netlink buffers roughly the size of the actual
message.

Signed-off-by: Holger Eitzenberger &lt;holger@eitzenberger.org&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
</entry>
<entry>
<title>netlink: fix (theoretical) overrun in message iteration</title>
<updated>2008-12-26T01:21:17+00:00</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@gmail.com</email>
</author>
<published>2008-12-26T01:21:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=619e803d3c1b7bcc17c45e81f309d0b9b3df2d5d'/>
<id>urn:sha1:619e803d3c1b7bcc17c45e81f309d0b9b3df2d5d</id>
<content type='text'>
See commit 1045b03e07d85f3545118510a587035536030c1c ("netlink: fix
overrun in attribute iteration") for a detailed explanation of why
this patch is necessary.

In short, nlmsg_next() can make "remaining" go negative, and the
remaining &gt;= sizeof(...) comparison will promote "remaining" to an
unsigned type, which means that the expression will evaluate to
true for negative numbers, even though it was not intended.

I put "theoretical" in the title because I have no evidence that
this can actually happen, but I suspect that a crafted netlink
packet can trigger some badness.

Note that the last test, which seemingly has the exact same
problem (also true for nla_ok()), is perfectly OK, since we
already know that remaining is positive.

Signed-off-by: Vegard Nossum &lt;vegard.nossum@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: constify struct nlattr * arg to parsing functions</title>
<updated>2008-10-28T18:59:11+00:00</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2008-10-28T18:59:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b057efd4d226fcc3a92b0dc6d8ea8e8185ecb260'/>
<id>urn:sha1:b057efd4d226fcc3a92b0dc6d8ea8e8185ecb260</id>
<content type='text'>
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6</title>
<updated>2008-10-01T13:12:56+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-10-01T13:12:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b262e60309e1b0eb25d300c7e739427d5316abb1'/>
<id>urn:sha1:b262e60309e1b0eb25d300c7e739427d5316abb1</id>
<content type='text'>
Conflicts:

	drivers/net/wireless/ath9k/core.c
	drivers/net/wireless/ath9k/main.c
	net/core/dev.c
</content>
</entry>
<entry>
<title>netlink: fix overrun in attribute iteration</title>
<updated>2008-09-12T02:05:29+00:00</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@gmail.com</email>
</author>
<published>2008-09-12T02:05:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1045b03e07d85f3545118510a587035536030c1c'/>
<id>urn:sha1:1045b03e07d85f3545118510a587035536030c1c</id>
<content type='text'>
kmemcheck reported this:

  kmemcheck: Caught 16-bit read from uninitialized memory (f6c1ba30)
  0500110001508abf050010000500000002017300140000006f72672e66726565
   i i i i i i i i i i i i i u u u u u u u u u u u u u u u u u u u
                                   ^

  Pid: 3462, comm: wpa_supplicant Not tainted (2.6.27-rc3-00054-g6397ab9-dirty #13)
  EIP: 0060:[&lt;c05de64a&gt;] EFLAGS: 00010296 CPU: 0
  EIP is at nla_parse+0x5a/0xf0
  EAX: 00000008 EBX: fffffffd ECX: c06f16c0 EDX: 00000005
  ESI: 00000010 EDI: f6c1ba30 EBP: f6367c6c ESP: c0a11e88
   DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
  CR0: 8005003b CR2: f781cc84 CR3: 3632f000 CR4: 000006d0
  DR0: c0ead9bc DR1: 00000000 DR2: 00000000 DR3: 00000000
  DR6: ffff4ff0 DR7: 00000400
   [&lt;c05d4b23&gt;] rtnl_setlink+0x63/0x130
   [&lt;c05d5f75&gt;] rtnetlink_rcv_msg+0x165/0x200
   [&lt;c05ddf66&gt;] netlink_rcv_skb+0x76/0xa0
   [&lt;c05d5dfe&gt;] rtnetlink_rcv+0x1e/0x30
   [&lt;c05dda21&gt;] netlink_unicast+0x281/0x290
   [&lt;c05ddbe9&gt;] netlink_sendmsg+0x1b9/0x2b0
   [&lt;c05beef2&gt;] sock_sendmsg+0xd2/0x100
   [&lt;c05bf945&gt;] sys_sendto+0xa5/0xd0
   [&lt;c05bf9a6&gt;] sys_send+0x36/0x40
   [&lt;c05c03d6&gt;] sys_socketcall+0x1e6/0x2c0
   [&lt;c020353b&gt;] sysenter_do_call+0x12/0x3f
   [&lt;ffffffff&gt;] 0xffffffff

This is the line in nla_ok():

  /**
   * nla_ok - check if the netlink attribute fits into the remaining bytes
   * @nla: netlink attribute
   * @remaining: number of bytes remaining in attribute stream
   */
  static inline int nla_ok(const struct nlattr *nla, int remaining)
  {
          return remaining &gt;= sizeof(*nla) &amp;&amp;
                 nla-&gt;nla_len &gt;= sizeof(*nla) &amp;&amp;
                 nla-&gt;nla_len &lt;= remaining;
  }

It turns out that remaining can become negative due to alignment in
nla_next(). But GCC promotes "remaining" to unsigned in the test
against sizeof(*nla) above. Therefore the test succeeds, and the
nla_for_each_attr() may access memory outside the received buffer.

A short example illustrating this point is here:

  #include &lt;stdio.h&gt;

  main(void)
  {
          printf("%d\n", -1 &gt;= sizeof(int));
  }

...which prints "1".

This patch adds a cast in front of the sizeof so that GCC will make
a signed comparison and fix the illegal memory dereference. With the
patch applied, there is no kmemcheck report.

Signed-off-by: Vegard Nossum &lt;vegard.nossum@gmail.com&gt;
Acked-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: Remove compat API for nested attributes</title>
<updated>2008-09-03T00:30:27+00:00</updated>
<author>
<name>Thomas Graf</name>
<email>tgraf@suug.ch</email>
</author>
<published>2008-09-03T00:30:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c10b32bf57db7ec6d4cca4c4aa3d86bacb01c8a'/>
<id>urn:sha1:2c10b32bf57db7ec6d4cca4c4aa3d86bacb01c8a</id>
<content type='text'>
Removes all _nested_compat() functions from the API. The prio qdisc
no longer requires them and netem has its own format anyway. Their
existance is only confusing.

Resend: Also remove the wrapper macro.

Signed-off-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
