<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux-stable.git/drivers/net/pppol2tp.c, branch linux-2.6.32.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/atom?h=linux-2.6.32.y</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/atom?h=linux-2.6.32.y'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/'/>
<updated>2016-03-12T13:25:41+00:00</updated>
<entry>
<title>l2tp: fix another panic in pppol2tp</title>
<updated>2016-03-12T13:25:41+00:00</updated>
<author>
<name>Willy Tarreau</name>
<email>w@1wt.eu</email>
</author>
<published>2016-02-29T19:34:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=e3dea3074f18a0c1dca8b6328b6bba0af3d61349'/>
<id>urn:sha1:e3dea3074f18a0c1dca8b6328b6bba0af3d61349</id>
<content type='text'>
Commit 3feec9095d1 ("l2tp: Fix oops in pppol2tp_xmit") was backported
into 2.6.32.16 to fix a possible null deref in pppol2tp. But the same
still exists in pppol2tp_sendmsg() possibly causing the same crash.
Note that this bug doesn't appear to have any other impact than crashing
the system, as the dereferenced pointer is only used to test a value
against a 3-bit mask, so it can hardly be abused for anything except
leaking one third of a bit of memory.

This issue doesn't exist upstream because the code was replaced in 2.6.35
and the new function l2tp_xmit_skb() performs the appropriate check.

Reported-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>net/l2tp: don't fall back on UDP [get|set]sockopt</title>
<updated>2014-12-13T14:16:12+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>sasha.levin@oracle.com</email>
</author>
<published>2014-07-15T00:02:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=eb406993c7b80c68b053c5d3d6431f4b8d0560eb'/>
<id>urn:sha1:eb406993c7b80c68b053c5d3d6431f4b8d0560eb</id>
<content type='text'>
(commit 3cf521f7dc87c031617fd47e4b7aa2593c2f3daf upstream)

The l2tp [get|set]sockopt() code has fallen back to the UDP functions
for socket option levels != SOL_PPPOL2TP since day one, but that has
never actually worked, since the l2tp socket isn't an inet socket.

As David Miller points out:

  "If we wanted this to work, it'd have to look up the tunnel and then
   use tunnel-&gt;sk, but I wonder how useful that would be"

Since this can never have worked so nobody could possibly have depended
on that functionality, just remove the broken code and return -EINVAL.

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Acked-by: James Chapman &lt;jchapman@katalix.com&gt;
Acked-by: David Miller &lt;davem@davemloft.net&gt;
Cc: Phil Turnbull &lt;phil.turnbull@oracle.com&gt;
Cc: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Cc: Willy Tarreau &lt;w@1wt.eu&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;

[geissert: adjust file paths and context for 2.6.32]
[wt: fixes CVE-2014-4943]
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>net: rework recvmsg handler msg_name and msg_namelen logic</title>
<updated>2014-05-19T05:54:00+00:00</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2013-11-21T02:14:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=4485f23cb4c08b21f0a4434a65c8adf0026d589a'/>
<id>urn:sha1:4485f23cb4c08b21f0a4434a65c8adf0026d589a</id>
<content type='text'>
CVE-2013-7266

BugLink: http://bugs.launchpad.net/bugs/1267081

This patch now always passes msg-&gt;msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size &lt;= sizeof(struct sockaddr_storage)
to return msg_name to the user.

This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers and makes it harder for new code to accidentally leak
uninitialized memory.

Optimize for the case recvfrom is called with NULL as address. We don't
need to copy the address at all, so set it to NULL before invoking the
recvmsg handler. We can do so, because all the recvmsg handlers must
cope with the case a plain read() is called on them. read() also sets
msg_name to NULL.

Also document these changes in include/linux/net.h as suggested by David
Miller.

Changes since RFC:

Set msg-&gt;msg_name = NULL if user specified a NULL in msg_name but had a
non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't
affect sendto as it would bail out earlier while trying to copy-in the
address. It also more naturally reflects the logic by the callers of
verify_iovec.

With this change in place I could remove "
if (!uaddr || msg_sys-&gt;msg_namelen == 0)
	msg-&gt;msg_name = NULL
".

This change does not alter the user visible error logic as we ignore
msg_namelen as long as msg_name is NULL.

Also remove two unnecessary curly brackets in ___sys_recvmsg and change
comments to netdev style.

Cc: David Miller &lt;davem@davemloft.net&gt;
Suggested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
(back ported from commit f3d3342602f8bcbf37d7c46641cb9bca7618eb1c)
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
Acked-by: Andy Whitcroft &lt;andy.whitcroft@canonical.com&gt;
Acked-by: Stefan Bader &lt;stefan.bader@canonical.com&gt;
Signed-off-by: Tim Gardner &lt;tim.gardner@canonical.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>l2tp: Fix UDP socket reference count bugs in the pppol2tp driver</title>
<updated>2011-05-09T22:55:38+00:00</updated>
<author>
<name>James Chapman</name>
<email>jchapman@katalix.com</email>
</author>
<published>2010-03-16T06:29:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=ec12faab23bebcfc34b7987df4c57e5e02490e79'/>
<id>urn:sha1:ec12faab23bebcfc34b7987df4c57e5e02490e79</id>
<content type='text'>
commit c3259c8a7060d480e8eb2166da0a99d6879146b4 upstream.

This patch fixes UDP socket refcnt bugs in the pppol2tp driver.

A bug can cause a kernel stack trace when a tunnel socket is closed.

A way to reproduce the issue is to prepare the UDP socket for L2TP (by
opening a tunnel pppol2tp socket) and then close it before any L2TP
sessions are added to it. The sequence is

Create UDP socket
Create tunnel pppol2tp socket to prepare UDP socket for L2TP
  pppol2tp_connect: session_id=0, peer_session_id=0
L2TP SCCRP control frame received (tunnel_id==0)
  pppol2tp_recv_core: sock_hold()
  pppol2tp_recv_core: sock_put
L2TP ZLB control frame received (tunnel_id=nnn)
  pppol2tp_recv_core: sock_hold()
  pppol2tp_recv_core: sock_put
Close tunnel management socket
  pppol2tp_release: session_id=0, peer_session_id=0
Close UDP socket
  udp_lib_close: BUG

The addition of sock_hold() in pppol2tp_connect() solves the problem.

For data frames, two sock_put() calls were added to plug a refcnt leak
per received data frame. The ref that is grabbed at the top of
pppol2tp_recv_core() must always be released, but this wasn't done for
accepted data frames or data frames discarded because of bad UDP
checksums. This leak meant that any UDP socket that had passed L2TP
data traffic (i.e. L2TP data frames, not just L2TP control frames)
using pppol2tp would not be released by the kernel.

WARNING: at include/net/sock.h:435 udp_lib_unhash+0x117/0x120()
Pid: 1086, comm: openl2tpd Not tainted 2.6.33-rc1 #8
Call Trace:
 [&lt;c119e9b7&gt;] ? udp_lib_unhash+0x117/0x120
 [&lt;c101b871&gt;] ? warn_slowpath_common+0x71/0xd0
 [&lt;c119e9b7&gt;] ? udp_lib_unhash+0x117/0x120
 [&lt;c101b8e3&gt;] ? warn_slowpath_null+0x13/0x20
 [&lt;c119e9b7&gt;] ? udp_lib_unhash+0x117/0x120
 [&lt;c11598a7&gt;] ? sk_common_release+0x17/0x90
 [&lt;c11a5e33&gt;] ? inet_release+0x33/0x60
 [&lt;c11577b0&gt;] ? sock_release+0x10/0x60
 [&lt;c115780f&gt;] ? sock_close+0xf/0x30
 [&lt;c106e542&gt;] ? __fput+0x52/0x150
 [&lt;c106b68e&gt;] ? filp_close+0x3e/0x70
 [&lt;c101d2e2&gt;] ? put_files_struct+0x62/0xb0
 [&lt;c101eaf7&gt;] ? do_exit+0x5e7/0x650
 [&lt;c1081623&gt;] ? mntput_no_expire+0x13/0x70
 [&lt;c106b68e&gt;] ? filp_close+0x3e/0x70
 [&lt;c101eb8a&gt;] ? do_group_exit+0x2a/0x70
 [&lt;c101ebe1&gt;] ? sys_exit_group+0x11/0x20
 [&lt;c10029b0&gt;] ? sysenter_do_call+0x12/0x26

Signed-off-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>l2tp: Fix oops in pppol2tp_xmit</title>
<updated>2010-07-05T18:11:15+00:00</updated>
<author>
<name>James Chapman</name>
<email>jchapman@katalix.com</email>
</author>
<published>2010-03-16T06:46:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=a9689bca9259bee4a8a2fab77d551836fbc1701a'/>
<id>urn:sha1:a9689bca9259bee4a8a2fab77d551836fbc1701a</id>
<content type='text'>
commit 3feec9095d12e311b7d4eb7fe7e5dfa75d4a72a5 upstream.

When transmitting L2TP frames, we derive the outgoing interface's UDP
checksum hardware assist capabilities from the tunnel dst dev. This
can sometimes be NULL, especially when routing protocols are used and
routing changes occur. This patch just checks for NULL dst or dev
pointers when checking for netdev hardware assist features.

BUG: unable to handle kernel NULL pointer dereference at 0000000c
IP: [&lt;f89d074c&gt;] pppol2tp_xmit+0x341/0x4da [pppol2tp]
*pde = 00000000
Oops: 0000 [#1] SMP
last sysfs file: /sys/class/net/lo/operstate
Modules linked in: pppol2tp pppox ppp_generic slhc ipv6 dummy loop snd_hda_codec_atihdmi snd_hda_intel snd_hda_codec snd_pcm snd_timer snd soundcore snd_page_alloc evdev psmouse serio_raw processor button i2c_piix4 i2c_core ati_agp agpgart pcspkr ext3 jbd mbcache sd_mod ide_pci_generic atiixp ide_core ahci ata_generic floppy ehci_hcd ohci_hcd libata e1000e scsi_mod usbcore nls_base thermal fan thermal_sys [last unloaded: scsi_wait_scan]

Pid: 0, comm: swapper Not tainted (2.6.32.8 #1)
EIP: 0060:[&lt;f89d074c&gt;] EFLAGS: 00010297 CPU: 3
EIP is at pppol2tp_xmit+0x341/0x4da [pppol2tp]
EAX: 00000000 EBX: f64d1680 ECX: 000005b9 EDX: 00000000
ESI: f6b91850 EDI: f64d16ac EBP: f6a0c4c0 ESP: f70a9cac
 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process swapper (pid: 0, ti=f70a8000 task=f70a31c0 task.ti=f70a8000)
Stack:
 000005a9 000005b9 f734c400 f66652c0 f7352e00 f67dc800 00000000 f6b91800
&lt;0&gt; 000005a3 f70ef6c4 f67dcda9 000005a3 f89b192e 00000246 000005a3 f64d1680
&lt;0&gt; f63633e0 f6363320 f64d1680 f65a7320 f65a7364 f65856c0 f64d1680 f679f02f
Call Trace:
 [&lt;f89b192e&gt;] ? ppp_push+0x459/0x50e [ppp_generic]
 [&lt;f89b217f&gt;] ? ppp_xmit_process+0x3b6/0x430 [ppp_generic]
 [&lt;f89b2306&gt;] ? ppp_start_xmit+0x10d/0x120 [ppp_generic]
 [&lt;c11c15cb&gt;] ? dev_hard_start_xmit+0x21f/0x2b2
 [&lt;c11d0947&gt;] ? sch_direct_xmit+0x48/0x10e
 [&lt;c11c19a0&gt;] ? dev_queue_xmit+0x263/0x3a6
 [&lt;c11e2a9f&gt;] ? ip_finish_output+0x1f7/0x221
 [&lt;c11df682&gt;] ? ip_forward_finish+0x2e/0x30
 [&lt;c11de645&gt;] ? ip_rcv_finish+0x295/0x2a9
 [&lt;c11c0b19&gt;] ? netif_receive_skb+0x3e9/0x404
 [&lt;f814b791&gt;] ? e1000_clean_rx_irq+0x253/0x2fc [e1000e]
 [&lt;f814cb7a&gt;] ? e1000_clean+0x63/0x1fc [e1000e]
 [&lt;c1047eff&gt;] ? sched_clock_local+0x15/0x11b
 [&lt;c11c1095&gt;] ? net_rx_action+0x96/0x195
 [&lt;c1035750&gt;] ? __do_softirq+0xaa/0x151
 [&lt;c1035828&gt;] ? do_softirq+0x31/0x3c
 [&lt;c10358fe&gt;] ? irq_exit+0x26/0x58
 [&lt;c1004b21&gt;] ? do_IRQ+0x78/0x89
 [&lt;c1003729&gt;] ? common_interrupt+0x29/0x30
 [&lt;c101ac28&gt;] ? native_safe_halt+0x2/0x3
 [&lt;c1008c54&gt;] ? default_idle+0x55/0x75
 [&lt;c1009045&gt;] ? c1e_idle+0xd2/0xd5
 [&lt;c100233c&gt;] ? cpu_idle+0x46/0x62
Code: 8d 45 08 f0 ff 45 08 89 6b 08 c7 43 68 7e fb 9c f8 8a 45 24 83 e0 0c 3c 04 75 09 80 63 64 f3 e9 b4 00 00 00 8b 43 18 8b 4c 24 04 &lt;8b&gt; 40 0c 8d 79 11 f6 40 44 0e 8a 43 64 75 51 6a 00 8b 4c 24 08
EIP: [&lt;f89d074c&gt;] pppol2tp_xmit+0x341/0x4da [pppol2tp] SS:ESP 0068:f70a9cac
CR2: 000000000000000c

Signed-off-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>net: Make setsockopt() optlen be unsigned.</title>
<updated>2009-09-30T23:12:20+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2009-09-30T23:12:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=b7058842c940ad2c08dd829b21e5c92ebe3b8758'/>
<id>urn:sha1:b7058842c940ad2c08dd829b21e5c92ebe3b8758</id>
<content type='text'>
This provides safety against negative optlen at the type
level instead of depending upon (sometimes non-trivial)
checks against this sprinkled all over the the place, in
each and every implementation.

Based upon work done by Arjan van de Ven and feedback
from Linus Torvalds.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: constify remaining proto_ops</title>
<updated>2009-09-15T00:03:09+00:00</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-09-14T12:23:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=5708e868dc512f055f0ea4a14d01f8252c3ca8a1'/>
<id>urn:sha1:5708e868dc512f055f0ea4a14d01f8252c3ca8a1</id>
<content type='text'>
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>pppol2tp: calls unregister_pernet_gen_device() at unload time</title>
<updated>2009-08-02T19:20:34+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2009-07-28T03:47:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=446e72f30eca76d6f9a1a54adf84d2c6ba2831f8'/>
<id>urn:sha1:446e72f30eca76d6f9a1a54adf84d2c6ba2831f8</id>
<content type='text'>
Failure to call unregister_pernet_gen_device() can exhaust memory
if module is loaded/unloaded many times.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: skb-&gt;dst accessors</title>
<updated>2009-06-03T09:51:04+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2009-06-02T05:19:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=adf30907d63893e4208dfe3f5c88ae12bc2f25d5'/>
<id>urn:sha1:adf30907d63893e4208dfe3f5c88ae12bc2f25d5</id>
<content type='text'>
Define three accessors to get/set dst attached to a skb

struct dst_entry *skb_dst(const struct sk_buff *skb)

void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)

void skb_dst_drop(struct sk_buff *skb)
This one should replace occurrences of :
dst_release(skb-&gt;dst)
skb-&gt;dst = NULL;

Delete skb-&gt;dst field

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>drivers/net: replace BUG() with BUG_ON() if possible</title>
<updated>2009-04-13T22:44:36+00:00</updated>
<author>
<name>Alexander Beregalov</name>
<email>a.beregalov@gmail.com</email>
</author>
<published>2009-04-11T14:50:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=0ee904c35cc3fdd26a9c76077d9692d458309186'/>
<id>urn:sha1:0ee904c35cc3fdd26a9c76077d9692d458309186</id>
<content type='text'>
Signed-off-by: Alexander Beregalov &lt;a.beregalov@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
