android_kernel_motorola_sm6375/drivers/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
James Chapman c3259c8a70 l2tp: Fix UDP socket reference count bugs in the pppol2tp driver
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:
 [<c119e9b7>] ? udp_lib_unhash+0x117/0x120
 [<c101b871>] ? warn_slowpath_common+0x71/0xd0
 [<c119e9b7>] ? udp_lib_unhash+0x117/0x120
 [<c101b8e3>] ? warn_slowpath_null+0x13/0x20
 [<c119e9b7>] ? udp_lib_unhash+0x117/0x120
 [<c11598a7>] ? sk_common_release+0x17/0x90
 [<c11a5e33>] ? inet_release+0x33/0x60
 [<c11577b0>] ? sock_release+0x10/0x60
 [<c115780f>] ? sock_close+0xf/0x30
 [<c106e542>] ? __fput+0x52/0x150
 [<c106b68e>] ? filp_close+0x3e/0x70
 [<c101d2e2>] ? put_files_struct+0x62/0xb0
 [<c101eaf7>] ? do_exit+0x5e7/0x650
 [<c1081623>] ? mntput_no_expire+0x13/0x70
 [<c106b68e>] ? filp_close+0x3e/0x70
 [<c101eb8a>] ? do_group_exit+0x2a/0x70
 [<c101ebe1>] ? sys_exit_group+0x11/0x20
 [<c10029b0>] ? sysenter_do_call+0x12/0x26

Signed-off-by: James Chapman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-16 14:15:44 -07:00
..
appletalk
arcnet
arm fix a race in ks8695_poll 2010-03-07 15:25:49 -08:00
atl1c
atl1e
atlx Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
benet be2net: fix mccq create for big endian architectures 2010-03-15 15:46:59 -07:00
bonding driver-core: Add attribute argument to class_attribute show/store 2010-03-07 17:04:48 -08:00
can can: fix bfin_can build error after alloc_candev() change 2010-03-08 12:13:57 -08:00
chelsio Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
cris
cxgb3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-03-13 14:50:18 -08:00
e1000
e1000e Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-03-13 14:50:18 -08:00
ehea
enic
fs_enet fs_enet: add FEC TX buffer alignment workaround for MPC5121 2010-02-27 02:34:36 -08:00
hamradio
ibm_newemac
igb Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
igbvf
irda Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2010-03-15 16:23:54 -07:00
ixgb
ixgbe bitops: rename for_each_bit() to for_each_set_bit() 2010-03-06 11:26:23 -08:00
ixgbevf bitops: rename for_each_bit() to for_each_set_bit() 2010-03-06 11:26:23 -08:00
ixp2000
mlx4
myri10ge myri: remove dead code 2010-03-15 16:00:50 -07:00
netxen
octeon
pcmcia Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2010-02-28 19:23:06 -08:00
phy
qlcnic qlcnic: remove extra space from board names 2010-03-08 10:45:30 -08:00
qlge Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
sfc Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
skfp Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
stmmac
tokenring Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
tulip drivers/net/tulip/eeprom.c: fix bogus "(null)" in tulip init messages 2010-03-13 12:26:15 -08:00
usb smsc95xx: wait for PHY to complete reset during init 2010-03-16 14:15:44 -07:00
vmxnet3
vxge
wan Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
wimax Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-03-13 14:50:18 -08:00
3c59x.c
3c501.c
3c501.h
3c503.c
3c503.h
3c505.c
3c505.h
3c507.c
3c509.c
3c515.c
3c523.c
3c523.h
3c527.c
3c527.h
7990.c
7990.h
8139cp.c
8139too.c
8390.c
8390.h
8390p.c
82596.c
a2065.c
a2065.h
ac3200.c
acenic.c
acenic.h
amd8111e.c
amd8111e.h
apne.c
ariadne.c
ariadne.h
at1700.c
atarilance.c
atp.c
atp.h
au1000_eth.c Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2010-02-28 19:23:06 -08:00
au1000_eth.h NET: au1000-eth: Convert to platform_driver model 2010-02-27 12:53:02 +01:00
ax88796.c
b44.c
b44.h
bcm63xx_enet.c
bcm63xx_enet.h
bfin_mac.c
bfin_mac.h
bmac.c
bmac.h
bnx2.c bnx2: Remove now useless VPD code 2010-02-28 00:43:33 -08:00
bnx2.h
bnx2_fw.h
bnx2x.h
bnx2x_dump.h
bnx2x_fw_defs.h
bnx2x_fw_file_hdr.h
bnx2x_hsi.h
bnx2x_init.h
bnx2x_init_ops.h
bnx2x_link.c
bnx2x_link.h
bnx2x_main.c bnx2x: change smp_mb() comment to conform the true 2010-03-15 15:47:01 -07:00
bnx2x_reg.h
bsd_comp.c
cassini.c cassini: fix off by one 2010-03-03 01:04:39 -08:00
cassini.h
cnic.c
cnic.h
cnic_defs.h
cnic_if.h
cpmac.c cpmac: bump version to 0.5.2 2010-03-07 15:25:53 -08:00
cs89x0.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
cs89x0.h
davinci_emac.c Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2010-03-15 16:23:54 -07:00
de600.c
de600.h
de620.c
de620.h
declance.c
defxx.c
defxx.h
depca.c
depca.h
dl2k.c
dl2k.h
dm9000.c
dm9000.h
dnet.c
dnet.h
dummy.c
e100.c e100: Fix ring parameter change handling regression. 2010-03-15 15:23:30 -07:00
e2100.c
eepro.c
eexpress.c
eexpress.h
enc28j60.c
enc28j60_hw.h
epic100.c
eql.c
es3210.c
eth16i.c
ethoc.c
ewrk3.c
ewrk3.h
fealnx.c
fec.c
fec.h
fec_mpc52xx.c
fec_mpc52xx.h
fec_mpc52xx_phy.c
forcedeth.c
fsl_pq_mdio.c
fsl_pq_mdio.h
gianfar.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-03-13 14:50:18 -08:00
gianfar.h
gianfar_ethtool.c
gianfar_sysfs.c
greth.c
greth.h
hamachi.c
hp-plus.c
hp.c
hp100.c
hp100.h
hplance.c
hplance.h
hydra.c
ibmlana.c
ibmlana.h
ibmveth.c Driver core: Constify struct sysfs_ops in struct kobj_type 2010-03-07 17:04:49 -08:00
ibmveth.h
ifb.c
ioc3-eth.c
ipg.c
ipg.h
iseries_veth.c Driver core: Constify struct sysfs_ops in struct kobj_type 2010-03-07 17:04:49 -08:00
jazzsonic.c
jme.c
jme.h
Kconfig net: add ColdFire support to the smc91x driver 2010-03-10 07:37:06 -08:00
korina.c
ks8842.c
ks8851.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
ks8851.h
ks8851_mll.c
ksz884x.c NET: ksz884x, fix lock imbalance 2010-03-16 14:15:41 -07:00
lance.c
lasi_82596.c
lib8390.c
lib82596.c
LICENSE.SRC
ll_temac.h
ll_temac_main.c
ll_temac_mdio.c
lne390.c
loopback.c
lp486e.c
mac89x0.c
mac8390.c
macb.c
macb.h
mace.c Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2010-02-28 19:23:06 -08:00
mace.h
macmace.c Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2010-02-28 19:23:06 -08:00
macsonic.c mac68k: move macsonic and macmace platform devices 2010-02-27 18:31:11 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
meth.c
meth.h
mii.c
mipsnet.c
mv643xx_eth.c
mvme147.c
myri_sbus.c
myri_sbus.h
natsemi.c
ne-h8300.c
ne.c ne: Do not use slashes in irq name string 2010-03-16 14:15:42 -07:00
ne2.c
ne2k-pci.c
ne3210.c
netconsole.c
netx-eth.c
ni52.c
ni52.h
ni65.c
ni65.h
ni5010.c
ni5010.h
niu.c
niu.h
ns83820.c
pasemi_mac.c
pasemi_mac.h
pasemi_mac_ethtool.c
pci-skeleton.c
pcnet32.c
plip.c
ppp_async.c
ppp_deflate.c
ppp_generic.c
ppp_mppe.c
ppp_mppe.h
ppp_synctty.c
pppoe.c
pppol2tp.c l2tp: Fix UDP socket reference count bugs in the pppol2tp driver 2010-03-16 14:15:44 -07:00
pppox.c
ps3_gelic_net.c
ps3_gelic_net.h
ps3_gelic_wireless.c
ps3_gelic_wireless.h
qla3xxx.c
qla3xxx.h
r6040.c
r8169.c r8169: use correct barrier between cacheable and non-cacheable memory 2010-03-04 00:53:53 -08:00
rionet.c
rrunner.c
rrunner.h
s2io-regs.h
s2io.c drivers/net: drop redundant memset 2010-03-15 15:47:03 -07:00
s2io.h
s6gmac.c
sb1000.c
sb1250-mac.c
sc92031.c
seeq8005.c
seeq8005.h
sgiseeq.c
sgiseeq.h
sh_eth.c
sh_eth.h
sis190.c sis190: fix cable detect via link status poll 2010-03-02 03:44:41 -08:00
sis900.c
sis900.h
skge.c
skge.h
sky2.c sky2: Avoid rtnl_unlock without rtnl_lock 2010-03-13 12:24:18 -08:00
sky2.h
slhc.c
slip.c
slip.h
smc-mca.c
smc-ultra.c
smc-ultra32.c
smc91x.c
smc91x.h net: add ColdFire support to the smc91x driver 2010-03-10 07:37:06 -08:00
smc911x.c
smc911x.h
smc9194.c
smc9194.h
smsc911x.c
smsc911x.h
smsc9420.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
smsc9420.h
sni_82596.c
sonic.c
sonic.h
Space.c
spider_net.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
spider_net.h
spider_net_ethtool.c
starfire.c
stnic.c
sun3_82586.c
sun3_82586.h
sun3lance.c
sunbmac.c
sunbmac.h
sundance.c
sungem.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
sungem.h
sungem_phy.c
sungem_phy.h
sunhme.c
sunhme.h
sunlance.c
sunqe.c
sunqe.h
sunvnet.c
sunvnet.h
tc35815.c
tehuti.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
tehuti.h
tg3.c drivers/net/tg3.c: change the field used with the TG3_FLAG_10_100_ONLY constant 2010-03-13 12:22:16 -08:00
tg3.h
tlan.c
tlan.h
tsi108_eth.c
tsi108_eth.h
tun.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
typhoon.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-03-13 14:50:18 -08:00
typhoon.h
ucc_geth.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
ucc_geth.h
ucc_geth_ethtool.c
veth.c rtnetlink: support specifying device flags on device creation 2010-02-27 02:43:40 -08:00
via-rhine.c
via-velocity.c
via-velocity.h
virtio_net.c virtio_net: remove forgotten assignment 2010-03-02 03:57:33 -08:00
wd.c
xen-netfront.c
xilinx_emaclite.c
xtsonic.c
yellowfin.c
znet.c
zorro8390.c