11 Jan, 2012

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    fs/9p: iattr_valid flags are kernel internal flags map them to 9p values.
    fs/9p: We should not allocate a new inode when creating hardlines.
    fs/9p: v9fs_stat2inode should update suid/sgid bits.
    9p: Reduce object size with CONFIG_NET_9P_DEBUG
    fs/9p: check schedule_timeout_interruptible return value

    Fix up trivial conflicts in fs/9p/{vfs_inode.c,vfs_inode_dotl.c} due to
    debug messages having changed to use p9_debug() on one hand, and the
    changes for umode_t on the other.

    Linus Torvalds
     

10 Jan, 2012

1 commit


09 Jan, 2012

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
    Kconfig: acpi: Fix typo in comment.
    misc latin1 to utf8 conversions
    devres: Fix a typo in devm_kfree comment
    btrfs: free-space-cache.c: remove extra semicolon.
    fat: Spelling s/obsolate/obsolete/g
    SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
    tools/power turbostat: update fields in manpage
    mac80211: drop spelling fix
    types.h: fix comment spelling for 'architectures'
    typo fixes: aera -> area, exntension -> extension
    devices.txt: Fix typo of 'VMware'.
    sis900: Fix enum typo 'sis900_rx_bufer_status'
    decompress_bunzip2: remove invalid vi modeline
    treewide: Fix comment and string typo 'bufer'
    hyper-v: Update MAINTAINERS
    treewide: Fix typos in various parts of the kernel, and fix some comments.
    clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
    gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
    leds: Kconfig: Fix typo 'D2NET_V2'
    sound: Kconfig: drop unknown symbol ARCH_CLPS7500
    ...

    Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
    kconfig additions, close to removed commented-out old ones)

    Linus Torvalds
     

06 Jan, 2012

2 commits

  • This patch splits the red_parms structure into two components.

    One holding the RED 'constant' parameters, and one containing the
    variables.

    This permits a size reduction of GRED qdisc, and is a preliminary step
    to add an optional RED unit to SFQ.

    SFQRED will have a single red_parms structure shared by all flows, and a
    private red_vars per flow.

    Signed-off-by: Eric Dumazet
    CC: Dave Taht
    CC: Stephen Hemminger
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Reduce object size by deduplicating formats.

    Use vsprintf extension %pV.
    Rename P9_DPRINTK uses to p9_debug, align arguments.
    Add function for _p9_debug and macro to add __func__.
    Add missing "\n"s to p9_debug uses.
    Remove embedded function names as p9_debug adds it.
    Remove P9_EPRINTK macro and convert use to pr_.
    Add and use pr_fmt and pr_.

    $ size fs/9p/built-in.o*
    text data bss dec hex filename
    62133 984 16000 79117 1350d fs/9p/built-in.o.new
    67342 984 16928 85254 14d06 fs/9p/built-in.o.old
    $ size net/9p/built-in.o*
    text data bss dec hex filename
    88792 4148 22024 114964 1c114 net/9p/built-in.o.new
    94072 4148 23232 121452 1da6c net/9p/built-in.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Eric Van Hensbergen

    Joe Perches
     

05 Jan, 2012

5 commits

  • …wireless-next into for-davem

    Conflicts:
    drivers/net/wireless/b43legacy/dma.c

    John W. Linville
     
  • Recently Dave noticed that a test we did in ipv6_add_addr to see if we next hop
    route for the interface we're adding an addres to was wrong (see commit
    7ffbcecbeed91e5874e9a1cfc4c0cbb07dac3069). for one, it never triggers, and two,
    it was completely wrong to begin with. This test was meant to cover this
    section of RFC 4429:

    3.3 Modifications to RFC 2462 Stateless Address Autoconfiguration

    * (modifies section 5.5) A host MAY choose to configure a new address
    as an Optimistic Address. A host that does not know the SLLAO
    of its router SHOULD NOT configure a new address as Optimistic.
    A router SHOULD NOT configure an Optimistic Address.

    This patch should bring us into proper compliance with the above clause. Since
    we only add a SLAAC address after we've received a RA which may or may not
    contain a source link layer address option, we can pass a pointer to that option
    to addrconf_prefix_rcv (which may be null if the option is not present), and
    only set the optimistic flag if the option was found in the RA.

    Change notes:
    (v2) modified the new parameter to addrconf_prefix_rcv to be a bool rather than
    a pointer to make its use more clear as per request from davem.

    Signed-off-by: Neil Horman
    CC: "David S. Miller"
    CC: Hideaki YOSHIFUJI
    Signed-off-by: David S. Miller

    Neil Horman
     
  • The nfcid1 is the NFC-A identifier.
    It is exported as an attribute of the target info
    (returned as a response to NFC_CMD_GET_TARGET).

    Signed-off-by: Ilan Elias
    Acked-by: Samuel Ortiz
    Signed-off-by: John W. Linville

    Ilan Elias
     
  • Add support for NCI Interface Error Notification.
    When this notification is received and we're during a
    data exchange transaction, indicate an error to the NFC
    core layer via the data exchange callback.

    Signed-off-by: Ilan Elias
    Signed-off-by: John W. Linville

    Ilan Elias
     
  • Addition, deletion, and modification of NCI constants.
    Changes in NCI commands, responses, and notifications structures.

    Signed-off-by: Ilan Elias
    Signed-off-by: John W. Linville

    Ilan Elias
     

04 Jan, 2012

1 commit


03 Jan, 2012

1 commit


31 Dec, 2011

3 commits

  • We should not forget to try for real server with port 0
    in the backup server when processing the sync message. We should
    do it in all cases because the backup server can use different
    forwarding method.

    Signed-off-by: Julian Anastasov
    Signed-off-by: Simon Horman
    Signed-off-by: Pablo Neira Ayuso

    Julian Anastasov
     
  • During some debugging I needed to look into how /proc/net/ipv6_route
    operated and in my digging I found its calling fib6_clean_all() which uses
    "write_lock_bh(&table->tb6_lock)" before doing the walk of the table. I
    found this on 2.6.32, but reading the code I believe the same basic idea
    exists currently. Looking at the rtnetlink code they are only calling
    "read_lock_bh(&table->tb6_lock);" via fib6_dump_table(). While I realize
    reading from proc isn't the recommended way of fetching the ipv6 route
    table; taking a write lock seems unnecessary and would probably cause
    network performance issues.

    To verify this I loaded up the ipv6 route table and then ran iperf in 3
    cases:
    * doing nothing
    * reading ipv6 route table via proc
    (while :; do cat /proc/net/ipv6_route > /dev/null; done)
    * reading ipv6 route table via rtnetlink
    (while :; do ip -6 route show table all > /dev/null; done)

    * Load the ipv6 route table up with:
    * for ((i = 0;i < 4000;i++)); do ip route add unreachable 2000::$i; done

    * iperf commands:
    * client: iperf -i 1 -V -c
    * server: iperf -V -s

    * iperf results - 3 runs each (in Mbits/sec)
    * nothing: client: 927,927,927 server: 927,927,927
    * proc: client: 179,97,96,113 server: 142,112,133
    * iproute: client: 928,927,928 server: 927,927,927

    lock_stat shows taking the write lock is causing the slowdown. Using this
    info I decided to write a version of fib6_clean_all() which replaces
    write_lock_bh(&table->tb6_lock) with read_lock_bh(&table->tb6_lock). With
    this new function I see the same results as with my rtnetlink iperf test.

    Signed-off-by: Josh Hunt
    Signed-off-by: David S. Miller

    Josh Hunt
     
  • Currently tcp diag reports rqlen and wqlen values similar to how
    the CINQ/COUTQ iotcls do. To make unix diag report these values
    in the same way move the respective code into helpers.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

29 Dec, 2011

3 commits


25 Dec, 2011

1 commit


24 Dec, 2011

1 commit


23 Dec, 2011

13 commits

  • The NAT range to nlattr conversation callbacks and helpers are entirely
    dead code and are also useless since there are no NAT ranges in conntrack
    context, they are only used for initially selecting a tuple. The final NAT
    information is contained in the selected tuples of the conntrack entry.

    Signed-off-by: Patrick McHardy
    Signed-off-by: Pablo Neira Ayuso

    Patrick McHardy
     
  • The only remaining user of NAT protocol module reference counting is NAT
    ctnetlink support. Since this is a fairly short sequence of code, convert
    over to use RCU and remove module reference counting.

    Module unregistration is already protected by RCU using synchronize_rcu(),
    so no further changes are necessary.

    Signed-off-by: Patrick McHardy
    Signed-off-by: Pablo Neira Ayuso

    Patrick McHardy
     
  • Export the NAT definitions to userspace. So far userspace (specifically,
    iptables) has been copying the headers files from include/net. Also
    rename some structures and definitions in preparation for IPv6 NAT.
    Since these have never been officially exported, this doesn't affect
    existing userspace code.

    Signed-off-by: Patrick McHardy
    Signed-off-by: Pablo Neira Ayuso

    Patrick McHardy
     
  • This partially reworks bc01befdcf3e40979eb518085a075cbf0aacede0
    which added userspace expectation support.

    This patch removes the nf_ct_userspace_expect_list since now we
    force to use the new iptables CT target feature to add the helper
    extension for conntracks that have attached expectations from
    userspace.

    A new version of the proof-of-concept code to implement userspace
    helpers from userspace is available at:

    http://people.netfilter.org/pablo/userspace-conntrack-helpers/nf-ftp-helper-POC.tar.bz2

    This patch also modifies the CT target to allow to set the
    conntrack's userspace helper status flags. This flag is used
    to tell the conntrack system to explicitly allocate the helper
    extension.

    This helper extension is useful to link the userspace expectations
    with the master conntrack that is being tracked from one userspace
    helper.

    This feature fixes a problem in the current approach of the
    userspace helper support. Basically, if the master conntrack that
    has got a userspace expectation vanishes, the expectations point to
    one invalid memory address. Thus, triggering an oops in the
    expectation deletion event path.

    I decided not to add a new revision of the CT target because
    I only needed to add a new flag for it. I'll document in this
    issue in the iptables manpage. I have also changed the return
    value from EINVAL to EOPNOTSUPP if one flag not supported is
    specified. Thus, in the future adding new features that only
    require a new flag can be added without a new revision.

    There is no official code using this in userspace (apart from
    the proof-of-concept) that uses this infrastructure but there
    will be some by beginning 2012.

    Reported-by: Sam Roberts
    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     
  • skb->truesize might be big even for a small packet.

    Its even bigger after commit 87fb4b7b533 (net: more accurate skb
    truesize) and big MTU.

    We should allow queueing at least one packet per receiver, even with a
    low RCVBUF setting.

    Reported-by: Michal Simek
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Chris Boot reported crashes occurring in ipv6_select_ident().

    [ 461.457562] RIP: 0010:[] []
    ipv6_select_ident+0x31/0xa7

    [ 461.578229] Call Trace:
    [ 461.580742]
    [ 461.582870] [] ? udp6_ufo_fragment+0x124/0x1a2
    [ 461.589054] [] ? ipv6_gso_segment+0xc0/0x155
    [ 461.595140] [] ? skb_gso_segment+0x208/0x28b
    [ 461.601198] [] ? ipv6_confirm+0x146/0x15e
    [nf_conntrack_ipv6]
    [ 461.608786] [] ? nf_iterate+0x41/0x77
    [ 461.614227] [] ? dev_hard_start_xmit+0x357/0x543
    [ 461.620659] [] ? nf_hook_slow+0x73/0x111
    [ 461.626440] [] ? br_parse_ip_options+0x19a/0x19a
    [bridge]
    [ 461.633581] [] ? dev_queue_xmit+0x3af/0x459
    [ 461.639577] [] ? br_dev_queue_push_xmit+0x72/0x76
    [bridge]
    [ 461.646887] [] ? br_nf_post_routing+0x17d/0x18f
    [bridge]
    [ 461.653997] [] ? nf_iterate+0x41/0x77
    [ 461.659473] [] ? br_flood+0xfa/0xfa [bridge]
    [ 461.665485] [] ? nf_hook_slow+0x73/0x111
    [ 461.671234] [] ? br_flood+0xfa/0xfa [bridge]
    [ 461.677299] [] ?
    nf_bridge_update_protocol+0x20/0x20 [bridge]
    [ 461.684891] [] ? nf_ct_zone+0xa/0x17 [nf_conntrack]
    [ 461.691520] [] ? br_flood+0xfa/0xfa [bridge]
    [ 461.697572] [] ? NF_HOOK.constprop.8+0x3c/0x56
    [bridge]
    [ 461.704616] [] ?
    nf_bridge_push_encap_header+0x1c/0x26 [bridge]
    [ 461.712329] [] ? br_nf_forward_finish+0x8a/0x95
    [bridge]
    [ 461.719490] [] ?
    nf_bridge_pull_encap_header+0x1c/0x27 [bridge]
    [ 461.727223] [] ? br_nf_forward_ip+0x1c0/0x1d4 [bridge]
    [ 461.734292] [] ? nf_iterate+0x41/0x77
    [ 461.739758] [] ? __br_deliver+0xa0/0xa0 [bridge]
    [ 461.746203] [] ? nf_hook_slow+0x73/0x111
    [ 461.751950] [] ? __br_deliver+0xa0/0xa0 [bridge]
    [ 461.758378] [] ? NF_HOOK.constprop.4+0x56/0x56
    [bridge]

    This is caused by bridge netfilter special dst_entry (fake_rtable), a
    special shared entry, where attaching an inetpeer makes no sense.

    Problem is present since commit 87c48fa3b46 (ipv6: make fragment
    identifications less predictable)

    Introduce DST_NOPEER dst flag and make sure ipv6_select_ident() and
    __ip_select_ident() fallback to the 'no peer attached' handling.

    Reported-by: Chris Boot
    Tested-by: Chris Boot
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • They don't need to disable interrupts anymore, we only run in process
    context now.

    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Gustavo F. Padovan
     
  • It was never used, so removing it.

    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Gustavo F. Padovan
     
  • We simply say that regular this_cpu use must be safe regardless of
    preemption and interrupt state. That has no material change for x86
    and s390 implementations of this_cpu operations. However, arches that
    do not provide their own implementation for this_cpu operations will
    now get code generated that disables interrupts instead of preemption.

    -tj: This is part of on-going percpu API cleanup. For detailed
    discussion of the subject, please refer to the following thread.

    http://thread.gmane.org/gmane.linux.kernel/1222078

    Signed-off-by: Christoph Lameter
    Signed-off-by: Tejun Heo
    LKML-Reference:

    Christoph Lameter
     
  • To achive Man-In-The-Middle (MITM) level security with Low Energy,
    we have to enable User Passkey Comparison. This commit modifies the
    hard-coded JUST-WORKS pairing mechanism to support query via the MGMT
    interface of Passkey comparison and User Confirmation.

    Signed-off-by: Brian Gix
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Brian Gix
     
  • When cancelling a delayed work (timer) in L2CAP we can not sleep holding
    the sock mutex otherwise we might deadlock with an L2CAP timer handler.
    This is possible because RX/TX and L2CAP timers run in different workqueues.
    The scenario below illustrates the problem. Thus we are now avoiding to
    sleep on the timers locks.

    ======================================================
    [ INFO: possible circular locking dependency detected ]
    3.1.0-05270-ga978dc7-dirty #239
    -------------------------------------------------------
    kworker/1:1/873 is trying to acquire lock:
    (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+...}, at: [] l2cap_chan_timeout+0x3c/0xe0 [bluetooth]

    but task is already holding lock:
    ((&(&chan->chan_timer)->work)){+.+...}, at: [] process_one_work+0x126/0x450

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 ((&(&chan->chan_timer)->work)){+.+...}:
    [] check_prevs_add+0xf6/0x170
    [] validate_chain+0x613/0x790
    [] __lock_acquire+0x4be/0xac0
    [] lock_acquire+0x8d/0xb0
    [] wait_on_work+0x4f/0x160
    [] __cancel_work_timer+0x73/0x80
    [] cancel_delayed_work_sync+0xd/0x10
    [] l2cap_chan_connect+0x22d/0x470 [bluetooth]
    [] l2cap_sock_connect+0xb1/0x140 [bluetooth]
    [] kernel_connect+0xb/0x10
    [] rfcomm_session_create+0x12a/0x1c0 [rfcomm]
    [] __rfcomm_dlc_open+0x1c7/0x240 [rfcomm]
    [] rfcomm_dlc_open+0x42/0x70 [rfcomm]
    [] rfcomm_sock_connect+0x103/0x150 [rfcomm]
    [] sys_connect+0xae/0xc0
    [] compat_sys_socketcall+0xb2/0x220
    [] sysenter_dispatch+0x7/0x30

    -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+...}:
    [] check_prev_add+0x6cd/0x6e0
    [] check_prevs_add+0xf6/0x170
    [] validate_chain+0x613/0x790
    [] __lock_acquire+0x4be/0xac0
    [] lock_acquire+0x8d/0xb0
    [] lock_sock_nested+0x8a/0xa0
    [] l2cap_chan_timeout+0x3c/0xe0 [bluetooth]
    [] process_one_work+0x184/0x450
    [] worker_thread+0x15e/0x340
    [] kthread+0x96/0xa0
    [] kernel_thread_helper+0x4/0x10

    other info that might help us debug this:

    Possible unsafe locking scenario:

    CPU0 CPU1
    ---- ----
    lock((&(&chan->chan_timer)->work));
    lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP);
    lock((&(&chan->chan_timer)->work));
    lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP);

    *** DEADLOCK ***

    2 locks held by kworker/1:1/873:
    #0: (events){.+.+.+}, at: [] process_one_work+0x126/0x450
    #1: ((&(&chan->chan_timer)->work)){+.+...}, at: [] process_one_work+0x126/0x450

    stack backtrace:
    Pid: 873, comm: kworker/1:1 Not tainted 3.1.0-05270-ga978dc7-dirty #239
    Call Trace:
    [] print_circular_bug+0xd2/0xe3
    [] check_prev_add+0x6cd/0x6e0
    [] check_prevs_add+0xf6/0x170
    [] validate_chain+0x613/0x790
    [] __lock_acquire+0x4be/0xac0
    [] ? lock_sock_nested+0x66/0xa0
    [] ? lock_release_nested+0x100/0x110
    [] ? lock_sock_nested+0x66/0xa0
    [] lock_acquire+0x8d/0xb0
    [] ? l2cap_chan_timeout+0x3c/0xe0 [bluetooth]
    [] lock_sock_nested+0x8a/0xa0
    [] ? l2cap_chan_timeout+0x3c/0xe0 [bluetooth]
    [] ? process_one_work+0x126/0x450
    [] l2cap_chan_timeout+0x3c/0xe0 [bluetooth]
    [] process_one_work+0x184/0x450
    [] ? process_one_work+0x126/0x450
    [] ? l2cap_security_cfm+0x4e0/0x4e0 [bluetooth]
    [] worker_thread+0x15e/0x340
    [] ? manage_workers+0x110/0x110
    [] kthread+0x96/0xa0
    [] kernel_thread_helper+0x4/0x10
    [] ? retint_restore_args+0xe/0xe
    [] ? __init_kthread_worker+0x70/0x70
    [] ? gs_change+0xb/0xb

    Signed-off-by: Ulisses Furquim
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Ulisses Furquim
     
  • The struct hci_proto and all related register/unregister and dispatching
    code was removed. HCI core code now call directly the SCO and L2CAP
    event functions.

    Signed-off-by: Ulisses Furquim
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Ulisses Furquim
     
  • Make code readable by removing magic numbers.

    Signed-off-by: Andrei Emeltchenko
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Andrei Emeltchenko
     

22 Dec, 2011

1 commit

  • flow_cach_flush() might sleep but can be called from
    atomic context via the xfrm garbage collector. So add
    a flow_cache_flush_deferred() function and use this if
    the xfrm garbage colector is invoked from within the
    packet path.

    Signed-off-by: Steffen Klassert
    Acked-by: Timo Teräs
    Signed-off-by: David S. Miller

    Steffen Klassert
     

21 Dec, 2011

6 commits