1. 22 Mar, 2022 10 commits
    • Jakub Kicinski's avatar
      netdevice: add missing dm_private kdoc · 4a0cb83b
      Jakub Kicinski authored
      Building htmldocs complains:
        include/linux/netdevice.h:2295: warning: Function parameter or member 'dm_private' not described in 'net_device'
      
      Fixes: b26ef81c ("drop_monitor: remove quadratic behavior")
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20220322051053.1883186-1-kuba@kernel.orgSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4a0cb83b
    • Eric Dumazet's avatar
      net: bridge: mst: prevent NULL deref in br_mst_info_size() · cde3fc24
      Eric Dumazet authored
      Call br_mst_info_size() only if vg pointer is not NULL.
      
      general protection fault, probably for non-canonical address 0xdffffc0000000058: 0000 [#1] PREEMPT SMP KASAN
      KASAN: null-ptr-deref in range [0x00000000000002c0-0x00000000000002c7]
      CPU: 0 PID: 975 Comm: syz-executor.0 Tainted: G        W         5.17.0-next-20220321-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:br_mst_info_size+0x97/0x270 net/bridge/br_mst.c:242
      Code: 00 00 31 c0 e8 ba 10 53 f9 31 c0 b9 40 00 00 00 4c 8d 6c 24 30 4c 89 ef f3 48 ab 48 8d 83 c0 02 00 00 48 89 04 24 48 c1 e8 03 <80> 3c 28 00 0f 85 ae 01 00 00 48 8b 83 c0 02 00 00 41 bf 04 00 00
      RSP: 0018:ffffc900153770a8 EFLAGS: 00010202
      RAX: 0000000000000058 RBX: 0000000000000000 RCX: 0000000000000000
      RDX: 0000000000040000 RSI: ffffffff88259876 RDI: ffffc900153772d8
      RBP: dffffc0000000000 R08: 0000000000000000 R09: ffffffff8db68957
      R10: ffffffff881f737b R11: 0000000000000000 R12: 0000000000000000
      R13: ffffc900153770d8 R14: 00000000000002a0 R15: 00000000ffffffff
      FS:  00007f18bbb6f700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000020001a80 CR3: 000000001a7d9000 CR4: 00000000003506f0
      DR0: 0000000000000000 DR1: 00000000000000d8 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       <TASK>
       br_get_link_af_size_filtered+0x6e9/0xc00 net/bridge/br_netlink.c:123
       rtnl_link_get_af_size net/core/rtnetlink.c:598 [inline]
       if_nlmsg_size+0x40c/0xa50 net/core/rtnetlink.c:1040
       rtnl_calcit.isra.0+0x25f/0x460 net/core/rtnetlink.c:3780
       rtnetlink_rcv_msg+0xa65/0xb80 net/core/rtnetlink.c:5937
       netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2496
       netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
       netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345
       netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921
       sock_sendmsg_nosec net/socket.c:705 [inline]
       sock_sendmsg+0xcf/0x120 net/socket.c:725
       ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413
       ___sys_sendmsg+0xf3/0x170 net/socket.c:2467
       __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      RIP: 0033:0x7f18baa89049
      Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
      RSP: 002b:00007f18bbb6f168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      RAX: ffffffffffffffda RBX: 00007f18bab9bf60 RCX: 00007f18baa89049
      RDX: 0000000000000000 RSI: 0000000020001a80 RDI: 0000000000000004
      RBP: 00007f18baae308d R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
      R13: 00007ffeedb2be2f R14: 00007f18bbb6f300 R15: 0000000000022000
       </TASK>
      Modules linked in:
      ---[ end trace 0000000000000000 ]---
      RIP: 0010:br_mst_info_size+0x97/0x270 net/bridge/br_mst.c:242
      Code: 00 00 31 c0 e8 ba 10 53 f9 31 c0 b9 40 00 00 00 4c 8d 6c 24 30 4c 89 ef f3 48 ab 48 8d 83 c0 02 00 00 48 89 04 24 48 c1 e8 03 <80> 3c 28 00 0f 85 ae 01 00 00 48 8b 83 c0 02 00 00 41 bf 04 00 00
      RSP: 0018:ffffc900153770a8 EFLAGS: 00010202
      RAX: 0000000000000058 RBX: 0000000000000000 RCX: 0000000000000000
      RDX: 0000000000040000 RSI: ffffffff88259876 RDI: ffffc900153772d8
      RBP: dffffc0000000000 R08: 0000000000000000 R09: ffffffff8db68957
      R10: ffffffff881f737b R11: 0000000000000000 R12: 0000000000000000
      R13: ffffc900153770d8 R14: 00000000000002a0 R15: 00000000ffffffff
      FS:  00007f18bbb6f700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000001b2ca22000 CR3: 000000001a7d9000 CR4: 00000000003506f0
      DR0: 0000000000000000 DR1: 00000000000000d8 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      
      Fixes: 122c2948 ("net: bridge: mst: Support setting and reporting MST port states")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Tobias Waldekranz <tobias@waldekranz.com>
      Cc: Nikolay Aleksandrov <razor@blackwall.org>
      Reviewed-by: default avatarTobias Waldekranz <tobias@waldekranz.com>
      Acked-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
      Link: https://lore.kernel.org/r/20220322012314.795187-1-eric.dumazet@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      cde3fc24
    • Paolo Abeni's avatar
      Merge branch 'selftests-forwarding-locked-bridge-port-fixes' · 7b17d2d7
      Paolo Abeni authored
      Ido Schimmel says:
      
      ====================
      selftests: forwarding: Locked bridge port fixes
      
      Two fixes for the locked bridge port selftest.
      ====================
      
      Link: https://lore.kernel.org/r/20220321175102.978020-1-idosch@nvidia.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      7b17d2d7
    • Ido Schimmel's avatar
      selftests: forwarding: Use same VRF for port and VLAN upper · f70f5f1a
      Ido Schimmel authored
      The test creates a separate VRF for the VLAN upper, but does not destroy
      it during cleanup, resulting in "RTNETLINK answers: File exists" errors.
      
      Fix by using the same VRF for the port and its VLAN upper. This is OK
      since their IP addresses do not overlap.
      
      Before:
      
       # ./bridge_locked_port.sh
       TEST: Locked port ipv4                                              [ OK ]
       TEST: Locked port ipv6                                              [ OK ]
       TEST: Locked port vlan                                              [ OK ]
      
       # ./bridge_locked_port.sh
       RTNETLINK answers: File exists
       RTNETLINK answers: File exists
       RTNETLINK answers: File exists
       RTNETLINK answers: File exists
       RTNETLINK answers: File exists
       RTNETLINK answers: File exists
       TEST: Locked port ipv4                                              [ OK ]
       TEST: Locked port ipv6                                              [ OK ]
       TEST: Locked port vlan                                              [ OK ]
      
      After:
      
       # ./bridge_locked_port.sh
       TEST: Locked port ipv4                                              [ OK ]
       TEST: Locked port ipv6                                              [ OK ]
       TEST: Locked port vlan                                              [ OK ]
      
       # ./bridge_locked_port.sh
       TEST: Locked port ipv4                                              [ OK ]
       TEST: Locked port ipv6                                              [ OK ]
       TEST: Locked port vlan                                              [ OK ]
      
      Fixes: b2b681a4 ("selftests: forwarding: tests of locked port feature")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f70f5f1a
    • Ido Schimmel's avatar
      selftests: forwarding: Disable learning before link up · 917b149a
      Ido Schimmel authored
      Disable learning before bringing the bridge port up in order to avoid
      the FDB being populated and the test failing.
      
      Before:
      
       # ./bridge_locked_port.sh
       RTNETLINK answers: File exists
       TEST: Locked port ipv4                                              [FAIL]
               Ping worked after locking port, but before adding FDB entry
       TEST: Locked port ipv6                                              [ OK ]
       TEST: Locked port vlan                                              [ OK ]
      
      After:
      
       # ./bridge_locked_port.sh
       TEST: Locked port ipv4                                              [ OK ]
       TEST: Locked port ipv6                                              [ OK ]
       TEST: Locked port vlan                                              [ OK ]
      
      Fixes: b2b681a4 ("selftests: forwarding: tests of locked port feature")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      917b149a
    • Bill Wendling's avatar
      bnx2x: truncate value to original sizing · 4723832f
      Bill Wendling authored
      The original behavior was to print out unsigned short or unsigned char
      values. The change in commit d65aea8e ("bnx2x: use correct format
      characters") prints out the whole value if not truncated. So truncate
      the value to an unsigned {short|char} to retain the original behavior.
      
      Fixes: d65aea8e ("bnx2x: use correct format characters")
      Link: https://github.com/ClangBuiltLinux/linux/issues/378Signed-off-by: default avatarBill Wendling <morbo@google.com>
      Link: https://lore.kernel.org/r/20220321023155.106066-1-morbo@google.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4723832f
    • Jakub Kicinski's avatar
      Merge branch 'net-mscc-miim-add-integrated-phy-reset-support' · aa80511a
      Jakub Kicinski authored
      Michael Walle says:
      
      ====================
      net: mscc-miim: add integrated PHY reset support
      
      The MDIO driver has support to release the integrated PHYs from reset.
      This was implemented for the SparX-5 for now. Now add support for the
      LAN966x, too.
      ====================
      
      Link: https://lore.kernel.org/r/20220318201324.1647416-1-michael@walle.ccSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      aa80511a
    • Michael Walle's avatar
      net: mdio: mscc-miim: add lan966x internal phy reset support · 74529db3
      Michael Walle authored
      The LAN966x has two internal PHYs which are in reset by default. The
      driver already supported the internal PHYs of the SparX-5. Now add
      support for the LAN966x, too. Add a new compatible to distinguish them.
      
      The LAN966x has additional control bits in this register, thus convert
      the regmap_write() to regmap_update_bits() to leave the remaining bits
      untouched. This doesn't change anything for the SparX-5 SoC, because
      there, the register consists only of reset bits.
      Signed-off-by: default avatarMichael Walle <michael@walle.cc>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      74529db3
    • Michael Walle's avatar
      net: mdio: mscc-miim: replace magic numbers for the bus reset · 58ebdba3
      Michael Walle authored
      Replace the magic numbers by macros which are already defined. It seems
      the original commit missed to use them.
      Signed-off-by: default avatarMichael Walle <michael@walle.cc>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      58ebdba3
    • Michael Walle's avatar
      dt-bindings: net: mscc-miim: add lan966x compatible · a2e4b5ad
      Michael Walle authored
      The MDIO controller has support to release the internal PHYs from reset
      by specifying a second memory resource. This is different between the
      currently supported SparX-5 and the LAN966x. Add a new compatible to
      distinguish between these two.
      Signed-off-by: default avatarMichael Walle <michael@walle.cc>
      Acked-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a2e4b5ad
  2. 21 Mar, 2022 30 commits