03 Oct, 2013

1 commit


16 Sep, 2013

2 commits

  • The NULL deref happens when br_handle_frame is called between these
    2 lines of del_nbp:
    dev->priv_flags &= ~IFF_BRIDGE_PORT;
    /* --> br_handle_frame is called at this time */
    netdev_rx_handler_unregister(dev);

    In br_handle_frame the return of br_port_get_rcu(dev) is dereferenced
    without check but br_port_get_rcu(dev) returns NULL if:
    !(dev->priv_flags & IFF_BRIDGE_PORT)

    Eric Dumazet pointed out the testing of IFF_BRIDGE_PORT is not necessary
    here since we're in rcu_read_lock and we have synchronize_net() in
    netdev_rx_handler_unregister. So remove the testing of IFF_BRIDGE_PORT
    and by the previous patch, make sure br_port_get_rcu is called in
    bridging code.

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

    Hong Zhiguo
     
  • current br_port_get_rcu is problematic in bridging path
    (NULL deref). Change these calls in netlink path first.

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

    Hong Zhiguo
     

13 Sep, 2013

2 commits

  • At some point limits were added to forward_delay. However, the
    limits are only enforced when STP is enabled. This created a
    scenario where you could have a value outside the allowed range
    while STP is disabled, which then stuck around even after STP
    is enabled.

    This patch fixes this by clamping the value when we enable STP.

    I had to move the locking around a bit to ensure that there is
    no window where someone could insert a value outside the range
    while we're in the middle of enabling STP.

    Signed-off-by: Herbert Xu

    Cheers,
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This changes the message_age_timer calculation to use the BPDU's max age as
    opposed to the local bridge's max age. This is in accordance with section
    8.6.2.3.2 Step 2 of the 802.1D-1998 sprecification.

    With the current implementation, when running with very large bridge
    diameters, convergance will not always occur even if a root bridge is
    configured to have a longer max age.

    Tested successfully on bridge diameters of ~200.

    Signed-off-by: Chris Healy
    Signed-off-by: David S. Miller

    Chris Healy
     

06 Sep, 2013

4 commits

  • Pull networking changes from David Miller:
    "Noteworthy changes this time around:

    1) Multicast rejoin support for team driver, from Jiri Pirko.

    2) Centralize and simplify TCP RTT measurement handling in order to
    reduce the impact of bad RTO seeding from SYN/ACKs. Also, when
    both timestamps and local RTT measurements are available prefer
    the later because there are broken middleware devices which
    scramble the timestamp.

    From Yuchung Cheng.

    3) Add TCP_NOTSENT_LOWAT socket option to limit the amount of kernel
    memory consumed to queue up unsend user data. From Eric Dumazet.

    4) Add a "physical port ID" abstraction for network devices, from
    Jiri Pirko.

    5) Add a "suppress" operation to influence fib_rules lookups, from
    Stefan Tomanek.

    6) Add a networking development FAQ, from Paul Gortmaker.

    7) Extend the information provided by tcp_probe and add ipv6 support,
    from Daniel Borkmann.

    8) Use RCU locking more extensively in openvswitch data paths, from
    Pravin B Shelar.

    9) Add SCTP support to openvswitch, from Joe Stringer.

    10) Add EF10 chip support to SFC driver, from Ben Hutchings.

    11) Add new SYNPROXY netfilter target, from Patrick McHardy.

    12) Compute a rate approximation for sending in TCP sockets, and use
    this to more intelligently coalesce TSO frames. Furthermore, add
    a new packet scheduler which takes advantage of this estimate when
    available. From Eric Dumazet.

    13) Allow AF_PACKET fanouts with random selection, from Daniel
    Borkmann.

    14) Add ipv6 support to vxlan driver, from Cong Wang"

    Resolved conflicts as per discussion.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1218 commits)
    openvswitch: Fix alignment of struct sw_flow_key.
    netfilter: Fix build errors with xt_socket.c
    tcp: Add missing braces to do_tcp_setsockopt
    caif: Add missing braces to multiline if in cfctrl_linkup_request
    bnx2x: Add missing braces in bnx2x:bnx2x_link_initialize
    vxlan: Fix kernel panic on device delete.
    net: mvneta: implement ->ndo_do_ioctl() to support PHY ioctls
    net: mvneta: properly disable HW PHY polling and ensure adjust_link() works
    icplus: Use netif_running to determine device state
    ethernet/arc/arc_emac: Fix huge delays in large file copies
    tuntap: orphan frags before trying to set tx timestamp
    tuntap: purge socket error queue on detach
    qlcnic: use standard NAPI weights
    ipv6:introduce function to find route for redirect
    bnx2x: VF RSS support - VF side
    bnx2x: VF RSS support - PF side
    vxlan: Notify drivers for listening UDP port changes
    net: usbnet: update addr_assign_type if appropriate
    driver/net: enic: update enic maintainers and driver
    driver/net: enic: Exposing symbols for Cisco's low latency driver
    ...

    Linus Torvalds
     
  • Conflicts:
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    net/bridge/br_multicast.c
    net/ipv6/sit.c

    The conflicts were minor:

    1) sit.c changes overlap with change to ip_tunnel_xmit() signature.

    2) br_multicast.c had an overlap between computing max_delay using
    msecs_to_jiffies and turning MLDV2_MRC() into an inline function
    with a name using lowercase instead of uppercase letters.

    3) stmmac had two overlapping changes, one which conditionally allocated
    and hooked up a dma_cfg based upon the presence of the pbl OF property,
    and another one handling store-and-forward DMA made. The latter of
    which should not go into the new of_find_property() basic block.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The multicast snooping code should have matured enough to be safely
    applicable to IPv6 link-local multicast addresses (excluding the
    link-local all nodes address, ff02::1), too.

    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     
  • Currently if there is no listener for a certain group then IPv6 packets
    for that group are flooded on all ports, even though there might be no
    host and router interested in it on a port.

    With this commit they are only forwarded to ports with a multicast
    router.

    Just like commit bd4265fe36 ("bridge: Only flood unregistered groups
    to routers") did for IPv4, let's do the same for IPv6 with the same
    reasoning.

    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     

05 Sep, 2013

2 commits

  • Pull PTR_RET() removal patches from Rusty Russell:
    "PTR_RET() is a weird name, and led to some confusing usage. We ended
    up with PTR_ERR_OR_ZERO(), and replacing or fixing all the usages.

    This has been sitting in linux-next for a whole cycle"

    [ There are still some PTR_RET users scattered about, with some of them
    possibly being new, but most of them existing in Rusty's tree too. We
    have that

    #define PTR_RET(p) PTR_ERR_OR_ZERO(p)

    thing in , so they continue to work for now - Linus ]

    * tag 'PTR_RET-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    GFS2: Replace PTR_RET with PTR_ERR_OR_ZERO
    Btrfs: volume: Replace PTR_RET with PTR_ERR_OR_ZERO
    drm/cma: Replace PTR_RET with PTR_ERR_OR_ZERO
    sh_veu: Replace PTR_RET with PTR_ERR_OR_ZERO
    dma-buf: Replace PTR_RET with PTR_ERR_OR_ZERO
    drivers/rtc: Replace PTR_RET with PTR_ERR_OR_ZERO
    mm/oom_kill: remove weird use of ERR_PTR()/PTR_ERR().
    staging/zcache: don't use PTR_RET().
    remoteproc: don't use PTR_RET().
    pinctrl: don't use PTR_RET().
    acpi: Replace weird use of PTR_RET.
    s390: Replace weird use of PTR_RET.
    PTR_RET is now PTR_ERR_OR_ZERO(): Replace most.
    PTR_RET is now PTR_ERR_OR_ZERO

    Linus Torvalds
     
  • Get rid of MLDV2_MRC and use our new macros for mantisse and
    exponent to calculate Maximum Response Delay out of the Maximum
    Response Code.

    Signed-off-by: Daniel Borkmann
    Cc: Hannes Frederic Sowa
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

31 Aug, 2013

2 commits

  • While looking into MLDv1/v2 code, I noticed that bridging code does
    not convert it's max delay into jiffies for MLDv2 messages as we do
    in core IPv6' multicast code.

    RFC3810, 5.1.3. Maximum Response Code says:

    The Maximum Response Code field specifies the maximum time allowed
    before sending a responding Report. The actual time allowed, called
    the Maximum Response Delay, is represented in units of milliseconds,
    and is derived from the Maximum Response Code as follows: [...]

    As we update timers that work with jiffies, we need to convert it.

    Signed-off-by: Daniel Borkmann
    Cc: Linus Lüssing
    Cc: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Daniel Borkmann
     
  • Currently we would still potentially suffer multicast packet loss if there
    is just either an IGMP or an MLD querier: For the former case, we would
    possibly drop IPv6 multicast packets, for the latter IPv4 ones. This is
    because we are currently assuming that if either an IGMP or MLD querier
    is present that the other one is present, too.

    This patch makes the behaviour and fix added in
    "bridge: disable snooping if there is no querier" (b00589af3b04)
    to also work if there is either just an IGMP or an MLD querier on the
    link: It refines the deactivation of the snooping to be protocol
    specific by using separate timers for the snooped IGMP and MLD queries
    as well as separate timers for our internal IGMP and MLD queriers.

    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     

30 Aug, 2013

1 commit

  • Some slave devices may have set a dev->needed_headroom value which is
    different than the default one, most likely in order to prepend a
    hardware descriptor in front of the Ethernet frame to send. Whenever a
    new slave is added to a bridge, ensure that we update the
    needed_headroom value accordingly to account for the slave
    needed_headroom value.

    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Florian Fainelli
     

27 Aug, 2013

1 commit


21 Aug, 2013

1 commit

  • The VLAN code needs to know the length of the per-port VLAN bitmap to
    perform its most basic operations (retrieving VLAN informations, removing
    VLANs, forwarding database manipulation, etc). Unfortunately, in the
    current implementation we are using a macro that indicates the bitmap
    size in longs in places where the size in bits is expected, which in
    some cases can cause what appear to be random failures.
    Use the correct macro.

    Signed-off-by: Toshiaki Makita
    Signed-off-by: David S. Miller

    Toshiaki Makita
     

17 Aug, 2013

1 commit


08 Aug, 2013

1 commit


06 Aug, 2013

1 commit

  • Currently we are reading an uninitialized value for the max_delay
    variable when snooping an MLD query message of invalid length and would
    update our timers with that.

    Fixing this by simply ignoring such broken MLD queries (just like we do
    for IGMP already).

    This is a regression introduced by:
    "bridge: disable snooping if there is no querier" (b00589af3b04)

    Reported-by: Paul Bolle
    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     

05 Aug, 2013

1 commit


04 Aug, 2013

1 commit


01 Aug, 2013

1 commit

  • If there is no querier on a link then we won't get periodic reports and
    therefore won't be able to learn about multicast listeners behind ports,
    potentially leading to lost multicast packets, especially for multicast
    listeners that joined before the creation of the bridge.

    These lost multicast packets can appear since c5c23260594
    ("bridge: Add multicast_querier toggle and disable queries by default")
    in particular.

    With this patch we are flooding multicast packets if our querier is
    disabled and if we didn't detect any other querier.

    A grace period of the Maximum Response Delay of the querier is added to
    give multicast responses enough time to arrive and to be learned from
    before disabling the flooding behaviour again.

    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     

27 Jul, 2013

1 commit

  • This started out with fixing a sparse warning, then I realized that
    the wrapper function br_netpoll_info could just be collapsed away
    by rolling it into the enable code.

    Also, eliminate unnecessary goto's

    Signed-off-by: Stephen Hemminger
    Reviewed-by: Jiri Pirko
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    stephen hemminger
     

24 Jul, 2013

1 commit

  • Until now, bond_resend_igmp_join_requests() looks for vlans attached to
    bonding device, bridge where bonding act as port manually. It does not
    care of other scenarios, like stacked bonds or team device above. Make
    this more generic and use netdev notifier to propagate the event to
    upper devices and to actually call ip_mc_rejoin_groups().

    Signed-off-by: Jiri Pirko
    Acked-by: Veaceslav Falico
    Signed-off-by: David S. Miller

    Jiri Pirko
     

20 Jul, 2013

1 commit

  • commit 9f00b2e7cf24 ("bridge: only expire the mdb entry when query is
    received") added a nasty bug as an active timer can be reinitialized.

    setup_timer() must be done once, no matter how many time mod_timer()
    is called. br_multicast_new_group() is the right place to do this.

    Reported-by: Srivatsa S. Bhat
    Diagnosed-by: Thomas Gleixner
    Signed-off-by: Eric Dumazet
    Tested-by: Srivatsa S. Bhat
    Cc: Cong Wang
    Signed-off-by: David S. Miller

    Eric Dumazet
     

15 Jul, 2013

1 commit


07 Jul, 2013

1 commit

  • Several people reported the warning: "kernel BUG at kernel/timer.c:729!"
    and the stack trace is:

    #7 [ffff880214d25c10] mod_timer+501 at ffffffff8106d905
    #8 [ffff880214d25c50] br_multicast_del_pg.isra.20+261 at ffffffffa0731d25 [bridge]
    #9 [ffff880214d25c80] br_multicast_disable_port+88 at ffffffffa0732948 [bridge]
    #10 [ffff880214d25cb0] br_stp_disable_port+154 at ffffffffa072bcca [bridge]
    #11 [ffff880214d25ce8] br_device_event+520 at ffffffffa072a4e8 [bridge]
    #12 [ffff880214d25d18] notifier_call_chain+76 at ffffffff8164aafc
    #13 [ffff880214d25d50] raw_notifier_call_chain+22 at ffffffff810858f6
    #14 [ffff880214d25d60] call_netdevice_notifiers+45 at ffffffff81536aad
    #15 [ffff880214d25d80] dev_close_many+183 at ffffffff81536d17
    #16 [ffff880214d25dc0] rollback_registered_many+168 at ffffffff81537f68
    #17 [ffff880214d25de8] rollback_registered+49 at ffffffff81538101
    #18 [ffff880214d25e10] unregister_netdevice_queue+72 at ffffffff815390d8
    #19 [ffff880214d25e30] __tun_detach+272 at ffffffffa074c2f0 [tun]
    #20 [ffff880214d25e88] tun_chr_close+45 at ffffffffa074c4bd [tun]
    #21 [ffff880214d25ea8] __fput+225 at ffffffff8119b1f1
    #22 [ffff880214d25ef0] ____fput+14 at ffffffff8119b3fe
    #23 [ffff880214d25f00] task_work_run+159 at ffffffff8107cf7f
    #24 [ffff880214d25f30] do_notify_resume+97 at ffffffff810139e1
    #25 [ffff880214d25f50] int_signal+18 at ffffffff8164f292

    this is due to I forgot to check if mp->timer is armed in
    br_multicast_del_pg(). This bug is introduced by
    commit 9f00b2e7cf241fa389733d41b6 (bridge: only expire the mdb entry
    when query is received).

    Same for __br_mdb_del().

    Tested-by: poma
    Reported-by: LiYonghua
    Reported-by: Robert Hancock
    Cc: Herbert Xu
    Cc: Stephen Hemminger
    Cc: "David S. Miller"
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

26 Jun, 2013

1 commit


24 Jun, 2013

1 commit


20 Jun, 2013

1 commit

  • Conflicts:
    drivers/net/wireless/ath/ath9k/Kconfig
    drivers/net/xen-netback/netback.c
    net/batman-adv/bat_iv_ogm.c
    net/wireless/nl80211.c

    The ath9k Kconfig conflict was a change of a Kconfig option name right
    next to the deletion of another option.

    The xen-netback conflict was overlapping changes involving the
    handling of the notify list in xen_netbk_rx_action().

    Batman conflict resolution provided by Antonio Quartulli, basically
    keep everything in both conflict hunks.

    The nl80211 conflict is a little more involved. In 'net' we added a
    dynamic memory allocation to nl80211_dump_wiphy() to fix a race that
    Linus reported. Meanwhile in 'net-next' the handlers were converted
    to use pre and post doit handlers which use a flag to determine
    whether to hold the RTNL mutex around the operation.

    However, the dump handlers to not use this logic. Instead they have
    to explicitly do the locking. There were apparent bugs in the
    conversion of nl80211_dump_wiphy() in that we were not dropping the
    RTNL mutex in all the return paths, and it seems we very much should
    be doing so. So I fixed that whilst handling the overlapping changes.

    To simplify the initial returns, I take the RTNL mutex after we try
    to allocate 'tb'.

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Jun, 2013

1 commit

  • General Queries (the one with the Multicast Address field
    set to zero / '::') are supposed to have a Maximum Response Delay
    of [Query Response Interval], while for Multicast-Address-Specific
    Queries it is [Last Listener Query Interval] - not the other way
    round. (see RFC2710, section 7.3+7.8)

    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     

13 Jun, 2013

1 commit

  • Reduce the uses of this unnecessary typedef.

    Done via perl script:

    $ git grep --name-only -w ctl_table net | \
    xargs perl -p -i -e '\
    sub trim { my ($local) = @_; $local =~ s/(^\s+|\s+$)//g; return $local; } \
    s/\b(?<!struct\s)ctl_table\b(\s*\*\s*|\s+\w+)/"struct ctl_table " . trim($1)/ge'

    Reflow the modified lines that now exceed 80 columns.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

11 Jun, 2013

2 commits

  • Add a flag to control flood of unicast traffic. By default, flood is
    on and the bridge will flood unicast traffic if it doesn't know
    the destination. When the flag is turned off, unicast traffic
    without an FDB will not be forwarded to the specified port.

    Signed-off-by: Vlad Yasevich
    Reviewed-by: Michael S. Tsirkin
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • Allow user to control whether mac learning is enabled on the port.
    By default, mac learning is enabled. Disabling mac learning will
    cause new dynamic FDB entries to not be created for a particular port.

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

    Vlad Yasevich
     

06 Jun, 2013

1 commit

  • Conflicts:
    net/netfilter/nf_log.c

    The conflict in nf_log.c is that in 'net' we added CONFIG_PROC_FS
    protection around foo_proc_entry() calls to fix a build failure,
    whereas in Pablo's tree a guard if() test around a call is
    remove_proc_entry() was removed. Trivially resolved.

    Pablo Neira Ayuso says:

    ====================
    The following patchset contains the first batch of
    Netfilter/IPVS updates for your net-next tree, they are:

    * Three patches with improvements and code refactorization
    for nfnetlink_queue, from Florian Westphal.

    * FTP helper now parses replies without brackets, as RFC1123
    recommends, from Jeff Mahoney.

    * Rise a warning to tell everyone about ULOG deprecation,
    NFLOG has been already in the kernel tree for long time
    and supersedes the old logging over netlink stub, from
    myself.

    * Don't panic if we fail to load netfilter core framework,
    just bail out instead, from myself.

    * Add cond_resched_rcu, used by IPVS to allow rescheduling
    while walking over big hashtables, from Simon Horman.

    * Change type of IPVS sysctl_sync_qlen_max sysctl to avoid
    possible overflow, from Zhang Yanfei.

    * Use strlcpy instead of strncpy to skip zeroing of already
    initialized area to write the extension names in ebtables,
    from Chen Gang.

    * Use already existing per-cpu notrack object from xt_CT,
    from Eric Dumazet.

    * Save explicit socket lookup in xt_socket now that we have
    early demux, also from Eric Dumazet.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

29 May, 2013

1 commit

  • So far, only net_device * could be passed along with netdevice notifier
    event. This patch provides a possibility to pass custom structure
    able to provide info that event listener needs to know.

    Signed-off-by: Jiri Pirko

    v2->v3: fix typo on simeth
    shortened dev_getter
    shortened notifier_info struct name
    v1->v2: fix notifier_call parameter in call_netdevice_notifier()
    Signed-off-by: David S. Miller

    Jiri Pirko
     

25 May, 2013

1 commit


24 May, 2013

1 commit


23 May, 2013

2 commits