07 Jun, 2017

1 commit

  • We might call br_afspec() with p == NULL which is a valid use case if
    the action is on the bridge device itself, but the bridge tunnel code
    dereferences the p pointer without checking, so check if p is null
    first.

    Reported-by: Gustavo A. R. Silva
    Fixes: efa5356b0d97 ("bridge: per vlan dst_metadata netlink support")
    Signed-off-by: Nikolay Aleksandrov
    Acked-by: Roopa Prabhu
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     

02 Jun, 2017

1 commit

  • When the transition of NO_STP -> KERNEL_STP was fixed by always calling
    mod_timer in br_stp_start, it introduced a new regression which causes
    the timer to be armed even when the bridge is down, and since we stop
    the timers in its ndo_stop() function, they never get disabled if the
    device is destroyed before it's upped.

    To reproduce:
    $ while :; do ip l add br0 type bridge hello_time 100; brctl stp br0 on;
    ip l del br0; done;

    CC: Xin Long
    CC: Ivan Vecera
    CC: Sebastian Ott
    Reported-by: Sebastian Ott
    Fixes: 6d18c732b95c ("bridge: start hello_timer when enabling KERNEL_STP in br_stp_start")
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     

22 May, 2017

2 commits

  • Since commit 76b91c32dd86 ("bridge: stp: when using userspace stp stop
    kernel hello and hold timers"), bridge would not start hello_timer if
    stp_enabled is not KERNEL_STP when br_dev_open.

    The problem is even if users set stp_enabled with KERNEL_STP later,
    the timer will still not be started. It causes that KERNEL_STP can
    not really work. Users have to re-ifup the bridge to avoid this.

    This patch is to fix it by starting br->hello_timer when enabling
    KERNEL_STP in br_stp_start.

    As an improvement, it's also to start hello_timer again only when
    br->stp_enabled is KERNEL_STP in br_hello_timer_expired, there is
    no reason to start the timer again when it's NO_STP.

    Fixes: 76b91c32dd86 ("bridge: stp: when using userspace stp stop kernel hello and hold timers")
    Reported-by: Haidong Li
    Signed-off-by: Xin Long
    Acked-by: Nikolay Aleksandrov
    Reviewed-by: Ivan Vecera
    Signed-off-by: David S. Miller

    Xin Long
     
  • Pablo Neira Ayuso says:

    ====================
    Netfilter/IPVS fixes for net

    The following patchset contains Netfilter/IPVS fixes for your net tree,
    they are:

    1) When using IPVS in direct-routing mode, normal traffic from the LVS
    host to a back-end server is sometimes incorrectly NATed on the way
    back into the LVS host. Patch to fix this from Julian Anastasov.

    2) Calm down clang compilation warning in ctnetlink due to type
    mismatch, from Matthias Kaehlcke.

    3) Do not re-setup NAT for conntracks that are already confirmed, this
    is fixing a problem that was introduced in the previous nf-next batch.
    Patch from Liping Zhang.

    4) Do not allow conntrack helper removal from userspace cthelper
    infrastructure if already in used. This comes with an initial patch
    to introduce nf_conntrack_helper_put() that is required by this fix.
    From Liping Zhang.

    5) Zero the pad when copying data to userspace, otherwise iptables fails
    to remove rules. This is a follow up on the patchset that sorts out
    the internal match/target structure pointer leak to userspace. Patch
    from the same author, Willem de Bruijn. This also comes with a build
    failure when CONFIG_COMPAT is not on, coming in the last patch of
    this series.

    6) SYNPROXY crashes with conntrack entries that are created via
    ctnetlink, more specifically via conntrackd state sync. Patch from
    Eric Leblond.

    7) RCU safe iteration on set element dumping in nf_tables, from
    Liping Zhang.

    8) Missing sanitization of immediate date for the bitwise and cmp
    expressions in nf_tables.

    9) Refcounting logic for chain and objects from set elements does not
    integrate into the nf_tables 2-phase commit protocol.

    10) Missing sanitization of target verdict in ebtables arpreply target,
    from Gao Feng.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

18 May, 2017

1 commit

  • Currently it is allowed to set the default pvid of a bridge to a value
    above VLAN_VID_MASK (0xfff). This patch adds a check to br_validate and
    returns -EINVAL in case the pvid is out of bounds.

    Reproduce by calling:

    [root@test ~]# ip l a type bridge
    [root@test ~]# ip l a type dummy
    [root@test ~]# ip l s bridge0 type bridge vlan_filtering 1
    [root@test ~]# ip l s bridge0 type bridge vlan_default_pvid 9999
    [root@test ~]# ip l s dummy0 master bridge0
    [root@test ~]# bridge vlan
    port vlan ids
    bridge0 9999 PVID Egress Untagged

    dummy0 9999 PVID Egress Untagged

    Fixes: 0f963b7592ef ("bridge: netlink: add support for default_pvid")
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: Tobias Jungel
    Acked-by: Sabrina Dubroca
    Signed-off-by: David S. Miller

    Tobias Jungel
     

16 May, 2017

1 commit

  • The info->target comes from userspace and it would be used directly.
    So we need to add the sanity check to make sure it is a valid standard
    target, although the ebtables tool has already checked it. Kernel needs
    to validate anything coming from userspace.

    If the target is set as an evil value, it would break the ebtables
    and cause a panic. Because the non-standard target is treated as one
    offset.

    Now add one helper function ebt_invalid_target, and we would replace
    the macro INVALID_TARGET later.

    Signed-off-by: Gao Feng
    Signed-off-by: Pablo Neira Ayuso

    Gao Feng
     

15 May, 2017

1 commit

  • When looking up an iptables rule, the iptables binary compares the
    aligned match and target data (XT_ALIGN). In some cases this can
    exceed the actual data size to include padding bytes.

    Before commit f77bc5b23fb1 ("iptables: use match, target and data
    copy_to_user helpers") the malloc()ed bytes were overwritten by the
    kernel with kzalloced contents, zeroing the padding and making the
    comparison succeed. After this patch, the kernel copies and clears
    only data, leaving the padding bytes undefined.

    Extend the clear operation from data size to aligned data size to
    include the padding bytes, if any.

    Padding bytes can be observed in both match and target, and the bug
    triggered, by issuing a rule with match icmp and target ACCEPT:

    iptables -t mangle -A INPUT -i lo -p icmp --icmp-type 1 -j ACCEPT
    iptables -t mangle -D INPUT -i lo -p icmp --icmp-type 1 -j ACCEPT

    Fixes: f77bc5b23fb1 ("iptables: use match, target and data copy_to_user helpers")
    Reported-by: Paul Moore
    Reported-by: Richard Guy Briggs
    Signed-off-by: Willem de Bruijn
    Signed-off-by: Pablo Neira Ayuso

    Willem de Bruijn
     

05 May, 2017

1 commit

  • The attribute sizes for IFLA_BRPORT_MCAST_FLOOD and
    IFLA_BRPORT_BCAST_FLOOD weren't accounted for in br_port_info_size()
    when they were added. Do so now and also add the corresponding policy
    entries:

    Cc: Nikolay Aleksandrov
    Cc: Mike Manning
    Fixes: b6cb5ac8331b ("net: bridge: add per-port multicast flood flag")
    Fixes: 99f906e9ad7b ("bridge: add per-port broadcast flood flag")
    Signed-off-by: Tobias Klauser
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Tobias Klauser
     

03 May, 2017

1 commit

  • Pablo Neira Ayuso says:

    ====================
    Netfilter/IPVS/OVS fixes for net

    The following patchset contains a rather large batch of Netfilter, IPVS
    and OVS fixes for your net tree. This includes fixes for ctnetlink, the
    userspace conntrack helper infrastructure, conntrack OVS support,
    ebtables DNAT target, several leaks in error path among other. More
    specifically, they are:

    1) Fix reference count leak in the CT target error path, from Gao Feng.

    2) Remove conntrack entry clashing with a matching expectation, patch
    from Jarno Rajahalme.

    3) Fix bogus EEXIST when registering two different userspace helpers,
    from Liping Zhang.

    4) Don't leak dummy elements in the new bitmap set type in nf_tables,
    from Liping Zhang.

    5) Get rid of module autoload from conntrack update path in ctnetlink,
    we don't need autoload at this late stage and it is happening with
    rcu read lock held which is not good. From Liping Zhang.

    6) Fix deadlock due to double-acquire of the expect_lock from conntrack
    update path, this fixes a bug that was introduced when the central
    spinlock got removed. Again from Liping Zhang.

    7) Safe ct->status update from ctnetlink path, from Liping. The expect_lock
    protection that was selected when the central spinlock was removed was
    not really protecting anything at all.

    8) Protect sequence adjustment under ct->lock.

    9) Missing socket match with IPv6, from Peter Tirsek.

    10) Adjust skb->pkt_type of DNAT'ed frames from ebtables, from
    Linus Luessing.

    11) Don't give up on evaluating the expression on new entries added via
    dynset expression in nf_tables, from Liping Zhang.

    12) Use skb_checksum() when mangling icmpv6 in IPv6 NAT as this deals
    with non-linear skbuffs.

    13) Don't allow IPv6 service in IPVS if no IPv6 support is available,
    from Paolo Abeni.

    14) Missing mutex release in error path of xt_find_table_lock(), from
    Dan Carpenter.

    15) Update maintainers files, Netfilter section. Add Florian to the
    file, refer to nftables.org and change project status from Supported
    to Maintained.

    16) Bail out on mismatching extensions in element updates in nf_tables.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

01 May, 2017

2 commits

  • Pablo Neira Ayuso says:

    ====================
    Netfilter/IPVS updates for net-next

    The following patchset contains Netfilter updates for your net-next
    tree. A large bunch of code cleanups, simplify the conntrack extension
    codebase, get rid of the fake conntrack object, speed up netns by
    selective synchronize_net() calls. More specifically, they are:

    1) Check for ct->status bit instead of using nfct_nat() from IPVS and
    Netfilter codebase, patch from Florian Westphal.

    2) Use kcalloc() wherever possible in the IPVS code, from Varsha Rao.

    3) Simplify FTP IPVS helper module registration path, from Arushi Singhal.

    4) Introduce nft_is_base_chain() helper function.

    5) Enforce expectation limit from userspace conntrack helper,
    from Gao Feng.

    6) Add nf_ct_remove_expect() helper function, from Gao Feng.

    7) NAT mangle helper function return boolean, from Gao Feng.

    8) ctnetlink_alloc_expect() should only work for conntrack with
    helpers, from Gao Feng.

    9) Add nfnl_msg_type() helper function to nfnetlink to build the
    netlink message type.

    10) Get rid of unnecessary cast on void, from simran singhal.

    11) Use seq_puts()/seq_putc() instead of seq_printf() where possible,
    also from simran singhal.

    12) Use list_prev_entry() from nf_tables, from simran signhal.

    13) Remove unnecessary & on pointer function in the Netfilter and IPVS
    code.

    14) Remove obsolete comment on set of rules per CPU in ip6_tables,
    no longer true. From Arushi Singhal.

    15) Remove duplicated nf_conntrack_l4proto_udplite4, from Gao Feng.

    16) Remove unnecessary nested rcu_read_lock() in
    __nf_nat_decode_session(). Code running from hooks are already
    guaranteed to run under RCU read side.

    17) Remove deadcode in nf_tables_getobj(), from Aaron Conole.

    18) Remove double assignment in nf_ct_l4proto_pernet_unregister_one(),
    also from Aaron.

    19) Get rid of unsed __ip_set_get_netlink(), from Aaron Conole.

    20) Don't propagate NF_DROP error to userspace via ctnetlink in
    __nf_nat_alloc_null_binding() function, from Gao Feng.

    21) Revisit nf_ct_deliver_cached_events() to remove unnecessary checks,
    from Gao Feng.

    22) Kill the fake untracked conntrack objects, use ctinfo instead to
    annotate a conntrack object is untracked, from Florian Westphal.

    23) Remove nf_ct_is_untracked(), now obsolete since we have no
    conntrack template anymore, from Florian.

    24) Add event mask support to nft_ct, also from Florian.

    25) Move nf_conn_help structure to
    include/net/netfilter/nf_conntrack_helper.h.

    26) Add a fixed 32 bytes scratchpad area for conntrack helpers.
    Thus, we don't deal with variable conntrack extensions anymore.
    Make sure userspace conntrack helper doesn't go over that size.
    Remove variable size ct extension infrastructure now this code
    got no more clients. From Florian Westphal.

    27) Restore offset and length of nf_ct_ext structure to 8 bytes now
    that wraparound is not possible any longer, also from Florian.

    28) Allow to get rid of unassured flows under stress in conntrack,
    this applies to DCCP, SCTP and TCP protocols, from Florian.

    29) Shrink size of nf_conntrack_ecache structure, from Florian.

    30) Use TCP_MAX_WSCALE instead of hardcoded 14 in TCP tracker,
    from Gao Feng.

    31) Register SYNPROXY hooks on demand, from Florian Westphal.

    32) Use pernet hook whenever possible, instead of global hook
    registration, from Florian Westphal.

    33) Pass hook structure to ebt_register_table() to consolidate some
    infrastructure code, from Florian Westphal.

    34) Use consume_skb() and return NF_STOLEN, instead of NF_DROP in the
    SYNPROXY code, to make sure device stats are not fooled, patch
    from Gao Feng.

    35) Remove NF_CT_EXT_F_PREALLOC this kills quite some code that we
    don't need anymore if we just select a fixed size instead of
    expensive runtime time calculation of this. From Florian.

    36) Constify nf_ct_extend_register() and nf_ct_extend_unregister(),
    from Florian.

    37) Simplify nf_ct_ext_add(), this kills nf_ct_ext_create(), from
    Florian.

    38) Attach NAT extension on-demand from masquerade and pptp helper
    path, from Florian.

    39) Get rid of useless ip_vs_set_state_timeout(), from Aaron Conole.

    40) Speed up netns by selective calls of synchronize_net(), from
    Florian Westphal.

    41) Silence stack size warning gcc in 32-bit arch in snmp helper,
    from Florian.

    42) Inconditionally call nf_ct_ext_destroy(), even if we have no
    extensions, to deal with the NF_NAT_MANIP_SRC case. Patch from
    Liping Zhang.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
    entries") added the ability to "take over an entry which was previously
    learned via HW when it shows up from a SW port".

    However, if an entry was learned via HW and then a control packet
    (e.g., ARP request) was trapped to the CPU, the bridge driver will
    update the entry and remove the externally learned flag, although the
    entry is still present in HW. Instead, only clear the externally learned
    flag in case of roaming.

    Fixes: 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb entries")
    Signed-off-by: Ido Schimmel
    Signed-off-by: Arkadi Sharashevsky
    Cc: Nikolay Aleksandrov
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Arkadi Sharshevsky
     

28 Apr, 2017

1 commit

  • Support for l2 multicast flood control was added in commit b6cb5ac8331b
    ("net: bridge: add per-port multicast flood flag"). It allows broadcast
    as it was introduced specifically for unknown multicast flood control.
    But as broadcast is a special case of multicast, this may also need to
    be disabled. For this purpose, introduce a flag to disable the flooding
    of received l2 broadcasts. This approach is backwards compatible and
    provides flexibility in filtering for the desired packet types.

    Cc: Nikolay Aleksandrov
    Signed-off-by: Mike Manning
    Reviewed-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Mike Manning
     

27 Apr, 2017

1 commit


26 Apr, 2017

2 commits

  • Similar to ip_register_table, pass nf_hook_ops to ebt_register_table().
    This allows to handle hook registration also via pernet_ops and allows
    us to avoid use of legacy register_hook api.

    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     
  • During removing a bridge device, if the bridge is still up, a new mdb entry
    still can be added in br_multicast_add_group() after all mdb entries are
    removed in br_multicast_dev_del(). Like the path:

    mld_ifc_timer_expire ->
    mld_sendpack -> ...
    br_multicast_rcv ->
    br_multicast_add_group

    The new mp's timer will be set up. If the timer expires after the bridge
    is freed, it may cause use-after-free panic in br_multicast_group_expired.

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000048
    IP: [] br_multicast_group_expired+0x28/0xb0 [bridge]
    Call Trace:

    [] call_timer_fn+0x36/0x110
    [] ? br_mdb_free+0x30/0x30 [bridge]
    [] run_timer_softirq+0x237/0x340
    [] __do_softirq+0xef/0x280
    [] call_softirq+0x1c/0x30
    [] do_softirq+0x65/0xa0
    [] irq_exit+0x115/0x120
    [] smp_apic_timer_interrupt+0x45/0x60
    [] apic_timer_interrupt+0x6d/0x80

    Nikolay also found it would cause a memory leak - the mdb hash is
    reallocated and not freed due to the mdb rehash.

    unreferenced object 0xffff8800540ba800 (size 2048):
    backtrace:
    [] kmemleak_alloc+0x67/0xc0
    [] __kmalloc+0x1ba/0x3e0
    [] br_mdb_rehash+0x5e/0x340 [bridge]
    [] br_multicast_new_group+0x43f/0x6e0 [bridge]
    [] br_multicast_add_group+0x203/0x260 [bridge]
    [] br_multicast_rcv+0x945/0x11d0 [bridge]
    [] br_dev_xmit+0x180/0x470 [bridge]
    [] dev_hard_start_xmit+0xbb/0x3d0
    [] __dev_queue_xmit+0xb13/0xc10
    [] dev_queue_xmit+0x10/0x20
    [] ip6_finish_output2+0x5ca/0xac0 [ipv6]
    [] ip6_finish_output+0x126/0x2c0 [ipv6]
    [] ip6_output+0xe5/0x390 [ipv6]
    [] NF_HOOK.constprop.44+0x6c/0x240 [ipv6]
    [] mld_sendpack+0x216/0x3e0 [ipv6]
    [] mld_ifc_timer_expire+0x18b/0x2b0 [ipv6]

    This could happen when ip link remove a bridge or destroy a netns with a
    bridge device inside.

    With Nikolay's suggestion, this patch is to clean up bridge multicast in
    ndo_uninit after bridge dev is shutdown, instead of br_dev_delete, so
    that netif_running check in br_multicast_add_group can avoid this issue.

    v1->v2:
    - fix this issue by moving br_multicast_dev_del to ndo_uninit, instead
    of calling dev_close in br_dev_delete.

    (NOTE: Depends upon b6fe0440c637 ("bridge: implement missing ndo_uninit()"))

    Fixes: e10177abf842 ("bridge: multicast: fix handling of temp and perm entries")
    Reported-by: Jianwen Ji
    Signed-off-by: Xin Long
    Reviewed-by: Stephen Hemminger
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Xin Long
     

25 Apr, 2017

1 commit

  • When trying to redirect bridged frames to the bridge device itself or
    a bridge port (brouting) via the dnat target then this currently fails:

    The ethernet destination of the frame is dnat'ed to the MAC address of
    the bridge device or port just fine. However, the IP code drops it in
    the beginning of ip_input.c/ip_rcv() as the dnat target left
    the skb->pkt_type as PACKET_OTHERHOST.

    Fixing this by resetting skb->pkt_type to an appropriate type after
    dnat'ing.

    Signed-off-by: Linus Lüssing
    Signed-off-by: Pablo Neira Ayuso

    Linus Lüssing
     

18 Apr, 2017

2 commits

  • Add netlink_ext_ack arg to rtnl_doit_func. Pass extack arg to nlmsg_parse
    for doit functions that call it directly.

    This is the first step to using extended error reporting in rtnetlink.
    >From here individual subsystems can be updated to set netlink_ext_ack as
    needed.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Recently we added support for SW fdbs to take over HW ones, but that
    results in changing a user-visible fdb flag thus we need to send a
    notification, also it's consistent with how HW takes over SW entries.

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     

16 Apr, 2017

1 commit


14 Apr, 2017

1 commit


12 Apr, 2017

2 commits

  • Peter reported a kernel oops when executing the following command:

    $ ip link add name test type bridge vlan_default_pvid 1

    [13634.939408] BUG: unable to handle kernel NULL pointer dereference at
    0000000000000190
    [13634.939436] IP: __vlan_add+0x73/0x5f0
    [...]
    [13634.939783] Call Trace:
    [13634.939791] ? pcpu_next_unpop+0x3b/0x50
    [13634.939801] ? pcpu_alloc+0x3d2/0x680
    [13634.939810] ? br_vlan_add+0x135/0x1b0
    [13634.939820] ? __br_vlan_set_default_pvid.part.28+0x204/0x2b0
    [13634.939834] ? br_changelink+0x120/0x4e0
    [13634.939844] ? br_dev_newlink+0x50/0x70
    [13634.939854] ? rtnl_newlink+0x5f5/0x8a0
    [13634.939864] ? rtnl_newlink+0x176/0x8a0
    [13634.939874] ? mem_cgroup_commit_charge+0x7c/0x4e0
    [13634.939886] ? rtnetlink_rcv_msg+0xe1/0x220
    [13634.939896] ? lookup_fast+0x52/0x370
    [13634.939905] ? rtnl_newlink+0x8a0/0x8a0
    [13634.939915] ? netlink_rcv_skb+0xa1/0xc0
    [13634.939925] ? rtnetlink_rcv+0x24/0x30
    [13634.939934] ? netlink_unicast+0x177/0x220
    [13634.939944] ? netlink_sendmsg+0x2fe/0x3b0
    [13634.939954] ? _copy_from_user+0x39/0x40
    [13634.939964] ? sock_sendmsg+0x30/0x40
    [13634.940159] ? ___sys_sendmsg+0x29d/0x2b0
    [13634.940326] ? __alloc_pages_nodemask+0xdf/0x230
    [13634.940478] ? mem_cgroup_commit_charge+0x7c/0x4e0
    [13634.940592] ? mem_cgroup_try_charge+0x76/0x1a0
    [13634.940701] ? __handle_mm_fault+0xdb9/0x10b0
    [13634.940809] ? __sys_sendmsg+0x51/0x90
    [13634.940917] ? entry_SYSCALL_64_fastpath+0x1e/0xad

    The problem is that the bridge's VLAN group is created after setting the
    default PVID, when registering the netdevice and executing its
    ndo_init().

    Fix this by changing the order of both operations, so that
    br_changelink() is only processed after the netdevice is registered,
    when the VLAN group is already initialized.

    Fixes: b6677449dff6 ("bridge: netlink: call br_changelink() during br_dev_newlink()")
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Ido Schimmel
    Reported-by: Peter V. Saveliev
    Tested-by: Peter V. Saveliev
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • While the bridge driver implements an ndo_init(), it was missing a
    symmetric ndo_uninit(), causing the different de-initialization
    operations to be scattered around its dellink() and destructor().

    Implement a symmetric ndo_uninit() and remove the overlapping operations
    from its dellink() and destructor().

    This is a prerequisite for the next patch, as it allows us to have a
    proper cleanup upon changelink() failure during the bridge's newlink().

    Fixes: b6677449dff6 ("bridge: netlink: call br_changelink() during br_dev_newlink()")
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Ido Schimmel
    Signed-off-by: David S. Miller

    Ido Schimmel
     

08 Apr, 2017

1 commit


07 Apr, 2017

1 commit

  • The following Coccinelle script was used to detect this:
    @r@
    expression x;
    void* e;
    type T;
    identifier f;
    @@
    (
    *((T *)e)
    |
    ((T *)x)[...]
    |
    ((T*)x)->f
    |

    - (T*)
    e
    )

    Unnecessary parantheses are also remove.

    Signed-off-by: simran singhal
    Reviewed-by: Stephen Hemminger
    Signed-off-by: Pablo Neira Ayuso

    simran singhal
     

29 Mar, 2017

1 commit

  • There is an include loop between netdevice.h, dsa.h, devlink.h because
    of NETDEV_ALIGN, making it impossible to use devlink structures in
    dsa.h.

    Break this loop by taking dsa.h out of netdevice.h, add a forward
    declaration of dsa_switch_tree and netdev_set_default_ethtool_ops()
    function, which is what netdevice.h requires.

    No longer having dsa.h in netdevice.h means the includes in dsa.h no
    longer get included. This breaks a few other files which depend on
    these includes. Add these directly in the affected file.

    Signed-off-by: Andrew Lunn
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Andrew Lunn
     

25 Mar, 2017

2 commits


24 Mar, 2017

1 commit


22 Mar, 2017

1 commit

  • Pablo Neira Ayuso says:

    ====================
    Netfilter/IPVS updates for net-next

    The following patchset contains Netfilter/IPVS updates for your
    net-next tree. A couple of new features for nf_tables, and unsorted
    cleanups and incremental updates for the Netfilter tree. More
    specifically, they are:

    1) Allow to check for TCP option presence via nft_exthdr, patch
    from Phil Sutter.

    2) Add symmetric hash support to nft_hash, from Laura Garcia Liebana.

    3) Use pr_cont() in ebt_log, from Joe Perches.

    4) Remove some dead code in arp_tables reported via static analysis
    tool, from Colin Ian King.

    5) Consolidate nf_tables expression validation, from Liping Zhang.

    6) Consolidate set lookup via nft_set_lookup().

    7) Remove unnecessary rcu read lock side in bridge netfilter, from
    Florian Westphal.

    8) Remove unused variable in nf_reject_ipv4, from Tahee Yoo.

    9) Pass nft_ctx struct to object initialization indirections, from
    Florian Westphal.

    10) Add code to integrate conntrack helper into nf_tables, also from
    Florian.

    11) Allow to check if interface index or name exists via
    NFTA_FIB_F_PRESENT, from Phil Sutter.

    12) Simplify resolve_normal_ct(), from Florian.

    13) Use per-limit spinlock in nft_limit and xt_limit, from Liping Zhang.

    14) Use rwlock in nft_set_rbtree set, also from Liping Zhang.

    15) One patch to remove a useless printk at netns init path in ipvs,
    and several patches to document IPVS knobs.

    16) Use refcount_t for reference counter in the Netfilter/IPVS code,
    from Elena Reshetova.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

17 Mar, 2017

1 commit

  • Andrei reported a false alarm of lockdep at net/bridge/br_fdb.c:109,
    this is because in Andrei's case, a spin_bug() was already triggered
    before this, therefore the debug_locks is turned off, lockdep_is_held()
    is no longer accurate after that. We should use lockdep_assert_held_once()
    instead of lockdep_is_held() to respect debug_locks.

    Fixes: 410b3d48f5111 ("bridge: fdb: add proper lock checks in searching functions")
    Reported-by: Andrei Vagin
    Signed-off-by: Cong Wang
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    WANG Cong
     

16 Mar, 2017

1 commit

  • Pablo Neira Ayuso says:

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

    The following patchset contains Netfilter fixes for your net tree, a
    rather large batch of fixes targeted to nf_tables, conntrack and bridge
    netfilter. More specifically, they are:

    1) Don't track fragmented packets if the socket option IP_NODEFRAG is set.
    From Florian Westphal.

    2) SCTP protocol tracker assumes that ICMP error messages contain the
    checksum field, what results in packet drops. From Ying Xue.

    3) Fix inconsistent handling of AH traffic from nf_tables.

    4) Fix new bitmap set representation with big endian. Fix mismatches in
    nf_tables due to incorrect big endian handling too. Both patches
    from Liping Zhang.

    5) Bridge netfilter doesn't honor maximum fragment size field, cap to
    largest fragment seen. From Florian Westphal.

    6) Fake conntrack entry needs to be aligned to 8 bytes since the 3 LSB
    bits are now used to store the ctinfo. From Steven Rostedt.

    7) Fix element comments with the bitmap set type. Revert the flush
    field in the nft_set_iter structure, not required anymore after
    fixing up element comments.

    8) Missing error on invalid conntrack direction from nft_ct, also from
    Liping Zhang.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

14 Mar, 2017

1 commit

  • Andreas reports kernel oops during rmmod of the br_netfilter module.
    Hannes debugged the oops down to a NULL rt6info->rt6i_indev.

    Problem is that br_netfilter has the nasty concept of adding a fake
    rtable to skb->dst; this happens in a br_netfilter prerouting hook.

    A second hook (in bridge LOCAL_IN) is supposed to remove these again
    before the skb is handed up the stack.

    However, on module unload hooks get unregistered which means an
    skb could traverse the prerouting hook that attaches the fake_rtable,
    while the 'fake rtable remove' hook gets removed from the hooklist
    immediately after.

    Fixes: 34666d467cbf1e2e3c7 ("netfilter: bridge: move br_netfilter out of the core")
    Reported-by: Andreas Karis
    Debugged-by: Hannes Frederic Sowa
    Signed-off-by: Florian Westphal
    Acked-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Florian Westphal
     

13 Mar, 2017

1 commit

  • consider a bridge with mtu 9000, but end host sending smaller
    packets to another host with mtu < 9000.

    In this case, after reassembly, bridge+defrag would refragment,
    and then attempt to send the reassembled packet as long as it
    was below 9k.

    Instead we have to cap by the largest fragment size seen.

    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     

09 Mar, 2017

1 commit


07 Mar, 2017

2 commits

  • When we want to validate the expr's dependency or hooks, we must do two
    things to accomplish it. First, write a X_validate callback function
    and point ->validate to it. Second, call X_validate in init routine.
    This is very common, such as fib, nat, reject expr and so on ...

    It is a little ugly, since we will call X_validate in the expr's init
    routine, it's better to do it in nf_tables_newexpr. So we can avoid to
    do this again and again. After doing this, the second step listed above
    is not useful anymore, remove them now.

    Patch was tested by nftables/tests/py/nft-test.py and
    nftables/tests/shell/run-tests.sh.

    Signed-off-by: Liping Zhang
    Signed-off-by: Pablo Neira Ayuso

    Liping Zhang
     
  • Logging output was changed when simple printks without KERN_CONT
    are now emitted on a new line and KERN_CONT is required to continue
    lines so use pr_cont.

    Miscellanea:

    o realign arguments
    o use print_hex_dump instead of a local variant

    Signed-off-by: Joe Perches
    Signed-off-by: Pablo Neira Ayuso

    Joe Perches
     

05 Mar, 2017

1 commit

  • Pull networking fixes from David Miller:

    1) Fix double-free in batman-adv, from Sven Eckelmann.

    2) Fix packet stats for fast-RX path, from Joannes Berg.

    3) Netfilter's ip_route_me_harder() doesn't handle request sockets
    properly, fix from Florian Westphal.

    4) Fix sendmsg deadlock in rxrpc, from David Howells.

    5) Add missing RCU locking to transport hashtable scan, from Xin Long.

    6) Fix potential packet loss in mlxsw driver, from Ido Schimmel.

    7) Fix race in NAPI handling between poll handlers and busy polling,
    from Eric Dumazet.

    8) TX path in vxlan and geneve need proper RCU locking, from Jakub
    Kicinski.

    9) SYN processing in DCCP and TCP need to disable BH, from Eric
    Dumazet.

    10) Properly handle net_enable_timestamp() being invoked from IRQ
    context, also from Eric Dumazet.

    11) Fix crash on device-tree systems in xgene driver, from Alban Bedel.

    12) Do not call sk_free() on a locked socket, from Arnaldo Carvalho de
    Melo.

    13) Fix use-after-free in netvsc driver, from Dexuan Cui.

    14) Fix max MTU setting in bonding driver, from WANG Cong.

    15) xen-netback hash table can be allocated from softirq context, so use
    GFP_ATOMIC. From Anoob Soman.

    16) Fix MAC address change bug in bgmac driver, from Hari Vyas.

    17) strparser needs to destroy strp_wq on module exit, from WANG Cong.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (69 commits)
    strparser: destroy workqueue on module exit
    sfc: fix IPID endianness in TSOv2
    sfc: avoid max() in array size
    rds: remove unnecessary returned value check
    rxrpc: Fix potential NULL-pointer exception
    nfp: correct DMA direction in XDP DMA sync
    nfp: don't tell FW about the reserved buffer space
    net: ethernet: bgmac: mac address change bug
    net: ethernet: bgmac: init sequence bug
    xen-netback: don't vfree() queues under spinlock
    xen-netback: keep a local pointer for vif in backend_disconnect()
    netfilter: nf_tables: don't call nfnetlink_set_err() if nfnetlink_send() fails
    netfilter: nft_set_rbtree: incorrect assumption on lower interval lookups
    netfilter: nf_conntrack_sip: fix wrong memory initialisation
    can: flexcan: fix typo in comment
    can: usb_8dev: Fix memory leak of priv->cmd_msg_buffer
    can: gs_usb: fix coding style
    can: gs_usb: Don't use stack memory for USB transfers
    ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines
    ixgbe: update the rss key on h/w, when ethtool ask for it
    ...

    Linus Torvalds
     

02 Mar, 2017

3 commits

  • …hed.h> into <linux/sched/signal.h>

    Fix up affected files that include this signal functionality via sched.h.

    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     
  • Even with multicast flooding turned off, IPv6 ND should still work so
    that IPv6 connectivity is provided. Allow this by continuing to flood
    multicast traffic originated by us.

    Fixes: b6cb5ac8331b ("net: bridge: add per-port multicast flood flag")
    Cc: Nikolay Aleksandrov
    Signed-off-by: Mike Manning
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Mike Manning
     
  • Fix error path order in nbp_vlan_init, so if switchdev_port_attr_set
    call failes, the vlan_hash wouldn't be destroyed before inited.

    Fixes: efa5356b0d97 ("bridge: per vlan dst_metadata netlink support")
    CC: Roopa Prabhu
    Signed-off-by: Yotam Gigi
    Acked-by: Roopa Prabhu
    Reviewed-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Yotam Gigi