10 Jul, 2015

9 commits

  • We have to put back the references to the master conntrack and the expectation
    that we just created, otherwise we'll leak them.

    Fixes: 0ef71ee1a5b9 ("netfilter: ctnetlink: refactor ctnetlink_create_expect")
    Reported-by: Tim Wiess
    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     
  • Commit c29390c6dfee ("xps: must clear sender_cpu before forwarding")
    fixed an issue in normal forward path, caused by sender_cpu & napi_id
    skb fields being an union.

    Bridge is another point where skb can be forwarded, so we need
    the same cure.

    Bug triggers if packet was received on a NIC using skb_mark_napi_id()

    Fixes: 2bd82484bb4c ("xps: fix xps for stacked devices")
    Signed-off-by: Eric Dumazet
    Reported-by: Bob Liu
    Tested-by: Bob Liu
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Value returned by devm_ioremap_resource() was checked for non-NULL but
    devm_ioremap_resource() returns IOMEM_ERR_PTR, not NULL. In case of
    error this could lead to dereference of ERR_PTR.

    Signed-off-by: Krzysztof Kozlowski
    Cc:
    Fixes: 46aa27df8853 ("net: axienet: Use devm_* calls")
    Reviewed-by: Sören Brinkmann
    Signed-off-by: David S. Miller

    Krzysztof Kozlowski
     
  • Oleg Nesterov says:

    ====================
    net: pktgen: fix race between pktgen_thread_worker() and kthread_stop()

    I am not familiar with this code and I have no idea how to test
    these changes, so 2/2 comes as a separate change. 1/2 looks like
    the obvious bugfix, and probably candidate for -stable.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • pktgen_thread_worker() doesn't need to wait for kthread_stop(), it
    can simply exit. Just pktgen_create_thread() and pg_net_exit() should
    do get_task_struct()/put_task_struct(). kthread_stop(dead_thread) is
    fine.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: David S. Miller

    Oleg Nesterov
     
  • pktgen_thread_worker() is obviously racy, kthread_stop() can come
    between the kthread_should_stop() check and set_current_state().

    Signed-off-by: Oleg Nesterov
    Reported-by: Jan Stancek
    Reported-by: Marcelo Leitner
    Signed-off-by: David S. Miller

    Oleg Nesterov
     
  • NCM specs are not actually mandating a specific position in the frame for
    the NDP (Network Datagram Pointer). However, some Huawei devices will
    ignore our aggregates if it is not placed after the datagrams it points
    to. Add support for doing just this, in a per-device configurable way.
    While at it, update NCM subdrivers, disabling this functionality in all of
    them, except in huawei_cdc_ncm where it is enabled instead.
    We aren't making any distinction between different Huawei NCM devices,
    based on what the vendor driver does. Standard NCM devices are left
    unaffected: if they are compliant, they should be always usable, still
    stay on the safe side.

    This change has been tested and working with a Huawei E3131 device (which
    works regardless of NDP position), a Huawei E3531 (also working both
    ways) and an E3372 (which mandates NDP to be after indexed datagrams).

    V1->V2:
    - corrected wrong NDP acronym definition
    - fixed possible NULL pointer dereference
    - patch cleanup
    V2->V3:
    - Properly account for the NDP size when writing new packets to SKB

    Signed-off-by: Enrico Mioso
    Signed-off-by: David S. Miller

    Enrico Mioso
     
  • In commit 'c03abd84634d ("net: ethernet: cpsw: don't requests
    IRQs we don't use")', common isr is split into tx and rx, but
    in rx isr tx interrupt is also disabledi in cpsw_disable_irq().
    So tx interrupts are not handled during rx interrupts and rx
    napi completion and results in poor tx performance by 40Mbps.
    Fixing by disabling only rx interrupt in rx isr.

    Cc: Felipe Balbi
    Cc: # v4.0+
    Signed-off-by: Mugunthan V N
    Signed-off-by: David S. Miller

    Mugunthan V N
     
  • Use eth_hw_addr_random() instead of calling random_ether_addr().
    Here, this change is setting addr_assign_type to NET_ADDR_RANDOM.

    The Coccinelle semantic patch that performs this transformation
    is as follows:

    @@
    identifier a,b;
    @@

    -random_ether_addr(a->b);
    +eth_hw_addr_random(a);

    Signed-off-by: Vaishali Thakkar
    Tested-by: Florian Fainelli
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Vaishali Thakkar
     

09 Jul, 2015

27 commits

  • Destroy minor_idr on module_exit, reclaiming the allocated memory.

    This was detected by the following semantic patch (written by Luis Rodriguez
    )

    @ defines_module_init @
    declarer name module_init, module_exit;
    declarer name DEFINE_IDR;
    identifier init;
    @@

    module_init(init);

    @ defines_module_exit @
    identifier exit;
    @@

    module_exit(exit);

    @ declares_idr depends on defines_module_init && defines_module_exit @
    identifier idr;
    @@

    DEFINE_IDR(idr);

    @ on_exit_calls_destroy depends on declares_idr && defines_module_exit @
    identifier declares_idr.idr, defines_module_exit.exit;
    @@

    exit(void)
    {
    ...
    idr_destroy(&idr);
    ...
    }

    @ missing_module_idr_destroy depends on declares_idr && defines_module_exit && !on_exit_calls_destroy @
    identifier declares_idr.idr, defines_module_exit.exit;
    @@

    exit(void)
    {
    ...
    +idr_destroy(&idr);
    }

    Signed-off-by: Johannes Thumshirn
    Signed-off-by: David S. Miller

    Johannes Thumshirn
     
  • Pablo Neira Ayuso says:

    ====================
    Netfilter fixes for net

    The following patchset contains Netfilter fixes for your net tree. This batch
    mostly comes with patches to address fallout from the previous merge window
    cycle, they are:

    1) Use entry->state.hook_list from nf_queue() instead of the global nf_hooks
    which is not valid when used from NFPROTO_NETDEV, this should cause no
    problems though since we have no userspace queueing for that family, but
    let's fix this now for the sake of correctness. Patch from Eric W. Biederman.

    2) Fix compilation breakage in bridge netfilter if CONFIG_NF_DEFRAG_IPV4 is not
    set, from Bernhard Thaler.

    3) Use percpu jumpstack in arptables too, now that there's a single copy of the
    rule blob we can't store the return address there anymore. Patch from
    Florian Westphal.

    4) Fix a skb leak in the xmit path of bridge netfilter, problem there since
    2.6.37 although it should be not possible to hit invalid traffic there, also
    from Florian.

    5) Eric Leblond reports that when loading a large ruleset with many missing
    modules after a fresh boot, nf_tables can take long time commit it. Fix this
    by processing the full batch until the end, even on missing modules, then
    abort only once and restart processing.

    6) Add bridge netfilter files to the MAINTAINER files.

    7) Fix a net_device refcount leak in the new IPV6 bridge netfilter code, from
    Julien Grall.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The limit for BQL is updated each time we call
    netdev_tx_completed_queue.
    Without this patch the BQL limit was updated for every TX event we
    see.
    The issue was that this only updated the limit to handle the data
    we complete in two events as the first event wouldn't show that
    enough traffic had been processed between them.

    This was OK when interrupt moderation was off but not when it was
    on as more data had to be completed in a single interrupt.

    The patch changes this so that we do report the completion to BQL
    only when all the TX events in the interrupt have been processed.

    Signed-off-by: Shradha Shah
    Signed-off-by: David S. Miller

    Peter Dunning
     
  • This device is sold as 'NVIDIA Tegra USB 3.0 Ethernet'.
    Chipset is RTL8153 and works with r8152.

    Signed-off-by: Zheng Liu
    Signed-off-by: David S. Miller

    Zheng Liu
     
  • As its first order of business, boomerang_interrupt() checks whether
    the device really has any pending interrupts. If it does not,
    it does nothing and returns, but it still returns IRQ_HANDLED.

    This is wrong: interrupt was not handled, IRQ handlers of other
    devices sharing this IRQ line need to be called.

    vortex_interrupt() has it right: it returns IRQ_NONE in this case
    via IRQ_RETVAL(0).

    Do the same in boomerang_interrupt().

    Signed-off-by: Denys Vlasenko
    CC: David S. Miller
    CC: linux-kernel@vger.kernel.org
    CC: netdev@vger.kernel.org
    Signed-off-by: David S. Miller

    Denys Vlasenko
     
  • vmxnet3's current napi path is built to count every rx descriptor we recieve,
    and use that as a count of the napi budget. That means its possible to return
    from a napi poll halfway through recieving a fragmented packet accross multiple
    dma descriptors. If that happens, the next napi poll will start with the
    descriptor ring in an improper state (e.g. the first descriptor we look at may
    have the end-of-packet bit set), which will cause a BUG halt in the driver.

    Fix the issue by only counting whole received packets in the napi poll and
    returning that value, rather than the descriptor count.

    Tested by the reporter and myself, successfully

    Signed-off-by: Neil Horman
    CC: Shreyas Bhatewara
    CC: "David S. Miller"
    Acked-by: Andy Gospodarek
    Signed-off-by: David S. Miller

    Neil Horman
     
  • This kernel patch exports the value of the new
    ignore_routes_with_linkdown via netconf.

    v2: changes to notify userspace via netlink when sysctl values change
    and proposed for 'net' since this could be considered a bugfix

    Signed-off-by: Andy Gospodarek
    Suggested-by: Nicolas Dichtel
    Acked-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Andy Gospodarek
     
  • This patch avoids the double up_write to filter_sem if
    efx_net_open() fails.

    Resolves: 2d432f20d27c1813a2746008e16dd6ce12a14dc1

    Signed-off-by: Shradha Shah
    Signed-off-by: David S. Miller

    Shradha Shah
     
  • Since commit b0e9a30dd669 ("bridge: Add vlan id to multicast groups")
    there's a check in br_ip_equal() for a matching vlan id, but the mdb
    functions were not modified to use (or at least zero it) so when an
    entry was added it would have a garbage vlan id (from the local br_ip
    variable in __br_mdb_add/del) and this would prevent it from being
    matched and also deleted. So zero out the whole local ip var to protect
    ourselves from future changes and also to fix the current bug, since
    there's no vlan id support in the mdb uapi - use always vlan id 0.
    Example before patch:
    root@debian:~# bridge mdb add dev br0 port eth1 grp 239.0.0.1 permanent
    root@debian:~# bridge mdb
    dev br0 port eth1 grp 239.0.0.1 permanent
    root@debian:~# bridge mdb del dev br0 port eth1 grp 239.0.0.1 permanent
    RTNETLINK answers: Invalid argument

    After patch:
    root@debian:~# bridge mdb add dev br0 port eth1 grp 239.0.0.1 permanent
    root@debian:~# bridge mdb
    dev br0 port eth1 grp 239.0.0.1 permanent
    root@debian:~# bridge mdb del dev br0 port eth1 grp 239.0.0.1 permanent
    root@debian:~# bridge mdb

    Signed-off-by: Nikolay Aleksandrov
    Fixes: b0e9a30dd669 ("bridge: Add vlan id to multicast groups")
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     
  • When cpsw's number of slave is set to 1 in device tree and while
    accessing second slave ndev and priv in cpsw_tx_interrupt(),
    there is a kernel crash. This is due to cpsw_get_slave_priv()
    not verifying number of slaves while retriving netdev priv and
    returns a invalid memory region. Fixing the issue by introducing
    number of slave check in cpsw_get_slave_priv() and
    cpsw_get_slave_ndev().

    [ 15.879589] Unable to handle kernel paging request at virtual address 0f0e142c
    [ 15.888540] pgd = ed374000
    [ 15.891359] [0f0e142c] *pgd=00000000
    [ 15.895105] Internal error: Oops: 5 [#1] SMP ARM
    [ 15.899936] Modules linked in:
    [ 15.903139] CPU: 0 PID: 593 Comm: udhcpc Tainted: G W 4.1.0-12205-gfda8b18-dirty #10
    [ 15.912386] Hardware name: Generic AM43 (Flattened Device Tree)
    [ 15.918557] task: ed2a2e00 ti: ed3fe000 task.ti: ed3fe000
    [ 15.924187] PC is at cpsw_tx_interrupt+0x30/0x44
    [ 15.929008] LR is at _raw_spin_unlock_irqrestore+0x40/0x44
    [ 15.934726] pc : [] lr : [] psr: 20000193
    [ 15.934726] sp : ed3ffc08 ip : ed2a2e40 fp : 00000000
    [ 15.946685] r10: c0969ce8 r9 : c0969cfc r8 : 00000000
    [ 15.952129] r7 : 000000c6 r6 : ee54ab00 r5 : ee169c64 r4 : ee534e00
    [ 15.958932] r3 : 0f0e0d0c r2 : 00000000 r1 : ed3ffbc0 r0 : 00000001
    [ 15.965735] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
    [ 15.973261] Control: 10c5387d Table: ad374059 DAC: 00000015
    [ 15.979246] Process udhcpc (pid: 593, stack limit = 0xed3fe218)
    [ 15.985414] Stack: (0xed3ffc08 to 0xed400000)
    [ 15.989954] fc00: ee54ab00 c009928c c0a9e648 60000193 000032e4 ee169c00
    [ 15.998478] fc20: ee169c64 ee169c00 ee169c64 ee54ab00 00000001 00000001 ee67e268 ee008800
    [ 16.006995] fc40: ee534800 c009946c ee169c00 ee169c64 c08bd660 c009c370 c009c2a4 000000c6
    [ 16.015513] fc60: c08b75c4 c08b0854 00000000 c0098b3c 000000c6 c0098c50 ed3ffcb0 0000003a
    [ 16.024033] fc80: ed3ffcb0 fa24010c c08b7800 fa240100 ee7e9880 c00094c4 c05ef4e8 60000013
    [ 16.032556] fca0: ffffffff ed3ffce4 ee7e9880 c05ef964 00000001 ed2a33d8 00000000 ed2a2e00
    [ 16.041080] fcc0: 60000013 ee536bf8 60000013 ee51b800 ee7e9880 ee67e268 ee7e9880 ee534800
    [ 16.049603] fce0: c0ad0768 ed3ffcf8 c008e910 c05ef4e8 60000013 ffffffff 00000001 00000001
    [ 16.058121] fd00: ee536bf8 c0487a04 00000000 00000000 ee534800 00000000 00000156 c048c990
    [ 16.066645] fd20: 00000000 00000000 c0969f40 00000000 00000000 c05000e8 00000001 00000000
    [ 16.075167] fd40: 00000000 c051eefc 00000000 ee67e268 00000000 00000000 ee51b800 ed3ffd9c
    [ 16.083690] fd60: 00000000 ee67e200 ee51b800 ee7e9880 ee67e268 00000000 00000000 ee67e200
    [ 16.092211] fd80: ee51b800 ee7e9880 ee67e268 ee534800 ee67e200 c051eedc ee67e268 00000010
    [ 16.100727] fda0: 00000000 00000000 ee7e9880 ee534800 00000000 ee67e268 ee51b800 c05006fc
    [ 16.109247] fdc0: ee67e268 00000001 c0500488 00000156 ee7e9880 00000000 ed3fe000 fffffff4
    [ 16.117771] fde0: ed3fff1c ee7e9880 ee534800 00000148 00000000 ed1f8340 00000000 00000000
    [ 16.126289] fe00: 00000000 c05a9054 00000000 00000000 00000156 c0ab62a8 00000010 ed3e7000
    [ 16.134812] fe20: 00000000 00000008 edcfb700 ed3fff1c c0fb5f94 ed2a2e00 c0fb5f64 000005d8
    [ 16.143336] fe40: c0a9b3b8 00000000 ed3e7070 00000000 00000000 00000000 00009f40 00000000
    [ 16.151858] fe60: 00000000 00020022 00110008 00000000 00000000 43004400 00000000 ffffffff
    [ 16.160374] fe80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 16.168898] fea0: edcfb700 bee5f380 00000014 00000000 ed3fe000 00000000 00004400 c04e2b64
    [ 16.177415] fec0: 00000002 c04e3b00 ed3ffeec 00000001 0000011a 00000000 00000000 bee5f394
    [ 16.185937] fee0: 00000148 ed3fff10 00000014 00000001 00000000 00000000 ed3ffee4 00000000
    [ 16.194459] ff00: 00000000 00000000 00000000 c04e3664 00080011 00000002 06000000 ffffffff
    [ 16.202980] ff20: 0000ffff ffffffff 0000ffff c008dd54 ee5a6f08 ee636e80 c096972d c0089c14
    [ 16.211499] ff40: 00000000 60000013 ee5a6f40 60000013 00000000 ee5a6f40 00000002 00000006
    [ 16.220023] ff60: 00000000 edcfb700 00000001 ed2a2e00 c000f60c 00000001 0000011a c008ea34
    [ 16.228540] ff80: 00000006 00000000 bee5f380 00000014 bee5f380 00000014 bee5f380 00000122
    [ 16.237059] ffa0: c000f7c4 c000f5e0 bee5f380 00000014 00000006 bee5f394 00000148 00000000
    [ 16.245581] ffc0: bee5f380 00000014 bee5f380 00000122 fffffd6e 00004300 00004800 00004400
    [ 16.254104] ffe0: bee5f378 bee5f36c 000307ec b6f39044 40000010 00000006 ed36fa40 00000000
    [ 16.262642] [] (cpsw_tx_interrupt) from [] (handle_irq_event_percpu+0x64/0x204)
    [ 16.272076] [] (handle_irq_event_percpu) from [] (handle_irq_event+0x40/0x64)
    [ 16.281330] [] (handle_irq_event) from [] (handle_fasteoi_irq+0xcc/0x1a8)
    [ 16.290220] [] (handle_fasteoi_irq) from [] (generic_handle_irq+0x20/0x30)
    [ 16.299197] [] (generic_handle_irq) from [] (__handle_domain_irq+0x64/0xdc)
    [ 16.308273] [] (__handle_domain_irq) from [] (gic_handle_irq+0x20/0x60)
    [ 16.316987] [] (gic_handle_irq) from [] (__irq_svc+0x44/0x5c)
    [ 16.324779] Exception stack(0xed3ffcb0 to 0xed3ffcf8)
    [ 16.330044] fca0: 00000001 ed2a33d8 00000000 ed2a2e00
    [ 16.338567] fcc0: 60000013 ee536bf8 60000013 ee51b800 ee7e9880 ee67e268 ee7e9880 ee534800
    [ 16.347090] fce0: c0ad0768 ed3ffcf8 c008e910 c05ef4e8 60000013 ffffffff
    [ 16.353987] [] (__irq_svc) from [] (_raw_spin_unlock_irqrestore+0x34/0x44)
    [ 16.362973] [] (_raw_spin_unlock_irqrestore) from [] (cpdma_check_free_tx_desc+0x60/0x6c)
    [ 16.373311] [] (cpdma_check_free_tx_desc) from [] (cpsw_ndo_start_xmit+0xb4/0x1ac)
    [ 16.383017] [] (cpsw_ndo_start_xmit) from [] (dev_hard_start_xmit+0x2a4/0x4c0)
    [ 16.392364] [] (dev_hard_start_xmit) from [] (sch_direct_xmit+0xf4/0x210)
    [ 16.401246] [] (sch_direct_xmit) from [] (__dev_queue_xmit+0x2ac/0x7bc)
    [ 16.409960] [] (__dev_queue_xmit) from [] (packet_sendmsg+0xc68/0xeb4)
    [ 16.418585] [] (packet_sendmsg) from [] (sock_sendmsg+0x14/0x24)
    [ 16.426663] [] (sock_sendmsg) from [] (SyS_sendto+0xb4/0xe0)
    [ 16.434377] [] (SyS_sendto) from [] (ret_fast_syscall+0x0/0x54)
    [ 16.442360] Code: e5943118 e593303c e3530000 0a000002 (e5930720)
    [ 16.448716] ---[ end trace a68159f094d85ba6 ]---
    [ 16.453526] Kernel panic - not syncing: Fatal exception in interrupt
    [ 16.460149] ---[ end Kernel panic - not syncing: Fatal exception in interrupt

    Signed-off-by: Mugunthan V N
    Cc: # v3.8+
    Signed-off-by: David S. Miller

    Mugunthan V N
     
  • Calling connect() with an AF_TIPC socket would trigger a series
    of error messages from SELinux along the lines of:
    SELinux: Invalid class 0
    type=AVC msg=audit(1434126658.487:34500): avc: denied { }
    for pid=292 comm="kworker/u16:5" scontext=system_u:system_r:kernel_t:s0
    tcontext=system_u:object_r:unlabeled_t:s0 tclass=
    permissive=0

    This was due to a failure to initialize the security state of the new
    connection sock by the tipc code, leaving it with junk in the security
    class field and an unlabeled secid. Add a call to security_sk_clone()
    to inherit the security state from the parent socket.

    Reported-by: Tim Shearer
    Signed-off-by: Stephen Smalley
    Acked-by: Paul Moore
    Acked-by: Ying Xue
    Signed-off-by: David S. Miller

    Stephen Smalley
     
  • Shradha Shah says:

    ====================
    sfc: compat for lack of VADAPTOR_SET_MAC in adaptor_firmware

    David S. Miller
     
  • Signed-off-by: Shradha Shah
    Signed-off-by: David S. Miller

    Daniel Pieczko
     
  • Some versions of MCFW do not support the MC_CMD_VADAPTOR_SET_MAC
    command, and ENOSYS will be returned.

    If the PF created its own vport, the function's datapath must be
    stopped and the vport can be reconfigured to reflect the new MAC
    address.

    If the MCFW created the vport for the PF (which is the case when
    the nic_data->vport_mac is blank), nothing further needs to be
    done as the vport is not under the control of the PF.

    This only applies to PFs because the MCFW in question does not
    support VFs.

    Signed-off-by: Shradha Shah
    Signed-off-by: David S. Miller

    Daniel Pieczko
     
  • Re-organize the structure of error handling to avoid having
    to duplicate the netif_err() around the ifdefs.

    The only change to the behaviour of the error-handling is that
    the PF's data structure to record VF details should only be
    updated if the original command succeeded.

    Signed-off-by: Shradha Shah
    Signed-off-by: David S. Miller

    Daniel Pieczko
     
  • When "primary_reselect" is set to "failure", primary interface should
    not become active until current active slave is down. But if we set first
    member of bond device as a "primary" interface and "primary_reselect"
    is set to "failure" then whenever primary interface's link get back(up)
    it become active slave even if current active slave is still up.

    With this patch, "bond_find_best_slave" will not traverse members if
    primary interface is not candidate for failover/reselection and current
    active slave is still up.

    Signed-off-by: Mazhar Rana
    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Mazhar Rana
     
  • Frag needed should be sent only if the inner header asked
    to not fragment. Currently fragmentation is broken if the
    tunnel has df set, but df was not asked in the original
    packet. The tunnel's df needs to be still checked to update
    internally the pmtu cache.

    Commit 23a3647bc4f93bac broke it, and this commit fixes
    the ipv4 df check back to the way it was.

    Fixes: 23a3647bc4f93bac ("ip_tunnels: Use skb-len to PMTU check.")
    Cc: Pravin B Shelar
    Signed-off-by: Timo Teräs
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Timo Teräs
     
  • Jason Gunthorpe reported that since commit c02db8c6290b ("rtnetlink: make
    SR-IOV VF interface symmetric"), we don't verify IFLA_VF_INFO attributes
    anymore with respect to their policy, that is, ifla_vfinfo_policy[].

    Before, they were part of ifla_policy[], but they have been nested since
    placed under IFLA_VFINFO_LIST, that contains the attribute IFLA_VF_INFO,
    which is another nested attribute for the actual VF attributes such as
    IFLA_VF_MAC, IFLA_VF_VLAN, etc.

    Despite the policy being split out from ifla_policy[] in this commit,
    it's never applied anywhere. nla_for_each_nested() only does basic nla_ok()
    testing for struct nlattr, but it doesn't know about the data context and
    their requirements.

    Fix, on top of Jason's initial work, does 1) parsing of the attributes
    with the right policy, and 2) using the resulting parsed attribute table
    from 1) instead of the nla_for_each_nested() loop (just like we used to
    do when still part of ifla_policy[]).

    Reference: http://thread.gmane.org/gmane.linux.network/368913
    Fixes: c02db8c6290b ("rtnetlink: make SR-IOV VF interface symmetric")
    Reported-by: Jason Gunthorpe
    Cc: Chris Wright
    Cc: Sucheta Chakraborty
    Cc: Greg Rose
    Cc: Jeff Kirsher
    Cc: Rony Efraim
    Cc: Vlad Zolotarov
    Cc: Nicolas Dichtel
    Cc: Thomas Graf
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Daniel Borkmann
    Acked-by: Vlad Zolotarov
    Signed-off-by: David S. Miller

    Daniel Borkmann
     
  • When a switch is attached to the mdio bus, the mdio bus can be used
    while the interface is not open. If the IPG clock is not enabled, MDIO
    reads/writes will simply time out.

    Add support for runtime PM to control this clock. Enable/disable this
    clock using runtime PM, with open()/close() and mdio read()/write()
    function triggering runtime PM operations. Since PM is optional, the
    IPG clock is enabled at probe and is no longer modified by
    fec_enet_clk_enable(), thus if PM is not enabled in the kernel, it is
    guaranteed the clock is running when MDIO operations are performed.

    Signed-off-by: Andrew Lunn
    Acked-by: Fugang Duan
    Signed-off-by: David S. Miller

    Andrew Lunn
     
  • When running a kernel configured with CONFIG_DMA_API_DEBUG=y a warning
    is issued:
    DMA-API: device driver tries to sync DMA memory it has not allocated

    This warning is the result of mapping the full range of the Rx buffer
    pages allocated and then performing a dma_sync_single_for_cpu against
    a calculated DMA address. The proper thing to do is to use the
    dma_sync_single_range_for_cpu with a base DMA address and an offset.

    Reported-by: Kim Phillips
    Signed-off-by: Tom Lendacky
    Tested-by: Kim Phillips
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • This reverts commit e1622baf54df8cc958bf29d71de5ad545ea7d93c.

    The side effect of this commit is to add a '@NONE' after each virtual
    interface name with a 'ip link'. It may break existing scripts.

    Reported-by: Olivier Hartkopp
    Signed-off-by: Nicolas Dichtel
    Tested-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • User space can crash kernel with

    ip link add ifb10 numtxqueues 100000 type ifb

    We must replace a BUG_ON() by proper test and return -EINVAL for
    crazy values.

    Fixes: 60877a32bce00 ("net: allow large number of tx queues")
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • If rhashtable_walk_next detects a resize operation in progress, it jumps
    to the new table and continues walking that one. But it misses to drop
    the reference to it's current item, leading it to continue traversing
    the new table's bucket in which the current item is sorted into, and
    after reaching that bucket's end continues traversing the new table's
    second bucket instead of the first one, thereby potentially missing
    items.

    This fixes the rhashtable runtime test for me. Bug probably introduced
    by Herbert Xu's patch eddee5ba ("rhashtable: Fix walker behaviour during
    rehash") although not explicitly tested.

    Fixes: eddee5ba ("rhashtable: Fix walker behaviour during rehash")
    Signed-off-by: Phil Sutter
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Phil Sutter
     
  • Start the delete timer when adding temp static entries so they can expire.

    Signed-off-by: Satish Ashok
    Signed-off-by: Nikolay Aleksandrov
    Fixes: ccb1c31a7a87 ("bridge: add flags to distinguish permanent mdb entires")
    Signed-off-by: David S. Miller

    Satish Ashok
     
  • On UML builds, mdio-mux-mmioreg.c fails to compile:

    drivers/net/phy/mdio-mux-mmioreg.c:50:3: error: implicit declaration of function ‘ioremap’ [-Werror=implicit-function-declaration]
    drivers/net/phy/mdio-mux-mmioreg.c:63:3: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]

    This is due to CONFIG_OF now being user selectable. Add a dependency on
    HAS_IOMEM to fix this.

    Signed-off-by: Rob Herring
    Cc: Florian Fainelli
    Cc: David S. Miller
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Rob Herring
     
  • Since 1d5da757da860a6916adbf68b09e868062b4b3b8 (ax25: Stop using magic
    neighbour cache operations.) any attempt to transmit IP packets over
    a bpqether device will result in a message like "Dead loop on virtual
    device bpq0, fix it urgently!"

    Fix suggested by Eric W. Biederman .

    Signed-off-by: Ralf Baechle
    Cc: # 4.1
    Signed-off-by: David S. Miller

    Ralf Baechle
     
  • rate estimators are limited to 4 Mpps, which was fine years ago, but
    too small with current hardware generation.

    Lets use 2^5 scaling instead of 2^10 to get 128 Mpps new limit.

    On 64bit arch, use an "unsigned long" for temp storage and remove limit.
    (We do not expect 32bit arches to be able to reach this point)

    Tested:

    tc -s -d filter sh dev eth0 parent ffff:

    filter protocol ip pref 1 u32
    filter protocol ip pref 1 u32 fh 800: ht divisor 1
    filter protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:15
    match 07000000/ff000000 at 12
    action order 1: gact action drop
    random type none pass val 0
    index 1 ref 1 bind 1 installed 166 sec
    Action statistics:
    Sent 39734251496 bytes 863788076 pkt (dropped 863788117, overlimits 0 requeues 0)
    rate 4067Mbit 11053596pps backlog 0b 0p requeues 0

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

    Eric Dumazet
     

08 Jul, 2015

2 commits

  • The commit efb6de9b4ba0092b2c55f6a52d16294a8a698edd "netfilter: bridge:
    forward IPv6 fragmented packets" introduced a new function
    br_validate_ipv6 which take a reference on the inet6 device. Although,
    the reference is not released at the end.

    This will result to the impossibility to destroy any netdevice using
    ipv6 and bridge.

    It's possible to directly retrieve the inet6 device without taking a
    reference as all netfilter hooks are protected by rcu_read_lock via
    nf_hook_slow.

    Spotted while trying to destroy a Xen guest on the upstream Linux:
    "unregister_netdevice: waiting for vif1.0 to become free. Usage count = 1"

    Signed-off-by: Julien Grall
    Cc: Bernhard Thaler
    Cc: Pablo Neira Ayuso
    Cc: fw@strlen.de
    Cc: ian.campbell@citrix.com
    Cc: wei.liu2@citrix.com
    Cc: Bob Liu
    Acked-by: Stephen Hemminger
    Signed-off-by: Pablo Neira Ayuso

    Julien Grall
     
  • So scripts/get_maintainer.pl shows the Netfilter mailing lists.

    Reported-by: Julien Grall
    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

04 Jul, 2015

2 commits

  • Part of commit 49aa284fe64c4c1 ("cxgb4: Add support for devlog")
    change introduced a real bug where the Device Log Sequence Numbers are
    no longer being converted from firmware Big-Endian to local CPU-Endian
    format.

    This patch moves all of the translation into the devlog_show() routine.
    The only endianness code now in devlog_open() is the small loop to find the
    earliest (lowest Sequence Number) Device Log entry in the circular buffer.

    Signed-off-by: Hariprasad Shenai
    Signed-off-by: David S. Miller

    Hariprasad Shenai
     
  • Before commit daad151263cf ("ipv6: Make ipv6_is_mld() inline and use it
    from ip6_mc_input().") MLD packets were only processed locally. After the
    change, a copy of MLD packet goes through ip6_mr_input, causing
    MRT6MSG_NOCACHE message to be generated to user space.

    Make MLD packet only processed locally.

    Fixes: daad151263cf ("ipv6: Make ipv6_is_mld() inline and use it from ip6_mc_input().")
    Signed-off-by: Hermin Anggawijaya
    Signed-off-by: David S. Miller

    Angga