<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/net/pppol2tp.c, branch v2.6.27</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>[netdrvr] remove unnecessary #include</title>
<updated>2008-08-14T08:26:38+00:00</updated>
<author>
<name>Huang Weiyi</name>
<email>weiyi.huang@gmail.com</email>
</author>
<published>2008-08-11T04:56:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fde9403a982218fa8a437f815e7aa0e583e2d6ed'/>
<id>fde9403a982218fa8a437f815e7aa0e583e2d6ed</id>
<content type='text'>
The drivers below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
  drivers/net/acenic.c
  drivers/net/bnx2x_link.c
  drivers/net/bnx2x_main.c
  drivers/net/cpmac.c
  drivers/net/gianfar_sysfs.c
  drivers/net/ipg.h
  drivers/net/ppp_mppe.c
  drivers/net/pppol2tp.c
  drivers/net/r6040.c
  drivers/net/sh_eth.c
  drivers/net/sky2.c
  drivers/net/tehuti.h
  drivers/net/typhoon.c

This patch removes the said #include &lt;linux/version.h&gt;.

Signed-off-by: Huang Weiyi &lt;hwy@cn.fujitsu.com&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The drivers below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
  drivers/net/acenic.c
  drivers/net/bnx2x_link.c
  drivers/net/bnx2x_main.c
  drivers/net/cpmac.c
  drivers/net/gianfar_sysfs.c
  drivers/net/ipg.h
  drivers/net/ppp_mppe.c
  drivers/net/pppol2tp.c
  drivers/net/r6040.c
  drivers/net/sh_eth.c
  drivers/net/sky2.c
  drivers/net/tehuti.h
  drivers/net/typhoon.c

This patch removes the said #include &lt;linux/version.h&gt;.

Signed-off-by: Huang Weiyi &lt;hwy@cn.fujitsu.com&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: Fix potential memory corruption in pppol2tp_recvmsg()</title>
<updated>2008-06-10T19:35:00+00:00</updated>
<author>
<name>James Chapman</name>
<email>jchapman@katalix.com</email>
</author>
<published>2008-06-10T19:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6b6707a50c7598a83820077393f8823ab791abf8'/>
<id>6b6707a50c7598a83820077393f8823ab791abf8</id>
<content type='text'>
This patch fixes a potential memory corruption in
pppol2tp_recvmsg(). If skb-&gt;len is bigger than the caller's buffer
length, memcpy_toiovec() will go into unintialized data on the kernel
heap, interpret it as an iovec and start modifying memory.

The fix is to change the memcpy_toiovec() call to
skb_copy_datagram_iovec() so that paged packets (rare for PPPOL2TP)
are handled properly. Also check that the caller's buffer is big
enough for the data and set the MSG_TRUNC flag if it is not so.

Reported-by: Ilja &lt;ilja@netric.org&gt;
Signed-off-by: James Chapman &lt;jchapman@katalix.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 patch fixes a potential memory corruption in
pppol2tp_recvmsg(). If skb-&gt;len is bigger than the caller's buffer
length, memcpy_toiovec() will go into unintialized data on the kernel
heap, interpret it as an iovec and start modifying memory.

The fix is to change the memcpy_toiovec() call to
skb_copy_datagram_iovec() so that paged packets (rare for PPPOL2TP)
are handled properly. Also check that the caller's buffer is big
enough for the data and set the MSG_TRUNC flag if it is not so.

Reported-by: Ilja &lt;ilja@netric.org&gt;
Signed-off-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: Fix possible oops if transmitting or receiving when tunnel goes down</title>
<updated>2008-06-04T22:54:07+00:00</updated>
<author>
<name>James Chapman</name>
<email>jchapman@katalix.com</email>
</author>
<published>2008-06-04T22:54:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=24b95685ffcdb3dc28f64b9e8af6ea3e8360fbc5'/>
<id>24b95685ffcdb3dc28f64b9e8af6ea3e8360fbc5</id>
<content type='text'>
Some problems have been experienced in the field which cause an oops
in the pppol2tp driver if L2TP tunnels fail while passing data.

The pppol2tp driver uses private data that is referenced via the
sk-&gt;sk_user_data of its UDP and PPPoL2TP sockets. This patch makes
sure that the driver uses sock_hold() when it holds a reference to the
sk pointer. This affects its sendmsg(), recvmsg(), getname(),
[gs]etsockopt() and ioctl() handlers.

Tested by ISP where problem was seen. System has been up 10 days with
no oops since running this patch. Without the patch, an oops would
occur every 1-2 days.

Signed-off-by: James Chapman &lt;jchapman@katalix.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>
Some problems have been experienced in the field which cause an oops
in the pppol2tp driver if L2TP tunnels fail while passing data.

The pppol2tp driver uses private data that is referenced via the
sk-&gt;sk_user_data of its UDP and PPPoL2TP sockets. This patch makes
sure that the driver uses sock_hold() when it holds a reference to the
sk pointer. This affects its sendmsg(), recvmsg(), getname(),
[gs]etsockopt() and ioctl() handlers.

Tested by ISP where problem was seen. System has been up 10 days with
no oops since running this patch. Without the patch, an oops would
occur every 1-2 days.

Signed-off-by: James Chapman &lt;jchapman@katalix.com&gt; 
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lt2p: Fix possible WARN_ON from socket code when UDP socket is closed</title>
<updated>2008-06-04T22:07:32+00:00</updated>
<author>
<name>James Chapman</name>
<email>jchapman@katalix.com</email>
</author>
<published>2008-06-04T22:07:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=199f7d24ae59894243687a234a909f44a8724506'/>
<id>199f7d24ae59894243687a234a909f44a8724506</id>
<content type='text'>
If an L2TP daemon closes a tunnel socket while packets are queued in
the tunnel's reorder queue, a kernel warning is logged because the
socket is closed while skbs are still referencing it. The fix is to
purge the queue in the socket's release handler.

WARNING: at include/net/sock.h:351 udp_lib_unhash+0x41/0x68()
Pid: 12998, comm: openl2tpd Not tainted 2.6.25 #8
 [&lt;c0423c58&gt;] warn_on_slowpath+0x41/0x51
 [&lt;c05d33a7&gt;] udp_lib_unhash+0x41/0x68
 [&lt;c059424d&gt;] sk_common_release+0x23/0x90
 [&lt;c05d16be&gt;] udp_lib_close+0x8/0xa
 [&lt;c05d8684&gt;] inet_release+0x42/0x48
 [&lt;c0592599&gt;] sock_release+0x14/0x60
 [&lt;c059299f&gt;] sock_close+0x29/0x30
 [&lt;c046ef52&gt;] __fput+0xad/0x15b
 [&lt;c046f1d9&gt;] fput+0x17/0x19
 [&lt;c046c8c4&gt;] filp_close+0x50/0x5a
 [&lt;c046da06&gt;] sys_close+0x69/0x9f
 [&lt;c04048ce&gt;] syscall_call+0x7/0xb

Signed-off-by: James Chapman &lt;jchapman@katalix.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>
If an L2TP daemon closes a tunnel socket while packets are queued in
the tunnel's reorder queue, a kernel warning is logged because the
socket is closed while skbs are still referencing it. The fix is to
purge the queue in the socket's release handler.

WARNING: at include/net/sock.h:351 udp_lib_unhash+0x41/0x68()
Pid: 12998, comm: openl2tpd Not tainted 2.6.25 #8
 [&lt;c0423c58&gt;] warn_on_slowpath+0x41/0x51
 [&lt;c05d33a7&gt;] udp_lib_unhash+0x41/0x68
 [&lt;c059424d&gt;] sk_common_release+0x23/0x90
 [&lt;c05d16be&gt;] udp_lib_close+0x8/0xa
 [&lt;c05d8684&gt;] inet_release+0x42/0x48
 [&lt;c0592599&gt;] sock_release+0x14/0x60
 [&lt;c059299f&gt;] sock_close+0x29/0x30
 [&lt;c046ef52&gt;] __fput+0xad/0x15b
 [&lt;c046f1d9&gt;] fput+0x17/0x19
 [&lt;c046c8c4&gt;] filp_close+0x50/0x5a
 [&lt;c046da06&gt;] sys_close+0x69/0x9f
 [&lt;c04048ce&gt;] syscall_call+0x7/0xb

Signed-off-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: avoid skb truesize bug if headroom is increased</title>
<updated>2008-05-19T21:10:01+00:00</updated>
<author>
<name>James Chapman</name>
<email>jchapman@katalix.com</email>
</author>
<published>2008-05-19T21:10:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=090c48d3dd5ea90b37350334aaed9a93b0c1e0a1'/>
<id>090c48d3dd5ea90b37350334aaed9a93b0c1e0a1</id>
<content type='text'>
A user reported seeing occasional bugs such as the following when
using the L2TP driver.

  SKB BUG: Invalid truesize (272) len=72, sizeof(sk_buff)=208

When L2TP adds its header in the transmit path, it might need to
increase the headroom of the skb. In some cases, the increased
headroom trips a kernel bug when the skb is freed because the skb has
grown beyond its truesize value. The fix is to increase the truesize
by the amount of headroom added, after orphaning the skb.

While here, fix a misleading comment.

Thanks to Iouri Kharon &lt;bc-info@styx.cabel.net&gt; for the initial
report and testing the fix.

Signed-off-by: James Chapman &lt;jchapman@katalix.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>
A user reported seeing occasional bugs such as the following when
using the L2TP driver.

  SKB BUG: Invalid truesize (272) len=72, sizeof(sk_buff)=208

When L2TP adds its header in the transmit path, it might need to
increase the headroom of the skb. In some cases, the increased
headroom trips a kernel bug when the skb is freed because the skb has
grown beyond its truesize value. The fix is to increase the truesize
by the amount of headroom added, after orphaning the skb.

While here, fix a misleading comment.

Thanks to Iouri Kharon &lt;bc-info@styx.cabel.net&gt; for the initial
report and testing the fix.

Signed-off-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pppol2tp: Remove null pointer dereference.</title>
<updated>2008-05-12T22:43:46+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2008-05-12T22:43:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5dc474d6b3ba19df7d491d4eabd9fb7a0c1c2423'/>
<id>5dc474d6b3ba19df7d491d4eabd9fb7a0c1c2423</id>
<content type='text'>
If session is NULL, it is not possible to access its name field.  So I
have split apart the printing of the error message to drop the
printing of the name field in this case.

The macro PRINTK actually only evaluates its arguments starting with
the third one if the bitwise conjunction of the first two is non-zero.
Normally, this conjunction would only be non-zero if debugging mode
were turned on, but when session is NULL, the first argument in both
the old and new code is -1, and thus the bitwise conjunction is true.
Perhaps a different strategy is desired, such as using tunnel-&gt;debug,
which session-&gt;debug is initialized to, but tunnel can also be NULL,
so this does not completely solve the problem.


This problem was found using the following semantic match
(http://www.emn.fr/x-info/coccinelle/)

// &lt;smpl&gt;
@@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

* if (E == NULL)
{
  ... when != if (E == NULL) S1 else S2
      when != E = E1
* E-&gt;f
  ... when any
  return ...;
}
else S3
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&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>
If session is NULL, it is not possible to access its name field.  So I
have split apart the printing of the error message to drop the
printing of the name field in this case.

The macro PRINTK actually only evaluates its arguments starting with
the third one if the bitwise conjunction of the first two is non-zero.
Normally, this conjunction would only be non-zero if debugging mode
were turned on, but when session is NULL, the first argument in both
the old and new code is -1, and thus the bitwise conjunction is true.
Perhaps a different strategy is desired, such as using tunnel-&gt;debug,
which session-&gt;debug is initialized to, but tunnel can also be NULL,
so this does not completely solve the problem.


This problem was found using the following semantic match
(http://www.emn.fr/x-info/coccinelle/)

// &lt;smpl&gt;
@@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

* if (E == NULL)
{
  ... when != if (E == NULL) S1 else S2
      when != E = E1
* E-&gt;f
  ... when any
  return ...;
}
else S3
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdev: use non-racy method for proc entries creation</title>
<updated>2008-04-29T15:06:22+00:00</updated>
<author>
<name>Denis V. Lunev</name>
<email>den@openvz.org</email>
</author>
<published>2008-04-29T08:02:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a95609cb0283a23e519e607ff9fc2a4aa77e2532'/>
<id>a95609cb0283a23e519e607ff9fc2a4aa77e2532</id>
<content type='text'>
Use proc_create()/proc_create_data() to make sure that -&gt;proc_fops and -&gt;data
be setup before gluing PDE to main tree.

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
Cc: Jeff Garzik &lt;jgarzik@pobox.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use proc_create()/proc_create_data() to make sure that -&gt;proc_fops and -&gt;data
be setup before gluing PDE to main tree.

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
Cc: Jeff Garzik &lt;jgarzik@pobox.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PPPOL2TP]: Fix SMP issues in skb reorder queue handling</title>
<updated>2008-03-06T02:40:01+00:00</updated>
<author>
<name>James Chapman</name>
<email>jchapman@katalix.com</email>
</author>
<published>2008-03-06T02:40:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e653181dd6b3ad38ce14904351b03a5388f4b0f7'/>
<id>e653181dd6b3ad38ce14904351b03a5388f4b0f7</id>
<content type='text'>
When walking a session's packet reorder queue, use
skb_queue_walk_safe() since the list could be modified inside the
loop.

Rearrange the unlinking skbs from the reorder queue such that it is
done while the queue lock is held in pppol2tp_recv_dequeue() when
walking the skb list.

A version of this patch was suggested by Jarek Poplawski.

Signed-off-by: James Chapman &lt;jchapman@katalix.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 walking a session's packet reorder queue, use
skb_queue_walk_safe() since the list could be modified inside the
loop.

Rearrange the unlinking skbs from the reorder queue such that it is
done while the queue lock is held in pppol2tp_recv_dequeue() when
walking the skb list.

A version of this patch was suggested by Jarek Poplawski.

Signed-off-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PPPOL2TP]: Make locking calls softirq-safe</title>
<updated>2008-03-06T02:39:08+00:00</updated>
<author>
<name>James Chapman</name>
<email>jchapman@katalix.com</email>
</author>
<published>2008-03-06T02:39:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cf3752e2d203bbbfc88d29e362e6938cef4339b3'/>
<id>cf3752e2d203bbbfc88d29e362e6938cef4339b3</id>
<content type='text'>
Fix locking issues in the pppol2tp driver which can cause a kernel
crash on SMP boxes. There were two problems:-

1. The driver was violating read_lock() and write_lock() scheduling
   rules because it wasn't using softirq-safe locks in softirq
   contexts. So we now consistently use the _bh variants of the lock
   functions.

2. The driver was calling sk_dst_get() in pppol2tp_xmit() which was
   taking sk_dst_lock in softirq context. We now call __sk_dst_get().

Signed-off-by: James Chapman &lt;jchapman@katalix.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>
Fix locking issues in the pppol2tp driver which can cause a kernel
crash on SMP boxes. There were two problems:-

1. The driver was violating read_lock() and write_lock() scheduling
   rules because it wasn't using softirq-safe locks in softirq
   contexts. So we now consistently use the _bh variants of the lock
   functions.

2. The driver was calling sk_dst_get() in pppol2tp_xmit() which was
   taking sk_dst_lock in softirq context. We now call __sk_dst_get().

Signed-off-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PPPOL2TP]: Add missing sock_put() in pppol2tp_tunnel_closeall()</title>
<updated>2008-03-04T04:49:34+00:00</updated>
<author>
<name>Jarek Poplawski</name>
<email>jarkao2@gmail.com</email>
</author>
<published>2008-03-04T04:49:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ec9b6add7d81f902f6094e71f595da4a362f3348'/>
<id>ec9b6add7d81f902f6094e71f595da4a362f3348</id>
<content type='text'>
Every skb removed from session-&gt;reorder_q needs sock_put().

Signed-off-by: Jarek Poplawski &lt;jarkao2@gmail.com&gt;
Acked-by: James Chapman &lt;jchapman@katalix.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>
Every skb removed from session-&gt;reorder_q needs sock_put().

Signed-off-by: Jarek Poplawski &lt;jarkao2@gmail.com&gt;
Acked-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
