12 May, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    net: Fix FDDI and TR config checks in ipv4 arp and LLC.
    IPv4: unresolved multicast route cleanup
    mac80211: remove association work when processing deauth request
    ar9170: wait for asynchronous firmware loading
    ipv4: udp: fix short packet and bad checksum logging
    phy: Fix initialization in micrel driver.
    sctp: Fix a race between ICMP protocol unreachable and connect()
    veth: Dont kfree_skb() after dev_forward_skb()
    IPv6: fix IPV6_RECVERR handling of locally-generated errors
    net/gianfar: drop recycled skbs on MTU change
    iwlwifi: work around passive scan issue

    Linus Torvalds
     

11 May, 2010

1 commit


10 May, 2010

2 commits

  • Need to check both CONFIG_FOO and CONFIG_FOO_MODULE

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Fixes the expiration timer for unresolved multicast route entries.
    In case new multicast routing requests come in faster than the
    expiration timeout occurs (e.g. zap through multicast TV streams), the
    timer is prevented from being called at time for already existing entries.

    As the single timer is resetted to default whenever a new entry is made,
    the timeout for existing unresolved entires are missed and/or not
    updated. As a consequence new requests are denied when the limit of
    unresolved entries has been reached because old entries live longer than
    they are supposed to.

    The solution is to reset the timer only for the first unresolved entry
    in the multicast routing cache. All other timers are already set and
    updated correctly within the timer function itself by now.

    Signed-off by: Andreas Meissner
    Signed-off-by: David S. Miller

    Andreas Meissner
     

08 May, 2010

1 commit

  • In https://bugzilla.kernel.org/show_bug.cgi?id=15794 a user encountered the
    following:

    [18967.469098] wlan0: authenticated
    [18967.472527] wlan0: associate with 00:1c:10:b8:e3:ea (try 1)
    [18967.472585] wlan0: deauthenticating from 00:1c:10:b8:e3:ea by local choice (reason=3)
    [18967.672057] wlan0: associate with 00:1c:10:b8:e3:ea (try 2)
    [18967.872357] wlan0: associate with 00:1c:10:b8:e3:ea (try 3)
    [18968.072960] wlan0: association with 00:1c:10:b8:e3:ea timed out
    [18968.076890] ------------[ cut here ]------------
    [18968.076898] WARNING: at net/wireless/mlme.c:341 cfg80211_send_assoc_timeout+0xa8/0x140()
    [18968.076900] Hardware name: GX628
    [18968.076924] Pid: 1408, comm: phy0 Not tainted 2.6.34-rc4-00082-g250541f-dirty #3
    [18968.076926] Call Trace:
    [18968.076931] [] ? warn_slowpath_common+0x6e/0xb0
    [18968.076934] [] ? cfg80211_send_assoc_timeout+0xa8/0x140
    [18968.076937] [] ? mod_timer+0x10b/0x180
    [18968.076940] [] ? ieee80211_assoc_done+0xbc/0xc0
    [18968.076943] [] ? ieee80211_work_work+0x553/0x11c0
    [18968.076945] [] ? finish_task_switch+0x41/0xb0
    [18968.076948] [] ? ieee80211_work_work+0x0/0x11c0
    [18968.076951] [] ? worker_thread+0x13b/0x210
    [18968.076954] [] ? autoremove_wake_function+0x0/0x30
    [18968.076956] [] ? worker_thread+0x0/0x210
    [18968.076959] [] ? kthread+0x8e/0xa0
    [18968.076962] [] ? kernel_thread_helper+0x4/0x10
    [18968.076964] [] ? kthread+0x0/0xa0
    [18968.076966] [] ? kernel_thread_helper+0x0/0x10
    [18968.076968] ---[ end trace 8aa6265f4b1adfe0 ]---

    As explained by Johannes Berg :

    We authenticate successfully, and then userspace requests association.
    Then we start that process, but the AP doesn't respond. While we're
    still waiting for an AP response, userspace asks for a deauth. We do
    the deauth, but don't abort the association work. Then once the
    association work times out we tell cfg80211, but it no longer wants
    to know since for all it is concerned we accepted the deauth that
    also kills the association attempt.

    Fix this by, upon receipt of deauth request, removing the association work
    and continuing to send the deauth.

    Unfortunately the user reporting the issue is not able to reproduce this
    problem anymore and cannot verify this fix. This seems like a well understood
    issue though and I thus present the patch.

    Bug-identified-by: Johannes Berg
    Signed-off-by: Reinette Chatre
    Signed-off-by: John W. Linville

    Reinette Chatre
     

07 May, 2010

1 commit

  • commit 2783ef23 moved the initialisation of saddr and daddr after
    pskb_may_pull() to avoid a potential data corruption. Unfortunately
    also placing it after the short packet and bad checksum error paths,
    where these variables are used for logging. The result is bogus
    output like

    [92238.389505] UDP: short packet: From 2.0.0.0:65535 23715/178 to 0.0.0.0:65535

    Moving the saddr and daddr initialisation above the error paths, while still
    keeping it after the pskb_may_pull() to keep the fix from commit 2783ef23.

    Signed-off-by: Bjørn Mork
    Cc: stable@kernel.org
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Bjørn Mork
     

06 May, 2010

3 commits

  • ICMP protocol unreachable handling completely disregarded
    the fact that the user may have locked the socket. It proceeded
    to destroy the association, even though the user may have
    held the lock and had a ref on the association. This resulted
    in the following:

    Attempt to release alive inet socket f6afcc00

    =========================
    [ BUG: held lock freed! ]
    -------------------------
    somenu/2672 is freeing memory f6afcc00-f6afcfff, with a lock still held
    there!
    (sk_lock-AF_INET){+.+.+.}, at: [] sctp_connect+0x13/0x4c
    1 lock held by somenu/2672:
    #0: (sk_lock-AF_INET){+.+.+.}, at: [] sctp_connect+0x13/0x4c

    stack backtrace:
    Pid: 2672, comm: somenu Not tainted 2.6.32-telco #55
    Call Trace:
    [] ? printk+0xf/0x11
    [] debug_check_no_locks_freed+0xce/0xff
    [] kmem_cache_free+0x21/0x66
    [] __sk_free+0x9d/0xab
    [] sk_free+0x1c/0x1e
    [] sctp_association_put+0x32/0x89
    [] __sctp_connect+0x36d/0x3f4
    [] ? sctp_connect+0x13/0x4c
    [] ? autoremove_wake_function+0x0/0x33
    [] sctp_connect+0x31/0x4c
    [] inet_dgram_connect+0x4b/0x55
    [] sys_connect+0x54/0x71
    [] ? lock_release_non_nested+0x88/0x239
    [] ? might_fault+0x42/0x7c
    [] ? might_fault+0x42/0x7c
    [] sys_socketcall+0x6d/0x178
    [] ? trace_hardirqs_on_thunk+0xc/0x10
    [] syscall_call+0x7/0xb

    This was because the sctp_wait_for_connect() would aqcure the socket
    lock and then proceed to release the last reference count on the
    association, thus cause the fully destruction path to finish freeing
    the socket.

    The simplest solution is to start a very short timer in case the socket
    is owned by user. When the timer expires, we can do some verification
    and be able to do the release properly.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • In case of congestion, netif_rx() frees the skb, so we must assume
    dev_forward_skb() also consume skb.

    Bug introduced by commit 445409602c092
    (veth: move loopback logic to common location)

    We must change dev_forward_skb() to always consume skb, and veth to not
    double free it.

    Bug report : http://marc.info/?l=linux-netdev&m=127310770900442&w=3

    Reported-by: Martín Ferrari
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • I noticed when I added support for IPV6_DONTFRAG that if you set
    IPV6_RECVERR and tried to send a UDP packet larger than 64K to an
    IPv6 destination, you'd correctly get an EMSGSIZE, but reading from
    MSG_ERRQUEUE returned the incorrect address in the cmsg:

    struct msghdr:
    msg_name 0x7fff8f3c96d0
    msg_namelen 28
    struct sockaddr_in6:
    sin6_family 10
    sin6_port 7639
    sin6_flowinfo 0
    sin6_addr ::ffff:38.32.0.0
    sin6_scope_id 0 ((null))

    It should have returned this in my case:

    struct msghdr:
    msg_name 0x7fffd866b510
    msg_namelen 28
    struct sockaddr_in6:
    sin6_family 10
    sin6_port 7639
    sin6_flowinfo 0
    sin6_addr 2620:0:a09:e000:21f:29ff:fe57:f88b
    sin6_scope_id 0 ((null))

    The problem is that ipv6_recv_error() assumes that if the error
    wasn't generated by ICMPv6, it's an IPv4 address sitting there,
    and proceeds to create a v4-mapped address from it.

    Change ipv6_icmp_error() and ipv6_local_error() to set skb->protocol
    to htons(ETH_P_IPV6) so that ipv6_recv_error() knows the address
    sitting right after the extended error is IPv6, else it will
    incorrectly map the first octet into an IPv4-mapped IPv6 address
    in the cmsg structure returned in a recvmsg() call to obtain
    the error.

    Signed-off-by: Brian Haley

    --
    To unsubscribe from this list: send the line "unsubscribe netdev" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Signed-off-by: David S. Miller

    Brian Haley
     

05 May, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    FEC: Fix kernel panic in fec_set_mac_address.
    ipv6: Fix default multicast hops setting.
    net: ep93xx_eth stops receiving packets
    drivers/net/phy: micrel phy driver
    dm9601: fix phy/eeprom write routine
    ppp_generic: handle non-linear skbs when passing them to pppd
    ppp_generic: pull 2 bytes so that PPP_PROTO(skb) is valid
    net: fix compile error due to double return type in SOCK_DEBUG
    net/usb: initiate sync sequence in sierra_net.c driver
    net/usb: remove default in Kconfig for sierra_net driver
    r8169: Fix rtl8169_rx_interrupt()
    e1000e: Fix oops caused by ASPM patch.
    net/sb1250: register mdio bus in probe
    sctp: Fix skb_over_panic resulting from multiple invalid parameter errors (CVE-2010-1173) (v4)
    p54pci: fix bugs in p54p_check_tx_ring

    Linus Torvalds
     

04 May, 2010

1 commit


30 Apr, 2010

1 commit

  • * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    nfs: fix memory leak in nfs_get_sb with CONFIG_NFS_V4
    nfs: fix some issues in nfs41_proc_reclaim_complete()
    NFS: Ensure that nfs_wb_page() waits for Pg_writeback to clear
    NFS: Fix an unstable write data integrity race
    nfs: testing for null instead of ERR_PTR()
    NFS: rsize and wsize settings ignored on v4 mounts
    NFSv4: Don't attempt an atomic open if the file is a mountpoint
    SUNRPC: Fix a bug in rpcauth_prune_expired

    Linus Torvalds
     

29 Apr, 2010

7 commits

  • Ok, version 4

    Change Notes:
    1) Minor cleanups, from Vlads notes

    Summary:

    Hey-
    Recently, it was reported to me that the kernel could oops in the
    following way:

    kernel BUG at net/core/skbuff.c:91!
    invalid operand: 0000 [#1]
    Modules linked in: sctp netconsole nls_utf8 autofs4 sunrpc iptable_filter
    ip_tables cpufreq_powersave parport_pc lp parport vmblock(U) vsock(U) vmci(U)
    vmxnet(U) vmmemctl(U) vmhgfs(U) acpiphp dm_mirror dm_mod button battery ac md5
    ipv6 uhci_hcd ehci_hcd snd_ens1371 snd_rawmidi snd_seq_device snd_pcm_oss
    snd_mixer_oss snd_pcm snd_timer snd_page_alloc snd_ac97_codec snd soundcore
    pcnet32 mii floppy ext3 jbd ata_piix libata mptscsih mptsas mptspi mptscsi
    mptbase sd_mod scsi_mod
    CPU: 0
    EIP: 0060:[] Not tainted VLI
    EFLAGS: 00010216 (2.6.9-89.0.25.EL)
    EIP is at skb_over_panic+0x1f/0x2d
    eax: 0000002c ebx: c033f461 ecx: c0357d96 edx: c040fd44
    esi: c033f461 edi: df653280 ebp: 00000000 esp: c040fd40
    ds: 007b es: 007b ss: 0068
    Process swapper (pid: 0, threadinfo=c040f000 task=c0370be0)
    Stack: c0357d96 e0c29478 00000084 00000004 c033f461 df653280 d7883180
    e0c2947d
    00000000 00000080 df653490 00000004 de4f1ac0 de4f1ac0 00000004
    df653490
    00000001 e0c2877a 08000800 de4f1ac0 df653490 00000000 e0c29d2e
    00000004
    Call Trace:
    [] sctp_addto_chunk+0xb0/0x128 [sctp]
    [] sctp_addto_chunk+0xb5/0x128 [sctp]
    [] sctp_init_cause+0x3f/0x47 [sctp]
    [] sctp_process_unk_param+0xac/0xb8 [sctp]
    [] sctp_verify_init+0xcc/0x134 [sctp]
    [] sctp_sf_do_5_1B_init+0x83/0x28e [sctp]
    [] sctp_do_sm+0x41/0x77 [sctp]
    [] cache_grow+0x140/0x233
    [] sctp_endpoint_bh_rcv+0xc5/0x108 [sctp]
    [] sctp_inq_push+0xe/0x10 [sctp]
    [] sctp_rcv+0x454/0x509 [sctp]
    [] ipt_hook+0x17/0x1c [iptable_filter]
    [] nf_iterate+0x40/0x81
    [] ip_local_deliver_finish+0x0/0x151
    [] ip_local_deliver_finish+0xc6/0x151
    [] nf_hook_slow+0x83/0xb5
    [] ip_local_deliver+0x1a2/0x1a9
    [] ip_local_deliver_finish+0x0/0x151
    [] ip_rcv+0x334/0x3b4
    [] netif_receive_skb+0x320/0x35b
    [] init_stall_timer+0x67/0x6a [uhci_hcd]
    [] process_backlog+0x6c/0xd9
    [] net_rx_action+0xfe/0x1f8
    [] __do_softirq+0x35/0x79
    [] handle_IRQ_event+0x0/0x4f
    [] do_softirq+0x46/0x4d

    Its an skb_over_panic BUG halt that results from processing an init chunk in
    which too many of its variable length parameters are in some way malformed.

    The problem is in sctp_process_unk_param:
    if (NULL == *errp)
    *errp = sctp_make_op_error_space(asoc, chunk,
    ntohs(chunk->chunk_hdr->length));

    if (*errp) {
    sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM,
    WORD_ROUND(ntohs(param.p->length)));
    sctp_addto_chunk(*errp,
    WORD_ROUND(ntohs(param.p->length)),
    param.v);

    When we allocate an error chunk, we assume that the worst case scenario requires
    that we have chunk_hdr->length data allocated, which would be correct nominally,
    given that we call sctp_addto_chunk for the violating parameter. Unfortunately,
    we also, in sctp_init_cause insert a sctp_errhdr_t structure into the error
    chunk, so the worst case situation in which all parameters are in violation
    requires chunk_hdr->length+(sizeof(sctp_errhdr_t)*param_count) bytes of data.

    The result of this error is that a deliberately malformed packet sent to a
    listening host can cause a remote DOS, described in CVE-2010-1173:
    http://cve.mitre.org/cgi-bin/cvename.cgi?name=2010-1173

    I've tested the below fix and confirmed that it fixes the issue. We move to a
    strategy whereby we allocate a fixed size error chunk and ignore errors we don't
    have space to report. Tested by me successfully

    Signed-off-by: Neil Horman
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Neil Horman
     
  • When we finish processing ASCONF_ACK chunk, we try to send
    the next queued ASCONF. This action runs the sctp state
    machine recursively and it's not prepared to do so.

    kernel BUG at kernel/timer.c:790!
    invalid opcode: 0000 [#1] SMP
    last sysfs file: /sys/module/ipv6/initstate
    Modules linked in: sha256_generic sctp libcrc32c ipv6 dm_multipath
    uinput 8139too i2c_piix4 8139cp mii i2c_core pcspkr virtio_net joydev
    floppy virtio_blk virtio_pci [last unloaded: scsi_wait_scan]

    Pid: 0, comm: swapper Not tainted 2.6.34-rc4 #15 /Bochs
    EIP: 0060:[] EFLAGS: 00010286 CPU: 0
    EIP is at add_timer+0xd/0x1b
    EAX: cecbab14 EBX: 000000f0 ECX: c0957b1c EDX: 03595cf4
    ESI: cecba800 EDI: cf276f00 EBP: c0957aa0 ESP: c0957aa0
    DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    Process swapper (pid: 0, ti=c0956000 task=c0988ba0 task.ti=c0956000)
    Stack:
    c0957ae0 d1851214 c0ab62e4 c0ab5f26 0500ffff 00000004 00000005 00000004
    00000000 d18694fd 00000004 1666b892 cecba800 cecba800 c0957b14
    00000004
    c0957b94 d1851b11 ceda8b00 cecba800 cf276f00 00000001 c0957b14
    000000d0
    Call Trace:
    [] ? sctp_side_effects+0x607/0xdfc [sctp]
    [] ? sctp_do_sm+0x108/0x159 [sctp]
    [] ? sctp_pname+0x0/0x1d [sctp]
    [] ? sctp_primitive_ASCONF+0x36/0x3b [sctp]
    [] ? sctp_process_asconf_ack+0x2a4/0x2d3 [sctp]
    [] ? sctp_sf_do_asconf_ack+0x1dd/0x2b4 [sctp]
    [] ? sctp_do_sm+0xb8/0x159 [sctp]
    [] ? sctp_cname+0x0/0x52 [sctp]
    [] ? sctp_assoc_bh_rcv+0xac/0xe1 [sctp]
    [] ? sctp_inq_push+0x2d/0x30 [sctp]
    [] ? sctp_rcv+0x797/0x82e [sctp]

    Tested-by: Wei Yongjun
    Signed-off-by: Yuansong Qiao
    Signed-off-by: Shuaijun Zhang
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • When calculating the INIT/INIT-ACK chunk length, we should not
    only account the length of parameters, but also the parameters
    zero padding length, such as AUTH HMACS parameter and CHUNKS
    parameter. Without the parameters zero padding length we may get
    following oops.

    skb_over_panic: text:ce2068d2 len:130 put:6 head:cac3fe00 data:cac3fe00 tail:0xcac3fe82 end:0xcac3fe80 dev:
    ------------[ cut here ]------------
    kernel BUG at net/core/skbuff.c:127!
    invalid opcode: 0000 [#2] SMP
    last sysfs file: /sys/module/aes_generic/initstate
    Modules linked in: authenc ......

    Pid: 4102, comm: sctp_darn Tainted: G D 2.6.34-rc2 #6
    EIP: 0060:[] EFLAGS: 00010282 CPU: 0
    EIP is at skb_over_panic+0x37/0x3e
    EAX: 00000078 EBX: c07c024b ECX: c07c02b9 EDX: cb607b78
    ESI: 00000000 EDI: cac3fe7a EBP: 00000002 ESP: cb607b74
    DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Process sctp_darn (pid: 4102, ti=cb607000 task=cabdc990 task.ti=cb607000)
    Stack:
    c07c02b9 ce2068d2 00000082 00000006 cac3fe00 cac3fe00 cac3fe82 cac3fe80
    c07c024b cac3fe7c cac3fe7a c0608dec ca986e80 ce2068d2 00000006 0000007a
    cb8120ca ca986e80 cb812000 00000003 cb8120c4 ce208a25 cb8120ca cadd9400
    Call Trace:
    [] ? sctp_addto_chunk+0x45/0x85 [sctp]
    [] ? skb_put+0x2e/0x32
    [] ? sctp_addto_chunk+0x45/0x85 [sctp]
    [] ? sctp_make_init+0x279/0x28c [sctp]
    [] ? apic_timer_interrupt+0x2a/0x30
    [] ? sctp_sf_do_prm_asoc+0x2b/0x7b [sctp]
    [] ? sctp_do_sm+0xa0/0x14a [sctp]
    [] ? sctp_pname+0x0/0x14 [sctp]
    [] ? sctp_primitive_ASSOCIATE+0x2b/0x31 [sctp]
    [] ? sctp_sendmsg+0x7a0/0x9eb [sctp]
    [] ? inet_sendmsg+0x3b/0x43
    [] ? task_tick_fair+0x2d/0xd9
    [] ? sock_sendmsg+0xa7/0xc1
    [] ? smp_apic_timer_interrupt+0x6b/0x75
    [] ? dequeue_task_fair+0x34/0x19b
    [] ? sched_clock_local+0x17/0x11e
    [] ? _copy_from_user+0x2b/0x10c
    [] ? verify_iovec+0x3c/0x6a
    [] ? sys_sendmsg+0x186/0x1e2
    [] ? __wake_up_common+0x34/0x5b
    [] ? __wake_up+0x2c/0x3b
    [] ? tty_wakeup+0x43/0x47
    [] ? remove_wait_queue+0x16/0x24
    [] ? n_tty_read+0x5b8/0x65e
    [] ? default_wake_function+0x0/0x8
    [] ? sys_socketcall+0x17f/0x1cd
    [] ? sysenter_do_call+0x12/0x22
    Code: 0f 45 de 53 ff b0 98 00 00 00 ff b0 94 ......
    EIP: [] skb_over_panic+0x37/0x3e SS:ESP 0068:cb607b74

    To reproduce:

    # modprobe sctp
    # echo 1 > /proc/sys/net/sctp/addip_enable
    # echo 1 > /proc/sys/net/sctp/auth_enable
    # sctp_test -H 3ffe:501:ffff:100:20c:29ff:fe4d:f37e -P 800 -l
    # sctp_darn -H 3ffe:501:ffff:100:20c:29ff:fe4d:f37e -P 900 -h 192.168.0.21 -p 800 -I -s -t
    sctp_darn ready to send...
    3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> bindx-add=192.168.0.21
    3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> bindx-add=192.168.1.21
    3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> snd=10

    ------------------------------------------------------------------
    eth0 has addresses: 3ffe:501:ffff:100:20c:29ff:fe4d:f37e and 192.168.0.21
    eth1 has addresses: 192.168.1.21
    ------------------------------------------------------------------

    Reported-by: George Cheimonidis
    Signed-off-by: Wei Yongjun
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • Since the change of the atomics to percpu variables, we now
    have to disable BH in process context when touching percpu variables.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • When sctp attempts to update an assocition, it removes any
    addresses that were not in the updated INITs. However, the loop
    may attempt to refrence a transport with address after removing it.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • sk->sk_data_ready() of sctp socket can be called from both BH and non-BH
    contexts, but the default sk->sk_data_ready(), sock_def_readable(), can
    not be used in this case. Therefore, we have to make a new function
    sctp_data_ready() to grab sk->sk_data_ready() with BH disabling.

    =========================================================
    [ INFO: possible irq lock inversion dependency detected ]
    2.6.33-rc6 #129
    ---------------------------------------------------------
    sctp_darn/1517 just changed the state of lock:
    (clock-AF_INET){++.?..}, at: [] sock_def_readable+0x20/0x80
    but this lock took another, SOFTIRQ-unsafe lock in the past:
    (slock-AF_INET){+.-...}

    and interrupts could create inverse lock ordering between them.

    other info that might help us debug this:
    1 lock held by sctp_darn/1517:
    #0: (sk_lock-AF_INET){+.+.+.}, at: [] sctp_sendmsg+0x23d/0xc00 [sctp]

    Signed-off-by: Wei Yongjun
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • This reverts two commits:

    fda48a0d7a8412cedacda46a9c0bf8ef9cd13559
    tcp: bind() fix when many ports are bound

    and a follow-on fix for it:

    6443bb1fc2050ca2b6585a3fa77f7833b55329ed
    ipv6: Fix inet6_csk_bind_conflict()

    It causes problems with binding listening sockets when time-wait
    sockets from a previous instance still are alive.

    It's too late to keep fiddling with this so late in the -rc
    series, and we'll deal with it in net-next-2.6 instead.

    Signed-off-by: David S. Miller

    David S. Miller
     

28 Apr, 2010

1 commit


27 Apr, 2010

2 commits

  • Even with commit 32dec5dd0233ebffa9cae25ce7ba6daeb7df4467 ("bridge
    br_multicast: Don't refer to BR_INPUT_SKB_CB(skb)->mrouters_only
    without IGMP snooping."), BR_INPUT_SKB_CB(skb)->mrouters_only is
    not appropriately initialized if IGMP snooping support is
    compiled and disabled, so we can see garbage.

    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki / 吉藤英明
     
  • Trying to run izlisten (from lowpan-tools tests) on a device that does not
    exists I got the oops below. The problem is that we are using get_dev_by_name
    without checking if we really get a device back. We don't in this case and
    writing to dev->type generates this oops.

    [Oops code removed by Dmitry Eremin-Solenikov]

    If possible this patch should be applied to the current -rc fixes branch.

    Signed-off-by: Stefan Schmidt
    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: David S. Miller

    Stefan Schmidt
     

26 Apr, 2010

1 commit

  • Commit fda48a0d7a84 (tcp: bind() fix when many ports are bound)
    introduced a bug on IPV6 part.
    We should not call ipv6_addr_any(inet6_rcv_saddr(sk2)) but
    ipv6_addr_any(inet6_rcv_saddr(sk)) because sk2 can be IPV4, while sk is
    IPV6.

    Reported-by: Michael S. Tsirkin
    Signed-off-by: Eric Dumazet
    Tested-by: Michael S. Tsirkin
    Signed-off-by: David S. Miller

    Eric Dumazet
     

23 Apr, 2010

4 commits

  • Port autoselection done by kernel only works when number of bound
    sockets is under a threshold (typically 30000).

    When this threshold is over, we must check if there is a conflict before
    exiting first loop in inet_csk_get_port()

    Change inet_csk_bind_conflict() to forbid two reuse-enabled sockets to
    bind on same (address,port) tuple (with a non ANY address)

    Same change for inet6_csk_bind_conflict()

    Reported-by: Gaspar Chilingarov
    Signed-off-by: Eric Dumazet
    Acked-by: Evgeniy Polyakov
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • In the original code, the "goto out" calls "rdma_destroy_id(cm_id);"
    That isn't needed here and would cause problems because "cm_id" is an
    ERR_PTR. The new code just returns directly.

    Signed-off-by: Dan Carpenter
    Acked-by: Andy Grover
    Signed-off-by: David S. Miller

    Dan Carpenter
     
  • In the original code, if rtnl_create_link() returned an ERR_PTR then that
    would get passed to rtnl_configure_link() which dereferences it.

    Signed-off-by: Dan Carpenter
    Acked-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Dan Carpenter
     
  • Don't want to evict a credential if cred->cr_expire == jiffies, since that
    means that it was just placed on the cred_unused list. We therefore need to
    use time_in_range() rather than time_in_range_open().

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

22 Apr, 2010

4 commits

  • The issue raises when having 2 NICs both assigned the same
    IPv6 global address.

    If a sender binds to a particular NIC (SO_BINDTODEVICE),
    the outgoing traffic is being sent via the first found.
    The bonded device is thus not taken into an account during the
    routing.

    From the ip6_route_output function:

    If the binding address is multicast, linklocal or loopback,
    the RT6_LOOKUP_F_IFACE bit is set, but not for global address.

    So binding global address will neglect SO_BINDTODEVICE-binded device,
    because the fib6_rule_lookup function path won't check for the
    flowi::oif field and take first route that fits.

    Signed-off-by: Jiri Olsa
    Signed-off-by: Scott Otto
    Signed-off-by: David S. Miller

    Jiri Olsa
     
  • … less than IPV6_MIN_MTU

    According to RFC2460, PMTU is set to the IPv6 Minimum Link
    MTU (1280) and a fragment header should always be included
    after a node receiving Too Big message reporting PMTU is
    less than the IPv6 Minimum Link MTU.

    After receiving a ICMPv6 Too Big message reporting PMTU is
    less than the IPv6 Minimum Link MTU, sctp *can't* send any
    data/control chunk that total length including IPv6 head
    and IPv6 extend head is less than IPV6_MIN_MTU(1280 bytes).

    The failure occured in p6_fragment(), about reason
    see following(take SHUTDOWN chunk for example):
    sctp_packet_transmit (SHUTDOWN chunk, len=16 byte)
    |------sctp_v6_xmit (local_df=0)
    |------ip6_xmit
    |------ip6_output (dst_allfrag is ture)
    |------ip6_fragment

    In ip6_fragment(), for local_df=0, drops the the packet
    and returns EMSGSIZE.

    The patch fixes it with adding check length of skb->len.
    In this case, Ipv6 not to fragment upper protocol data,
    just only add a fragment header before it.

    Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

    Shan Wei
     
  • 1, An X25 program binds and listens
    2, calls arrive waiting to be accepted
    3, Program exits without accepting
    4, Sockets time out but don't get correctly cleaned up
    5, cat /proc/net/x25/socket shows the dead sockets with bad inode fields.

    This line borrowed from AX25 sets the dying socket so the timers clean up later.

    Signed-off-by: Andrew Hendry
    Signed-off-by: David S. Miller

    andrew hendry
     
  • When building a bundle, we set dst.dev and rt6.rt6i_idev.
    We must ensure to set the same device for both fields.

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     

21 Apr, 2010

5 commits

  • Fix the following RCU warning in dev_pick_tx():

    ===================================================
    [ INFO: suspicious rcu_dereference_check() usage. ]
    ---------------------------------------------------
    net/core/dev.c:1993 invoked rcu_dereference_check() without protection!

    other info that might help us debug this:

    rcu_scheduler_active = 1, debug_locks = 0
    2 locks held by swapper/0:
    #0: (&idev->mc_ifc_timer){+.-...}, at: [] run_timer_softirq+0x17b/0x278
    #1: (rcu_read_lock_bh){.+....}, at: [] dev_queue_xmit+0x14e/0x4dc

    stack backtrace:
    Pid: 0, comm: swapper Not tainted 2.6.34-rc5-cachefs #4
    Call Trace:
    [] lockdep_rcu_dereference+0xaa/0xb2
    [] dev_queue_xmit+0x259/0x4dc
    [] ? dev_queue_xmit+0x14e/0x4dc
    [] ? trace_hardirqs_on+0xd/0xf
    [] ? local_bh_enable_ip+0xbc/0xc1
    [] neigh_resolve_output+0x24b/0x27c
    [] ip6_output_finish+0x7c/0xb4
    [] ip6_output2+0x256/0x261
    [] ? trace_hardirqs_on+0xd/0xf
    [] ip6_output+0xbbc/0xbcb
    [] ? fib6_force_start_gc+0x2b/0x2d
    [] mld_sendpack+0x273/0x39d
    [] ? mld_sendpack+0x0/0x39d
    [] ? mark_held_locks+0x52/0x70
    [] mld_ifc_timer_expire+0x24f/0x288
    [] run_timer_softirq+0x1ec/0x278
    [] ? run_timer_softirq+0x17b/0x278
    [] ? mld_ifc_timer_expire+0x0/0x288
    [] ? __do_softirq+0x69/0x140
    [] __do_softirq+0xa2/0x140
    [] call_softirq+0x1c/0x28
    [] do_softirq+0x38/0x80
    [] irq_exit+0x45/0x47
    [] smp_apic_timer_interrupt+0x88/0x96
    [] apic_timer_interrupt+0x13/0x20
    [] ? __atomic_notifier_call_chain+0x0/0x86
    [] ? mwait_idle+0x6e/0x78
    [] ? mwait_idle+0x65/0x78
    [] cpu_idle+0x4d/0x83
    [] rest_init+0xb9/0xc0
    [] ? rest_init+0x0/0xc0
    [] start_kernel+0x392/0x39d
    [] x86_64_start_reservations+0xb3/0xb7
    [] x86_64_start_kernel+0xe4/0xeb

    An rcu_dereference() should be an rcu_dereference_bh().

    Signed-off-by: David Howells
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    David Howells
     
  • David S. Miller
     
  • My recent patch to remove the open-coded checksum sequence in
    tcp_v6_send_response broke it as we did not set the transport
    header pointer on the new packet.

    Actually, there is code there trying to set the transport
    header properly, but it sets it for the wrong skb ('skb'
    instead of 'buff').

    This bug was introduced by commit
    a8fdf2b331b38d61fb5f11f3aec4a4f9fb2dedcb ("ipv6: Fix
    tcp_v6_send_response(): it didn't set skb transport header")

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • grec_nsrcs is in network order, we should convert to host horder in
    br_multicast_igmp3_report()

    Signed-off-by: Eric Dumazet
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • David S. Miller
     

20 Apr, 2010

2 commits

  • Since "mac80211: make off-channel work generic" drivers have not been
    notified of configuration changes after association or authentication. This
    caused more dependence on current state to ensure driver will be notified
    when configuration changes occur. One such problem arises if off-channel is
    in progress when HT information changes. Since HT is only enabled on the
    "oper_channel" the driver will never be notified of this change. Usually
    the driver is notified soon after of a BSS information change
    (BSS_CHANGED_HT) ... but since the driver did not get a notification that
    this is a HT channel the new BSS information does not make sense.

    Fix this by also changing the off-channel information when HT is enabled
    and thus cause driver to be notified correctly.

    This fixes a problem in 4965 when associated with 5GHz 40MHz channel.
    Without this patch the system can associate but is unable to transfer any
    data, not even ping.

    See http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2158

    Signed-off-by: Reinette Chatre
    Signed-off-by: John W. Linville

    Reinette Chatre
     
  • When the addba timer expires but has no work to do,
    it should not affect the state machine. If it does,
    TX will not see the successfully established and we
    can also crash trying to re-establish the session.

    Cc: stable@kernel.org [2.6.32, 2.6.33]
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

19 Apr, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    gigaset: include cleanup cleanup
    packet : remove init_net restriction
    WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver.
    ip: Fix ip_dev_loopback_xmit()
    net: dev_pick_tx() fix
    fib: suppress lockdep-RCU false positive in FIB trie.
    tun: orphan an skb on tx
    forcedeth: fix tx limit2 flag check
    iwlwifi: work around bogus active chains detection

    Linus Torvalds
     

17 Apr, 2010

1 commit

  • The af_packet protocol is used by Perl to do ioctls as reported by
    Stephane Riviere:

    "Net::RawIP relies on SIOCGIFADDR et SIOCGIFHWADDR to get the IP and MAC
    addresses of the network interface."

    But in a new network namespace these ioctl fail because it is disabled for
    a namespace different from the init_net_ns.

    These two lines should not be there as af_inet and af_packet are
    namespace aware since a long time now. I suppose we forget to remove these
    lines because we sent the af_packet first, before af_inet was supported.

    Signed-off-by: Daniel Lezcano
    Reported-by: Stephane Riviere
    Signed-off-by: David S. Miller

    Daniel Lezcano