11 Jun, 2014

1 commit

  • The current naming of these two structs is very random, in that
    reversing their naming would not make any semantical difference.

    This patch tries to make the naming less confusing by giving them a more
    specific, distinguishable naming.

    This is also useful for the upcoming patches reintroducing the
    "struct bridge_mcast_querier" but for storing information about the
    selected querier (no matter if our own or a foreign querier).

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

    Linus Lüssing
     

23 Oct, 2013

1 commit

  • While this commit was a good attempt to fix issues occuring when no
    multicast querier is present, this commit still has two more issues:

    1) There are cases where mdb entries do not expire even if there is a
    querier present. The bridge will unnecessarily continue flooding
    multicast packets on the according ports.

    2) Never removing an mdb entry could be exploited for a Denial of
    Service by an attacker on the local link, slowly, but steadily eating up
    all memory.

    Actually, this commit became obsolete with
    "bridge: disable snooping if there is no querier" (b00589af3b)
    which included fixes for a few more cases.

    Therefore reverting the following commits (the commit stated in the
    commit message plus three of its follow up fixes):

    ====================
    Revert "bridge: update mdb expiration timer upon reports."
    This reverts commit f144febd93d5ee534fdf23505ab091b2b9088edc.
    Revert "bridge: do not call setup_timer() multiple times"
    This reverts commit 1faabf2aab1fdaa1ace4e8c829d1b9cf7bfec2f1.
    Revert "bridge: fix some kernel warning in multicast timer"
    This reverts commit c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1.
    Revert "bridge: only expire the mdb entry when query is received"
    This reverts commit 9f00b2e7cf241fa389733d41b615efdaa2cb0f5b.
    ====================

    CC: Cong Wang
    Signed-off-by: Linus Lüssing
    Reviewed-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Linus Lüssing
     

06 Sep, 2013

2 commits

  • 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
     

31 Aug, 2013

1 commit

  • 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
     

05 Aug, 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
     

22 Mar, 2013

1 commit


10 Mar, 2013

1 commit

  • The bridging code discloses heap and stack bytes via the RTM_GETMDB
    netlink interface and via the notify messages send to group RTNLGRP_MDB
    afer a successful add/del.

    Fix both cases by initializing all unset members/padding bytes with
    memset(0).

    Cc: Stephen Hemminger
    Signed-off-by: Mathias Krause
    Signed-off-by: David S. Miller

    Mathias Krause
     

28 Feb, 2013

1 commit

  • I'm not sure why, but the hlist for each entry iterators were conceived

    list_for_each_entry(pos, head, member)

    The hlist ones were greedy and wanted an extra parameter:

    hlist_for_each_entry(tpos, pos, head, member)

    Why did they need an extra pos parameter? I'm not quite sure. Not only
    they don't really need it, it also prevents the iterator from looking
    exactly like the list iterator, which is unfortunate.

    Besides the semantic patch, there was some manual work required:

    - Fix up the actual hlist iterators in linux/list.h
    - Fix up the declaration of other iterators based on the hlist ones.
    - A very small amount of places were using the 'node' parameter, this
    was modified to use 'obj->member' instead.
    - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
    properly, so those had to be fixed up manually.

    The semantic patch which is mostly the work of Peter Senna Tschudin is here:

    @@
    iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;

    type T;
    expression a,c,d,e;
    identifier b;
    statement S;
    @@

    -T b;

    [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
    [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
    [akpm@linux-foundation.org: checkpatch fixes]
    [akpm@linux-foundation.org: fix warnings]
    [akpm@linux-foudnation.org: redo intrusive kvm changes]
    Tested-by: Peter Senna Tschudin
    Acked-by: Paul E. McKenney
    Signed-off-by: Sasha Levin
    Cc: Wu Fengguang
    Cc: Marcelo Tosatti
    Cc: Gleb Natapov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sasha Levin
     

05 Feb, 2013

1 commit


20 Dec, 2012

2 commits


16 Dec, 2012

1 commit


13 Dec, 2012

2 commits

  • This patch implents adding/deleting mdb entries via netlink.
    Currently all entries are temp, we probably need a flag to distinguish
    permanent entries too.

    Cc: Herbert Xu
    Cc: Stephen Hemminger
    Cc: "David S. Miller"
    Cc: Thomas Graf
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     
  • As Stephen mentioned, we need to monitor the mdb
    changes in user-space, so add notifications via netlink too.

    Cc: Herbert Xu
    Cc: Stephen Hemminger
    Cc: "David S. Miller"
    Cc: Thomas Graf
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

12 Dec, 2012

1 commit

  • In case of rehashing, introduce a global variable 'br_mdb_rehash_seq'
    which gets increased every time when rehashing, and assign
    net->dev_base_seq + br_mdb_rehash_seq to cb->seq.

    In theory cb->seq could be wrapped to zero, but this is not
    easy to fix, as net->dev_base_seq is not visible inside
    br_mdb_rehash(). In practice, this is rare.

    Cc: Herbert Xu
    Cc: Stephen Hemminger
    Cc: "David S. Miller"
    Cc: Thomas Graf
    Cc: Jesper Dangaard Brouer
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

08 Dec, 2012

1 commit

  • V5: fix two bugs pointed out by Thomas
    remove seq check for now, mark it as TODO

    V4: remove some useless #include
    some coding style fix

    V3: drop debugging printk's
    update selinux perm table as well

    V2: drop patch 1/2, export ifindex directly
    Redesign netlink attributes
    Improve netlink seq check
    Handle IPv6 addr as well

    This patch exports bridge multicast database via netlink
    message type RTM_GETMDB. Similar to fdb, but currently bridge-specific.
    We may need to support modify multicast database too (RTM_{ADD,DEL}MDB).

    (Thanks to Thomas for patient reviews)

    Cc: Herbert Xu
    Cc: Stephen Hemminger
    Cc: "David S. Miller"
    Cc: Thomas Graf
    Cc: Jesper Dangaard Brouer
    Signed-off-by: Cong Wang
    Acked-by: Thomas Graf
    Signed-off-by: David S. Miller

    Cong Wang