03 May, 2010

1 commit


29 Apr, 2010

3 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
     
  • 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
     

11 Apr, 2010

1 commit


08 Apr, 2010

1 commit


06 Apr, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    9p: saving negative to unsigned char
    9p: return on mutex_lock_interruptible()
    9p: Creating files with names too long should fail with ENAMETOOLONG.
    9p: Make sure we are able to clunk the cached fid on umount
    9p: drop nlink remove
    fs/9p: Clunk the fid resulting from partial walk of the name
    9p: documentation update
    9p: Fix setting of protocol flags in v9fs_session_info structure.

    Linus Torvalds
     

05 Apr, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

21 Mar, 2010

1 commit


20 Mar, 2010

1 commit


15 Mar, 2010

1 commit


14 Mar, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (108 commits)
    bridge: ensure to unlock in error path in br_multicast_query().
    drivers/net/tulip/eeprom.c: fix bogus "(null)" in tulip init messages
    sky2: Avoid rtnl_unlock without rtnl_lock
    ipv6: Send netlink notification when DAD fails
    drivers/net/tg3.c: change the field used with the TG3_FLAG_10_100_ONLY constant
    ipconfig: Handle devices which take some time to come up.
    mac80211: Fix memory leak in ieee80211_if_write()
    mac80211: Fix (dynamic) power save entry
    ipw2200: use kmalloc for large local variables
    ath5k: read eeprom IQ calibration values correctly for G mode
    ath5k: fix I/Q calibration (for real)
    ath5k: fix TSF reset
    ath5k: use fixed antenna for tx descriptors
    libipw: split ieee->networks into small pieces
    mac80211: Fix sta_mtx unlocking on insert STA failure path
    rt2x00: remove KSEG1ADDR define from rt2x00soc.h
    net: add ColdFire support to the smc91x driver
    asix: fix setting mac address for AX88772
    ipv6 ip6_tunnel: eliminate unused recursion field from ip6_tnl{}.
    net: Fix dev_mc_add()
    ...

    Linus Torvalds
     

13 Mar, 2010

3 commits

  • This patch changes the name of the new 9P protocol from 9p2010.L to
    9p2000.u. This is because we learnt that the name 9p2010 is already
    being used by others.

    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (56 commits)
    doc: fix typo in comment explaining rb_tree usage
    Remove fs/ntfs/ChangeLog
    doc: fix console doc typo
    doc: cpuset: Update the cpuset flag file
    Fix of spelling in arch/sparc/kernel/leon_kernel.c no longer needed
    Remove drivers/parport/ChangeLog
    Remove drivers/char/ChangeLog
    doc: typo - Table 1-2 should refer to "status", not "statm"
    tree-wide: fix typos "ass?o[sc]iac?te" -> "associate" in comments
    No need to patch AMD-provided drivers/gpu/drm/radeon/atombios.h
    devres/irq: Fix devm_irq_match comment
    Remove reference to kthread_create_on_cpu
    tree-wide: Assorted spelling fixes
    tree-wide: fix 'lenght' typo in comments and code
    drm/kms: fix spelling in error message
    doc: capitalization and other minor fixes in pnp doc
    devres: typo fix s/dev/devm/
    Remove redundant trailing semicolons from macros
    fix typo "definetly" -> "definitely" in comment
    tree-wide: s/widht/width/g typo in comments
    ...

    Fix trivial conflict in Documentation/laptops/00-INDEX

    Linus Torvalds
     
  • Remove INIT_NSPROXY(), use C99 initializer.
    Remove INIT_IPC_NS(), INIT_NET_NS() while I'm at it.

    Note: headers trim will be done later, now it's quite pointless because
    results will be invalidated by merge window.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

10 Mar, 2010

1 commit


09 Mar, 2010

1 commit


08 Mar, 2010

2 commits


06 Mar, 2010

4 commits

  • sk_add_backlog -> __sk_add_backlog
    sk_add_backlog_limited -> sk_add_backlog

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

    Zhu Yi
     
  • We got system OOM while running some UDP netperf testing on the loopback
    device. The case is multiple senders sent stream UDP packets to a single
    receiver via loopback on local host. Of course, the receiver is not able
    to handle all the packets in time. But we surprisingly found that these
    packets were not discarded due to the receiver's sk->sk_rcvbuf limit.
    Instead, they are kept queuing to sk->sk_backlog and finally ate up all
    the memory. We believe this is a secure hole that a none privileged user
    can crash the system.

    The root cause for this problem is, when the receiver is doing
    __release_sock() (i.e. after userspace recv, kernel udp_recvmsg ->
    skb_free_datagram_locked -> release_sock), it moves skbs from backlog to
    sk_receive_queue with the softirq enabled. In the above case, multiple
    busy senders will almost make it an endless loop. The skbs in the
    backlog end up eat all the system memory.

    The issue is not only for UDP. Any protocols using socket backlog is
    potentially affected. The patch adds limit for socket backlog so that
    the backlog size cannot be expanded endlessly.

    Reported-by: Alex Shi
    Cc: David Miller
    Cc: Arnaldo Carvalho de Melo
    Cc: Alexey Kuznetsov
    Cc: Patrick McHardy
    Cc: Vlad Yasevich
    Cc: Sridhar Samudrala
    Cc: Jon Maloy
    Cc: Allan Stephens
    Cc: Andrew Hendry
    Signed-off-by: Zhu Yi
    Signed-off-by: Eric Dumazet
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Zhu Yi
     
  • Removes 'dotu' variable and make everything dependent
    on 'proto_version' field.

    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • Add new mount V9FS mount option to specify protocol version

    This patch adds a new mount option to specify protocol version.
    With this option it is possible to use "-o version=" switch to
    specify 9P protocol version to use. Valid options for version
    are:
    9p2000
    9p2000.u
    9p2010.L

    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     

04 Mar, 2010

3 commits


03 Mar, 2010

1 commit

  • When I merged the bundle creation code, I introduced a bogus
    flowi value in the bundle. Instead of getting from the caller,
    it was instead set to the flow in the route object, which is
    totally different.

    The end result is that the bundles we created never match, and
    we instead end up with an ever growing bundle list.

    Thanks to Jamal for find this problem.

    Reported-by: Jamal Hadi Salim
    Signed-off-by: Herbert Xu
    Acked-by: Steffen Klassert
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Herbert Xu
     

01 Mar, 2010

1 commit


28 Feb, 2010

1 commit


27 Feb, 2010

4 commits

  • With the Bluetooth 3.0 specification and the introduction of alternate
    MAC/PHY (AMP) support, it is required to differentiate between primary
    BR/EDR controllers and 802.11 AMP controllers. So introduce a special
    type inside HCI device for differentiation.

    For now all AMP controllers will be treated as raw devices until an
    AMP manager has been implemented.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • The output of the inquiry cache is only useful for debugging purposes
    and so move it into debugfs.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • The hdev->type is misnamed and should be actually hdev->bus instead. So
    convert it now.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • commit e8469ed959c373c2ff9e6f488aa5a14971aebe1f
    Author: Patrick McHardy
    Date: Tue Feb 23 20:41:30 2010 +0100

    Support specifying the initial device flags when creating a device though
    rtnl_link. Devices allocated by rtnl_create_link() are marked as INITIALIZING
    in order to surpress netlink registration notifications. To complete setup,
    rtnl_configure_link() must be called, which performs the device flag changes
    and invokes the deferred notifiers if everything went well.

    Two examples:

    # add macvlan to eth0
    #
    $ ip link add link eth0 up allmulticast on type macvlan

    [LINK]11: macvlan0@eth0: mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 26:f8:84:02:f9:2a brd ff:ff:ff:ff:ff:ff
    [ROUTE]ff00::/8 dev macvlan0 table local metric 256 mtu 1500 advmss 1440 hoplimit 0
    [ROUTE]fe80::/64 dev macvlan0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
    [LINK]11: macvlan0@eth0: mtu 1500
    link/ether 26:f8:84:02:f9:2a
    [ADDR]11: macvlan0 inet6 fe80::24f8:84ff:fe02:f92a/64 scope link
    valid_lft forever preferred_lft forever
    [ROUTE]local fe80::24f8:84ff:fe02:f92a via :: dev lo table local proto none metric 0 mtu 16436 advmss 16376 hoplimit 0
    [ROUTE]default via fe80::215:e9ff:fef0:10f8 dev macvlan0 proto kernel metric 1024 mtu 1500 advmss 1440 hoplimit 0
    [NEIGH]fe80::215:e9ff:fef0:10f8 dev macvlan0 lladdr 00:15:e9:f0:10:f8 router STALE
    [ROUTE]2001:6f8:974::/64 dev macvlan0 proto kernel metric 256 expires 0sec mtu 1500 advmss 1440 hoplimit 0
    [PREFIX]prefix 2001:6f8:974::/64 dev macvlan0 onlink autoconf valid 14400 preferred 131084
    [ADDR]11: macvlan0 inet6 2001:6f8:974:0:24f8:84ff:fe02:f92a/64 scope global dynamic
    valid_lft 86399sec preferred_lft 14399sec

    # add VLAN to eth1, eth1 is down
    #
    $ ip link add link eth1 up type vlan id 1000
    RTNETLINK answers: Network is down

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

26 Feb, 2010

2 commits


25 Feb, 2010

1 commit

  • Update rcu_dereference() primitives to use new lockdep-based
    checking. The rcu_dereference() in __in6_dev_get() may be
    protected either by rcu_read_lock() or RTNL, per Eric Dumazet.
    The rcu_dereference() in __sk_free() is protected by the fact
    that it is never reached if an update could change it. Check
    for this by using rcu_dereference_check() to verify that the
    struct sock's ->sk_wmem_alloc counter is zero.

    Acked-by: Eric Dumazet
    Acked-by: David S. Miller
    Signed-off-by: Paul E. McKenney
    Cc: laijs@cn.fujitsu.com
    Cc: dipankar@in.ibm.com
    Cc: mathieu.desnoyers@polymtl.ca
    Cc: josh@joshtriplett.org
    Cc: dvhltc@us.ibm.com
    Cc: niv@us.ibm.com
    Cc: peterz@infradead.org
    Cc: rostedt@goodmis.org
    Cc: Valdis.Kletnieks@vt.edu
    Cc: dhowells@redhat.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Paul E. McKenney
     

23 Feb, 2010

3 commits