1. 06 Sep, 2021 3 commits
  2. 05 Sep, 2021 12 commits
  3. 04 Sep, 2021 5 commits
  4. 03 Sep, 2021 15 commits
  5. 02 Sep, 2021 5 commits
    • Rafał Miłecki's avatar
      net: dsa: b53: Set correct number of ports in the DSA struct · d12e1c46
      Rafał Miłecki authored
      Setting DSA_MAX_PORTS caused DSA to call b53 callbacks (e.g.
      b53_disable_port() during dsa_register_switch()) for invalid
      (non-existent) ports. That made b53 modify unrelated registers and is
      one of reasons for a broken BCM5301x support.
      
      This problem exists for years but DSA_MAX_PORTS usage has changed few
      times. It seems the most accurate to reference commit dropping
      dsa_switch_alloc() in the Fixes tag.
      
      Fixes: 7e99e347 ("net: dsa: remove dsa_switch_alloc helper")
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d12e1c46
    • Rafał Miłecki's avatar
      net: dsa: b53: Fix calculating number of switch ports · cdb067d3
      Rafał Miłecki authored
      It isn't true that CPU port is always the last one. Switches BCM5301x
      have 9 ports (port 6 being inactive) and they use port 5 as CPU by
      default (depending on design some other may be CPU ports too).
      
      A more reliable way of determining number of ports is to check for the
      last set bit in the "enabled_ports" bitfield.
      
      This fixes b53 internal state, it will allow providing accurate info to
      the DSA and is required to fix BCM5301x support.
      
      Fixes: 967dd82f ("net: dsa: b53: Add support for Broadcom RoboSwitch")
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cdb067d3
    • Daniele Palmas's avatar
      net: usb: cdc_mbim: avoid altsetting toggling for Telit LN920 · aabbdc67
      Daniele Palmas authored
      Add quirk CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE for Telit LN920
      0x1061 composition in order to avoid bind error.
      Signed-off-by: default avatarDaniele Palmas <dnlplm@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aabbdc67
    • Ziyang Xuan's avatar
      net: hso: add failure handler for add_net_device · ecdc28de
      Ziyang Xuan authored
      If the network devices connected to the system beyond
      HSO_MAX_NET_DEVICES. add_net_device() in hso_create_net_device()
      will be failed for the network_table is full. It will lead to
      business failure which rely on network_table, for example,
      hso_suspend() and hso_resume(). It will also lead to memory leak
      because resource release process can not search the hso_device
      object from network_table in hso_free_interface().
      
      Add failure handler for add_net_device() in hso_create_net_device()
      to solve the above problems.
      
      Fixes: 72dc1c09 ("HSO: add option hso driver")
      Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ecdc28de
    • Tetsuo Handa's avatar
      flow: fix object-size-mismatch warning in flowi{4,6}_to_flowi_common() · b9edbfe1
      Tetsuo Handa authored
      Commit 3df98d79 ("lsm,selinux: pass flowi_common instead of flowi
      to the LSM hooks") introduced flowi{4,6}_to_flowi_common() functions which
      cause UBSAN warning when building with LLVM 11.0.1 on Ubuntu 21.04.
      
       ================================================================================
       UBSAN: object-size-mismatch in ./include/net/flow.h:197:33
       member access within address ffffc9000109fbd8 with insufficient space
       for an object of type 'struct flowi'
       CPU: 2 PID: 7410 Comm: systemd-resolve Not tainted 5.14.0 #51
       Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 02/27/2020
       Call Trace:
        dump_stack_lvl+0x103/0x171
        ubsan_type_mismatch_common+0x1de/0x390
        __ubsan_handle_type_mismatch_v1+0x41/0x50
        udp_sendmsg+0xda2/0x1300
        ? ip_skb_dst_mtu+0x1f0/0x1f0
        ? sock_rps_record_flow+0xe/0x200
        ? inet_send_prepare+0x2d/0x90
        sock_sendmsg+0x49/0x80
        ____sys_sendmsg+0x269/0x370
        __sys_sendmsg+0x15e/0x1d0
        ? syscall_enter_from_user_mode+0xf0/0x1b0
        do_syscall_64+0x3d/0xb0
        entry_SYSCALL_64_after_hwframe+0x44/0xae
       RIP: 0033:0x7f7081a50497
       Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10
       RSP: 002b:00007ffc153870f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
       RAX: ffffffffffffffda RBX: 000000000000000c RCX: 00007f7081a50497
       RDX: 0000000000000000 RSI: 00007ffc15387140 RDI: 000000000000000c
       RBP: 00007ffc15387140 R08: 0000563f29a5e4fc R09: 000000000000cd28
       R10: 0000563f29a68a30 R11: 0000000000000246 R12: 000000000000000c
       R13: 0000000000000001 R14: 0000563f29a68a30 R15: 0000563f29a5e50c
       ================================================================================
      
      I don't think we need to call flowi{4,6}_to_flowi() from these functions
      because the first member of "struct flowi4" and "struct flowi6" is
      
        struct flowi_common __fl_common;
      
      while the first member of "struct flowi" is
      
        union {
          struct flowi_common __fl_common;
          struct flowi4       ip4;
          struct flowi6       ip6;
          struct flowidn      dn;
        } u;
      
      which should point to the same address without access to "struct flowi".
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b9edbfe1