08 Dec, 2020

1 commit

  • When enabling multicast snooping, bridge module deadlocks on multicast_lock
    if 1) IPv6 is enabled, and 2) there is an existing querier on the same L2
    network.

    The deadlock was caused by the following sequence: While holding the lock,
    br_multicast_open calls br_multicast_join_snoopers, which eventually causes
    IP stack to (attempt to) send out a Listener Report (in igmp6_join_group).
    Since the destination Ethernet address is a multicast address, br_dev_xmit
    feeds the packet back to the bridge via br_multicast_rcv, which in turn
    calls br_multicast_add_group, which then deadlocks on multicast_lock.

    The fix is to move the call br_multicast_join_snoopers outside of the
    critical section. This works since br_multicast_join_snoopers only deals
    with IP and does not modify any multicast data structures of the bridge,
    so there's no need to hold the lock.

    Steps to reproduce:
    1. sysctl net.ipv6.conf.all.force_mld_version=1
    2. have another querier
    3. ip link set dev bridge type bridge mcast_snooping 0 && \
    ip link set dev bridge type bridge mcast_snooping 1 < deadlock >

    A typical call trace looks like the following:

    [ 936.251495] _raw_spin_lock+0x5c/0x68
    [ 936.255221] br_multicast_add_group+0x40/0x170 [bridge]
    [ 936.260491] br_multicast_rcv+0x7ac/0xe30 [bridge]
    [ 936.265322] br_dev_xmit+0x140/0x368 [bridge]
    [ 936.269689] dev_hard_start_xmit+0x94/0x158
    [ 936.273876] __dev_queue_xmit+0x5ac/0x7f8
    [ 936.277890] dev_queue_xmit+0x10/0x18
    [ 936.281563] neigh_resolve_output+0xec/0x198
    [ 936.285845] ip6_finish_output2+0x240/0x710
    [ 936.290039] __ip6_finish_output+0x130/0x170
    [ 936.294318] ip6_output+0x6c/0x1c8
    [ 936.297731] NF_HOOK.constprop.0+0xd8/0xe8
    [ 936.301834] igmp6_send+0x358/0x558
    [ 936.305326] igmp6_join_group.part.0+0x30/0xf0
    [ 936.309774] igmp6_group_added+0xfc/0x110
    [ 936.313787] __ipv6_dev_mc_inc+0x1a4/0x290
    [ 936.317885] ipv6_dev_mc_inc+0x10/0x18
    [ 936.321677] br_multicast_open+0xbc/0x110 [bridge]
    [ 936.326506] br_multicast_toggle+0xec/0x140 [bridge]

    Fixes: 4effd28c1245 ("bridge: join all-snoopers multicast address")
    Signed-off-by: Joseph Huang
    Acked-by: Nikolay Aleksandrov
    Link: https://lore.kernel.org/r/20201204235628.50653-1-Joseph.Huang@garmin.com
    Signed-off-by: Jakub Kicinski

    Joseph Huang
     

26 Sep, 2020

1 commit


24 Sep, 2020

9 commits

  • Since host joins are considered as EXCLUDE {} joins we need to reflect
    that in all of *,G ports' S,G entries. Since the S,Gs can have
    host_joined == true only set automatically we can safely set it to false
    when removing all automatically added entries upon S,G delete.

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

    Nikolay Aleksandrov
     
  • When excluding S,G entries we need a way to block a particular S,G,port.
    The new port group flag is managed based on the source's timer as per
    RFCs 3376 and 3810. When a source expires and its port group is in
    EXCLUDE mode, it will be blocked.

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

    Nikolay Aleksandrov
     
  • We need to handle group filter mode transitions and initial state.
    To change a port group's INCLUDE -> EXCLUDE mode (or when we have added
    a new port group in EXCLUDE mode) we need to add that port to all of
    *,G ports' S,G entries for proper replication. When the EXCLUDE state is
    changed from IGMPv3 report, br_multicast_fwd_filter_exclude() must be
    called after the source list processing because the assumption is that
    all of the group's S,G entries will be created before transitioning to
    EXCLUDE mode, i.e. most importantly its blocked entries will already be
    added so it will not get automatically added to them.
    The transition EXCLUDE -> INCLUDE happens only when a port group timer
    expires, it requires us to remove that port from all of *,G ports' S,G
    entries where it was automatically added previously.
    Finally when we are adding a new S,G entry we must add all of *,G's
    EXCLUDE ports to it.
    In order to distinguish automatically added *,G EXCLUDE ports we have a
    new port group flag - MDB_PG_FLAGS_STAR_EXCL.

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

    Nikolay Aleksandrov
     
  • This patch adds support for automatic install of S,G mdb entries based
    on the port group's source list and the source entry's timer.
    Once installed the S,G will be used when forwarding packets if the
    approprate multicast/mld versions are set. A new source flag called
    BR_SGRP_F_INSTALLED denotes if the source has a forwarding mdb entry
    installed.

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

    Nikolay Aleksandrov
     
  • To speedup S,G forward handling we need to be able to quickly find out
    if a port is a member of an S,G group. To do that add a global S,G port
    rhashtable with key: source addr, group addr, protocol, vid (all br_ip
    fields) and port pointer.

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

    Nikolay Aleksandrov
     
  • We need to be able to differentiate between pg entries created by
    user-space and the kernel when we start generating S,G entries for
    IGMPv3/MLDv2's fast path. User-space entries are created by default as
    RTPROT_STATIC and the kernel entries are RTPROT_KERNEL. Later we can
    allow user-space to provide the entry rt_protocol so we can
    differentiate between who added the entries specifically (e.g. clag,
    admin, frr etc).

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

    Nikolay Aleksandrov
     
  • If (S,G) entries are enabled (igmpv3/mldv2) then look them up first. If
    there isn't a present (S,G) entry then try to find (*,G).

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

    Nikolay Aleksandrov
     
  • Since now we have src in br_ip, u no longer makes sense so rename
    it to dst. No functional changes.

    v2: fix build with CONFIG_BATMAN_ADV_MCAST

    CC: Marek Lindner
    CC: Simon Wunderlich
    CC: Antonio Quartulli
    CC: Sven Eckelmann
    CC: b.a.t.m.a.n@lists.open-mesh.org
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     
  • Now that we have src and dst in br_ip it is logical to use the src field
    for the cases where we need to work with a source address such as
    querier source address and group source address.

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

    Nikolay Aleksandrov
     

17 Sep, 2020

1 commit


09 Sep, 2020

1 commit

  • Stephen reported the following warning:
    net/bridge/br_multicast.c: In function 'br_multicast_find_port':
    net/bridge/br_multicast.c:1818:21: warning: unused variable 'br' [-Wunused-variable]
    1818 | struct net_bridge *br = mp->br;
    | ^~

    It happens due to bridge's mlock_dereference() when lockdep isn't defined.
    Silence the warning by annotating the variable as __maybe_unused.

    Fixes: 0436862e417e ("net: bridge: mcast: support for IGMPv3/MLDv2 ALLOW_NEW_SOURCES report")
    Reported-by: Stephen Rothwell
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     

08 Sep, 2020

12 commits

  • Since each entry type has timers that can be running simultaneously we need
    to make sure that entries are not freed before their timers have finished.
    In order to do that generalize the src gc work to mcast gc work and use a
    callback to free the entries (mdb, port group or src).

    v3: add IPv6 support
    v2: force mcast gc on port del to make sure all port group timers have
    finished before freeing the bridge port

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • When an IGMPv3/MLDv2 query is received and we're operating in such mode
    then we need to avoid updating group timers if the suppress flag is set.
    Also we should update only timers for groups in exclude mode.

    v3: add IPv6/MLDv2 support

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • We already have all necessary helpers, so process IGMPV3/MLDv2
    BLOCK_OLD_SOURCES as per the RFCs.

    v3: add IPv6/MLDv2 support
    v2: directly do flag bit operations

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • In order to process IGMPV3/MLDv2 CHANGE_TO_INCLUDE/EXCLUDE report types we
    need new helpers which allow us to mark entries based on their timer
    state and to query only marked entries.

    v3: add IPv6/MLDv2 support, fix other_query checks
    v2: directly do flag bit operations

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • In order to process IGMPV3/MLDv2_MODE_IS_INCLUDE/EXCLUDE report types we
    need some new helpers which allow us to set/clear flags for all current
    entries and later delete marked entries after the report sources have been
    processed.

    v3: add IPv6/MLDv2 support
    v2: drop flag helpers and directly do flag bit operations

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • This patch adds handling for the ALLOW_NEW_SOURCES IGMPv3/MLDv2 report
    types and limits them only when multicast_igmp_version == 3 or
    multicast_mld_version == 2 respectively. Now that IGMPv3/MLDv2 handling
    functions will be managing timers we need to delay their activation, thus
    a new argument is added which controls if the timer should be updated.
    We also disable host IGMPv3/MLDv2 handling as it's not yet implemented and
    could cause inconsistent group state, the host can only join a group as
    EXCLUDE {} or leave it.

    v4: rename update_timer to igmpv2_mldv1 and use the passed value from
    br_multicast_add_group's callers
    v3: Add IPv6/MLDv2 support

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • If an expired port group is in EXCLUDE mode, then we have to turn it
    into INCLUDE mode, remove all srcs with zero timer and finally remove
    the group itself if there are no more srcs with an active timer.
    For IGMPv2 use there would be no sources, so this will reduce to just
    removing the group as before.

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • We have to use mdb and port entries when sending mdb notifications in
    order to fill in all group attributes properly. Before this change we
    would've used a fake br_mdb_entry struct to fill in only partial
    information about the mdb. Now we can also reuse the mdb dump fill
    function and thus have only a single central place which fills the mdb
    attributes.

    v3: add IPv6 support

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • We need to be able to retransmit group-specific and group-and-source
    specific queries. The new timer takes care of those.

    v3: add IPv6 support

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • Allows br_multicast_alloc_query to build queries with the port group's
    source lists and sends a query for sources over and under lmqt when
    necessary as per RFCs 3376 and 3810 with the suppress flag set
    appropriately.

    v3: add IPv6 support

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • Initial functions for group source lists which are needed for IGMPv3
    and MLDv2 include/exclude lists. Both IPv4 and IPv6 sources are supported.
    User-added mdb entries are created with exclude filter mode, we can
    extend that later to allow user-supplied mode. When group src entries
    are deleted, they're freed from a workqueue to make sure their timers
    are not still running. Source entries are protected by the multicast_lock
    and rcu. The number of src groups per port group is limited to 32.

    v4: use the new port group del function directly
    add igmpv2/mldv1 bool to denote if the entry was added in those
    modes, it will later replace the old update_timer bool
    v3: add IPv6 support
    v2: allow src groups to be traversed under rcu

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     
  • In order to avoid future errors and reduce code duplication we should
    factor out the port group del sequence. This allows us to have one
    function which takes care of all details when removing a port group.

    v4: set pg's fast leave flag when deleting due to fast leave
    move the patch before adding source lists

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: Jakub Kicinski

    Nikolay Aleksandrov
     

08 Jul, 2020

1 commit

  • Commit e57f61858b7c ("net: bridge: mcast: fix stale nsrcs pointer in
    igmp3/mld2 report handling") introduced a bug in the IPv6 header payload
    length check which would potentially lead to rejecting a valid MLD2 Report:

    The check needs to take into account the 2 bytes for the "Number of
    Sources" field in the "Multicast Address Record" before reading it.
    And not the size of a pointer to this field.

    Fixes: e57f61858b7c ("net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling")
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: Linus Lüssing
    Signed-off-by: David S. Miller

    Linus Lüssing
     

28 May, 2020

1 commit

  • Clang-10 and clang-11 run into a corner case of the register
    allocator on 32-bit ARM, leading to excessive stack usage from
    register spilling:

    net/bridge/br_multicast.c:2422:6: error: stack frame size of 1472 bytes in function 'br_multicast_get_stats' [-Werror,-Wframe-larger-than=]

    Work around this by marking one of the internal functions as
    noinline_for_stack.

    Link: https://bugs.llvm.org/show_bug.cgi?id=45802#c9
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

18 Aug, 2019

1 commit

  • Currently this is needed only for user-space compatibility, so similar
    object adds/deletes as the dumped ones would succeed. Later it can be
    used for L2 mcast MAC add/delete.

    v3: fix compiler warning (DaveM)
    v2: don't send a notification when used from user-space, arm the group
    timer if no ports are left after host entry del

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

    Nikolay Aleksandrov
     

07 Aug, 2019

1 commit


01 Aug, 2019

2 commits

  • In user-space there's no way to distinguish why an mdb entry was deleted
    and that is a problem for daemons which would like to keep the mdb in
    sync with remote ends (e.g. mlag) but would also like to converge faster.
    In almost all cases we'd like to age-out the remote entry for performance
    and convergence reasons except when fast-leave is enabled. In that case we
    want explicit immediate remote delete, thus add mdb flag which is set only
    when the entry is being deleted due to fast-leave.

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

    Nikolay Aleksandrov
     
  • When permanent entries were introduced by the commit below, they were
    exempt from timing out and thus igmp leave wouldn't affect them unless
    fast leave was enabled on the port which was added before permanent
    entries existed. It shouldn't matter if fast leave is enabled or not
    if the user added a permanent entry it shouldn't be deleted on igmp
    leave.

    Before:
    $ echo 1 > /sys/class/net/eth4/brport/multicast_fast_leave
    $ bridge mdb add dev br0 port eth4 grp 229.1.1.1 permanent
    $ bridge mdb show
    dev br0 port eth4 grp 229.1.1.1 permanent

    < join and leave 229.1.1.1 on eth4 >

    $ bridge mdb show
    $

    After:
    $ echo 1 > /sys/class/net/eth4/brport/multicast_fast_leave
    $ bridge mdb add dev br0 port eth4 grp 229.1.1.1 permanent
    $ bridge mdb show
    dev br0 port eth4 grp 229.1.1.1 permanent

    < join and leave 229.1.1.1 on eth4 >

    $ bridge mdb show
    dev br0 port eth4 grp 229.1.1.1 permanent

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

    Nikolay Aleksandrov
     

03 Jul, 2019

2 commits

  • We get a pointer to the ipv6 hdr in br_ip6_multicast_query but we may
    call pskb_may_pull afterwards and end up using a stale pointer.
    So use the header directly, it's just 1 place where it's needed.

    Fixes: 08b202b67264 ("bridge br_multicast: IPv6 MLD support.")
    Signed-off-by: Nikolay Aleksandrov
    Tested-by: Martin Weinelt
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     
  • We take a pointer to grec prior to calling pskb_may_pull and use it
    afterwards to get nsrcs so record nsrcs before the pull when handling
    igmp3 and we get a pointer to nsrcs and call pskb_may_pull when handling
    mld2 which again could lead to reading 2 bytes out-of-bounds.

    ==================================================================
    BUG: KASAN: use-after-free in br_multicast_rcv+0x480c/0x4ad0 [bridge]
    Read of size 2 at addr ffff8880421302b4 by task ksoftirqd/1/16

    CPU: 1 PID: 16 Comm: ksoftirqd/1 Tainted: G OE 5.2.0-rc6+ #1
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
    Call Trace:
    dump_stack+0x71/0xab
    print_address_description+0x6a/0x280
    ? br_multicast_rcv+0x480c/0x4ad0 [bridge]
    __kasan_report+0x152/0x1aa
    ? br_multicast_rcv+0x480c/0x4ad0 [bridge]
    ? br_multicast_rcv+0x480c/0x4ad0 [bridge]
    kasan_report+0xe/0x20
    br_multicast_rcv+0x480c/0x4ad0 [bridge]
    ? br_multicast_disable_port+0x150/0x150 [bridge]
    ? ktime_get_with_offset+0xb4/0x150
    ? __kasan_kmalloc.constprop.6+0xa6/0xf0
    ? __netif_receive_skb+0x1b0/0x1b0
    ? br_fdb_update+0x10e/0x6e0 [bridge]
    ? br_handle_frame_finish+0x3c6/0x11d0 [bridge]
    br_handle_frame_finish+0x3c6/0x11d0 [bridge]
    ? br_pass_frame_up+0x3a0/0x3a0 [bridge]
    ? virtnet_probe+0x1c80/0x1c80 [virtio_net]
    br_handle_frame+0x731/0xd90 [bridge]
    ? select_idle_sibling+0x25/0x7d0
    ? br_handle_frame_finish+0x11d0/0x11d0 [bridge]
    __netif_receive_skb_core+0xced/0x2d70
    ? virtqueue_get_buf_ctx+0x230/0x1130 [virtio_ring]
    ? do_xdp_generic+0x20/0x20
    ? virtqueue_napi_complete+0x39/0x70 [virtio_net]
    ? virtnet_poll+0x94d/0xc78 [virtio_net]
    ? receive_buf+0x5120/0x5120 [virtio_net]
    ? __netif_receive_skb_one_core+0x97/0x1d0
    __netif_receive_skb_one_core+0x97/0x1d0
    ? __netif_receive_skb_core+0x2d70/0x2d70
    ? _raw_write_trylock+0x100/0x100
    ? __queue_work+0x41e/0xbe0
    process_backlog+0x19c/0x650
    ? _raw_read_lock_irq+0x40/0x40
    net_rx_action+0x71e/0xbc0
    ? __switch_to_asm+0x40/0x70
    ? napi_complete_done+0x360/0x360
    ? __switch_to_asm+0x34/0x70
    ? __switch_to_asm+0x40/0x70
    ? __schedule+0x85e/0x14d0
    __do_softirq+0x1db/0x5f9
    ? takeover_tasklets+0x5f0/0x5f0
    run_ksoftirqd+0x26/0x40
    smpboot_thread_fn+0x443/0x680
    ? sort_range+0x20/0x20
    ? schedule+0x94/0x210
    ? __kthread_parkme+0x78/0xf0
    ? sort_range+0x20/0x20
    kthread+0x2ae/0x3a0
    ? kthread_create_worker_on_cpu+0xc0/0xc0
    ret_from_fork+0x35/0x40

    The buggy address belongs to the page:
    page:ffffea0001084c00 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0
    flags: 0xffffc000000000()
    raw: 00ffffc000000000 ffffea0000cfca08 ffffea0001098608 0000000000000000
    raw: 0000000000000000 0000000000000003 00000000ffffff7f 0000000000000000
    page dumped because: kasan: bad access detected

    Memory state around the buggy address:
    ffff888042130180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ffff888042130200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    > ffff888042130280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ^
    ffff888042130300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ffff888042130380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ==================================================================
    Disabling lock debugging due to kernel taint

    Fixes: bc8c20acaea1 ("bridge: multicast: treat igmpv3 report with INCLUDE and no sources as a leave")
    Reported-by: Martin Weinelt
    Signed-off-by: Nikolay Aleksandrov
    Tested-by: Martin Weinelt
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

18 Apr, 2019

1 commit


12 Apr, 2019

1 commit


08 Apr, 2019

1 commit

  • This patch changes rhashtables to use a bit_spin_lock on BIT(1) of the
    bucket pointer to lock the hash chain for that bucket.

    The benefits of a bit spin_lock are:
    - no need to allocate a separate array of locks.
    - no need to have a configuration option to guide the
    choice of the size of this array
    - locking cost is often a single test-and-set in a cache line
    that will have to be loaded anyway. When inserting at, or removing
    from, the head of the chain, the unlock is free - writing the new
    address in the bucket head implicitly clears the lock bit.
    For __rhashtable_insert_fast() we ensure this always happens
    when adding a new key.
    - even when lockings costs 2 updates (lock and unlock), they are
    in a cacheline that needs to be read anyway.

    The cost of using a bit spin_lock is a little bit of code complexity,
    which I think is quite manageable.

    Bit spin_locks are sometimes inappropriate because they are not fair -
    if multiple CPUs repeatedly contend of the same lock, one CPU can
    easily be starved. This is not a credible situation with rhashtable.
    Multiple CPUs may want to repeatedly add or remove objects, but they
    will typically do so at different buckets, so they will attempt to
    acquire different locks.

    As we have more bit-locks than we previously had spinlocks (by at
    least a factor of two) we can expect slightly less contention to
    go with the slightly better cache behavior and reduced memory
    consumption.

    To enhance type checking, a new struct is introduced to represent the
    pointer plus lock-bit
    that is stored in the bucket-table. This is "struct rhash_lock_head"
    and is empty. A pointer to this needs to be cast to either an
    unsigned lock, or a "struct rhash_head *" to be useful.
    Variables of this type are most often called "bkt".

    Previously "pprev" would sometimes point to a bucket, and sometimes a
    ->next pointer in an rhash_head. As these are now different types,
    pprev is NULL when it would have pointed to the bucket. In that case,
    'blk' is used, together with correct locking protocol.

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

    NeilBrown
     

06 Apr, 2019

1 commit


05 Apr, 2019

2 commits

  • Since the mcast conversion to rhashtable this function has been unused, so
    remove it.

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

    Nikolay Aleksandrov
     
  • We need to be careful and always zero the whole br_ip struct when it is
    used for matching since the rhashtable change. This patch fixes all the
    places which didn't properly clear it which in turn might've caused
    mismatches.

    Thanks for the great bug report with reproducing steps and bisection.

    Steps to reproduce (from the bug report):
    ip link add br0 type bridge mcast_querier 1
    ip link set br0 up

    ip link add v2 type veth peer name v3
    ip link set v2 master br0
    ip link set v2 up
    ip link set v3 up
    ip addr add 3.0.0.2/24 dev v3

    ip netns add test
    ip link add v1 type veth peer name v1 netns test
    ip link set v1 master br0
    ip link set v1 up
    ip -n test link set v1 up
    ip -n test addr add 3.0.0.1/24 dev v1

    # Multicast receiver
    ip netns exec test socat
    UDP4-RECVFROM:5588,ip-add-membership=224.224.224.224:3.0.0.1,fork -

    # Multicast sender
    echo hello | nc -u -s 3.0.0.2 224.224.224.224 5588

    Reported-by: liam.mcbirnie@boeing.com
    Fixes: 19e3a9c90c53 ("net: bridge: convert multicast to generic rhashtable")
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov