1. 29 Jul, 2019 15 commits
    • Gustavo A. R. Silva's avatar
      net: spider_net: Mark expected switch fall-through · 52023a53
      Gustavo A. R. Silva authored
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/net/ethernet/toshiba/spider_net.c: In function 'spider_net_release_tx_chain':
      drivers/net/ethernet/toshiba/spider_net.c:783:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
          if (!brutal) {
             ^
      drivers/net/ethernet/toshiba/spider_net.c:792:3: note: here
         case SPIDER_NET_DESCR_RESPONSE_ERROR:
         ^~~~
      
      Notice that, in this particular case, the code comment is
      modified in accordance with what GCC is expecting to find.
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52023a53
    • Gustavo A. R. Silva's avatar
      net: ehea: Mark expected switch fall-through · 6f315c42
      Gustavo A. R. Silva authored
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/net/ethernet/ibm/ehea/ehea_main.c: In function 'ehea_mem_notifier':
      include/linux/printk.h:311:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
        printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/ibm/ehea/ehea_main.c:3253:3: note: in expansion of macro 'pr_info'
         pr_info("memory offlining canceled");
         ^~~~~~~
      drivers/net/ethernet/ibm/ehea/ehea_main.c:3256:2: note: here
        case MEM_ONLINE:
        ^~~~
      
      Notice that, in this particular case, the code comment is
      modified in accordance with what GCC is expecting to find.
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f315c42
    • Matteo Croce's avatar
      mvpp2: refactor the HW checksum setup · d66503c4
      Matteo Croce authored
      The hardware can only offload checksum calculation on first port due to
      the Tx FIFO size limitation, and has a maximum L3 offset of 128 bytes.
      Document this in a comment and move duplicated code in a function.
      
      Fixes: 576193f2 ("net: mvpp2: jumbo frames support")
      Signed-off-by: default avatarMatteo Croce <mcroce@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d66503c4
    • Jiri Pirko's avatar
      net: fix ifindex collision during namespace removal · 55b40dbf
      Jiri Pirko authored
      Commit aca51397 ("netns: Fix arbitrary net_device-s corruptions
      on net_ns stop.") introduced a possibility to hit a BUG in case device
      is returning back to init_net and two following conditions are met:
      1) dev->ifindex value is used in a name of another "dev%d"
         device in init_net.
      2) dev->name is used by another device in init_net.
      
      Under real life circumstances this is hard to get. Therefore this has
      been present happily for over 10 years. To reproduce:
      
      $ ip a
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          inet 127.0.0.1/8 scope host lo
             valid_lft forever preferred_lft forever
          inet6 ::1/128 scope host
             valid_lft forever preferred_lft forever
      2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
          link/ether 86:89:3f:86:61:29 brd ff:ff:ff:ff:ff:ff
      3: enp0s2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
          link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
      $ ip netns add ns1
      $ ip -n ns1 link add dummy1ns1 type dummy
      $ ip -n ns1 link add dummy2ns1 type dummy
      $ ip link set enp0s2 netns ns1
      $ ip -n ns1 link set enp0s2 name dummy0
      [  100.858894] virtio_net virtio0 dummy0: renamed from enp0s2
      $ ip link add dev4 type dummy
      $ ip -n ns1 a
      1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: dummy1ns1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
          link/ether 16:63:4c:38:3e:ff brd ff:ff:ff:ff:ff:ff
      3: dummy2ns1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
          link/ether aa:9e:86:dd:6b:5d brd ff:ff:ff:ff:ff:ff
      4: dummy0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
          link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
      $ ip a
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          inet 127.0.0.1/8 scope host lo
             valid_lft forever preferred_lft forever
          inet6 ::1/128 scope host
             valid_lft forever preferred_lft forever
      2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
          link/ether 86:89:3f:86:61:29 brd ff:ff:ff:ff:ff:ff
      4: dev4: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
          link/ether 5a:e1:4a:b6:ec:f8 brd ff:ff:ff:ff:ff:ff
      $ ip netns del ns1
      [  158.717795] default_device_exit: failed to move dummy0 to init_net: -17
      [  158.719316] ------------[ cut here ]------------
      [  158.720591] kernel BUG at net/core/dev.c:9824!
      [  158.722260] invalid opcode: 0000 [#1] SMP KASAN PTI
      [  158.723728] CPU: 0 PID: 56 Comm: kworker/u2:1 Not tainted 5.3.0-rc1+ #18
      [  158.725422] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-2.fc30 04/01/2014
      [  158.727508] Workqueue: netns cleanup_net
      [  158.728915] RIP: 0010:default_device_exit.cold+0x1d/0x1f
      [  158.730683] Code: 84 e8 18 c9 3e fe 0f 0b e9 70 90 ff ff e8 36 e4 52 fe 89 d9 4c 89 e2 48 c7 c6 80 d6 25 84 48 c7 c7 20 c0 25 84 e8 f4 c8 3e
      [  158.736854] RSP: 0018:ffff8880347e7b90 EFLAGS: 00010282
      [  158.738752] RAX: 000000000000003b RBX: 00000000ffffffef RCX: 0000000000000000
      [  158.741369] RDX: 0000000000000000 RSI: ffffffff8128013d RDI: ffffed10068fcf64
      [  158.743418] RBP: ffff888033550170 R08: 000000000000003b R09: fffffbfff0b94b9c
      [  158.745626] R10: fffffbfff0b94b9b R11: ffffffff85ca5cdf R12: ffff888032f28000
      [  158.748405] R13: dffffc0000000000 R14: ffff8880335501b8 R15: 1ffff110068fcf72
      [  158.750638] FS:  0000000000000000(0000) GS:ffff888036000000(0000) knlGS:0000000000000000
      [  158.752944] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  158.755245] CR2: 00007fe8b45d21d0 CR3: 00000000340b4005 CR4: 0000000000360ef0
      [  158.757654] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  158.760012] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  158.762758] Call Trace:
      [  158.763882]  ? dev_change_net_namespace+0xbb0/0xbb0
      [  158.766148]  ? devlink_nl_cmd_set_doit+0x520/0x520
      [  158.768034]  ? dev_change_net_namespace+0xbb0/0xbb0
      [  158.769870]  ops_exit_list.isra.0+0xa8/0x150
      [  158.771544]  cleanup_net+0x446/0x8f0
      [  158.772945]  ? unregister_pernet_operations+0x4a0/0x4a0
      [  158.775294]  process_one_work+0xa1a/0x1740
      [  158.776896]  ? pwq_dec_nr_in_flight+0x310/0x310
      [  158.779143]  ? do_raw_spin_lock+0x11b/0x280
      [  158.780848]  worker_thread+0x9e/0x1060
      [  158.782500]  ? process_one_work+0x1740/0x1740
      [  158.784454]  kthread+0x31b/0x420
      [  158.786082]  ? __kthread_create_on_node+0x3f0/0x3f0
      [  158.788286]  ret_from_fork+0x3a/0x50
      [  158.789871] ---[ end trace defd6c657c71f936 ]---
      [  158.792273] RIP: 0010:default_device_exit.cold+0x1d/0x1f
      [  158.795478] Code: 84 e8 18 c9 3e fe 0f 0b e9 70 90 ff ff e8 36 e4 52 fe 89 d9 4c 89 e2 48 c7 c6 80 d6 25 84 48 c7 c7 20 c0 25 84 e8 f4 c8 3e
      [  158.804854] RSP: 0018:ffff8880347e7b90 EFLAGS: 00010282
      [  158.807865] RAX: 000000000000003b RBX: 00000000ffffffef RCX: 0000000000000000
      [  158.811794] RDX: 0000000000000000 RSI: ffffffff8128013d RDI: ffffed10068fcf64
      [  158.816652] RBP: ffff888033550170 R08: 000000000000003b R09: fffffbfff0b94b9c
      [  158.820930] R10: fffffbfff0b94b9b R11: ffffffff85ca5cdf R12: ffff888032f28000
      [  158.825113] R13: dffffc0000000000 R14: ffff8880335501b8 R15: 1ffff110068fcf72
      [  158.829899] FS:  0000000000000000(0000) GS:ffff888036000000(0000) knlGS:0000000000000000
      [  158.834923] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  158.838164] CR2: 00007fe8b45d21d0 CR3: 00000000340b4005 CR4: 0000000000360ef0
      [  158.841917] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  158.845149] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      
      Fix this by checking if a device with the same name exists in init_net
      and fallback to original code - dev%d to allocate name - in case it does.
      
      This was found using syzkaller.
      
      Fixes: aca51397 ("netns: Fix arbitrary net_device-s corruptions on net_ns stop.")
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      55b40dbf
    • Matteo Croce's avatar
      mvpp2: refactor MTU change code · 230bd958
      Matteo Croce authored
      The MTU change code can call napi_disable() with the device already down,
      leading to a deadlock. Also, lot of code is duplicated unnecessarily.
      
      Rework mvpp2_change_mtu() to avoid the deadlock and remove duplicated code.
      
      Fixes: 3f518509 ("ethernet: Add new driver for Marvell Armada 375 network unit")
      Signed-off-by: default avatarMatteo Croce <mcroce@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      230bd958
    • Colin Ian King's avatar
      rocker: fix memory leaks of fib_work on two error return paths · 011f1754
      Colin Ian King authored
      Currently there are two error return paths that leak memory allocated
      to fib_work. Fix this by kfree'ing fib_work before returning.
      
      Addresses-Coverity: ("Resource leak")
      Fixes: 19a9d136 ("ipv4: Flag fib_info with a fib_nh using IPv6 gateway")
      Fixes: dbcc4fa7 ("rocker: Fail attempts to use routes with nexthop objects")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      011f1754
    • Martin Blumenstingl's avatar
      net: stmmac: manage errors returned by of_get_mac_address() · 195b2919
      Martin Blumenstingl authored
      Commit d01f449c ("of_net: add NVMEM support to of_get_mac_address")
      added support for reading the MAC address from an nvmem-cell. This
      required changing the logic to return an error pointer upon failure.
      
      If stmmac is loaded before the nvmem provider driver then
      of_get_mac_address() return an error pointer with -EPROBE_DEFER.
      
      Propagate this error so the stmmac driver will be probed again after the
      nvmem provider driver is loaded.
      Default to a random generated MAC address in case of any other error,
      instead of using the error pointer as MAC address.
      
      Fixes: d01f449c ("of_net: add NVMEM support to of_get_mac_address")
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      195b2919
    • Gustavo A. R. Silva's avatar
      net/af_iucv: mark expected switch fall-throughs · 05bba1ed
      Gustavo A. R. Silva authored
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      net/iucv/af_iucv.c: warning: this statement may fall
      through [-Wimplicit-fallthrough=]:  => 537:3, 519:6, 2246:6, 510:6
      
      Notice that, in this particular case, the code comment is
      modified in accordance with what GCC is expecting to find.
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05bba1ed
    • Gustavo A. R. Silva's avatar
      arcnet: com20020-isa: Mark expected switch fall-throughs · e1ab2431
      Gustavo A. R. Silva authored
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      drivers/net/arcnet/com20020-isa.c: warning: this statement may fall
      through [-Wimplicit-fallthrough=]:  => 205:13, 203:10, 209:7, 201:11,
      207:8
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e1ab2431
    • Nikolay Aleksandrov's avatar
      net: bridge: delete local fdb on device init failure · d7bae09f
      Nikolay Aleksandrov authored
      On initialization failure we have to delete the local fdb which was
      inserted due to the default pvid creation. This problem has been present
      since the inception of default_pvid. Note that currently there are 2 cases:
      1) in br_dev_init() when br_multicast_init() fails
      2) if register_netdevice() fails after calling ndo_init()
      
      This patch takes care of both since br_vlan_flush() is called on both
      occasions. Also the new fdb delete would be a no-op on normal bridge
      device destruction since the local fdb would've been already flushed by
      br_dev_delete(). This is not an issue for ports since nbp_vlan_init() is
      called last when adding a port thus nothing can fail after it.
      
      Reported-by: syzbot+88533dc8b582309bf3ee@syzkaller.appspotmail.com
      Fixes: 5be5a2df ("bridge: Add filtering support for default_pvid")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7bae09f
    • Jia-Ju Bai's avatar
      net: sched: Fix a possible null-pointer dereference in dequeue_func() · 051c7b39
      Jia-Ju Bai authored
      In dequeue_func(), there is an if statement on line 74 to check whether
      skb is NULL:
          if (skb)
      
      When skb is NULL, it is used on line 77:
          prefetch(&skb->end);
      
      Thus, a possible null-pointer dereference may occur.
      
      To fix this bug, skb->end is used when skb is not NULL.
      
      This bug is found by a static analysis tool STCheck written by us.
      
      Fixes: 76e3cc12 ("codel: Controlled Delay AQM")
      Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      051c7b39
    • Jesper Dangaard Brouer's avatar
      MAINTAINERS: Remove mailing-list entry for XDP (eXpress Data Path) · a7f9cbf0
      Jesper Dangaard Brouer authored
      This removes the mailing list xdp-newbies@vger.kernel.org from the XDP
      kernel maintainers entry.
      
      Being in the kernel MAINTAINERS file successfully caused the list to
      receive kbuild bot warnings, syzbot reports and sometimes developer
      patches. The level of details in these messages, doesn't match the
      target audience of the XDP-newbies list. This is based on a survey on
      the mailing list, where 73% voted for removal from MAINTAINERS file.
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7f9cbf0
    • Gustavo A. R. Silva's avatar
      arcnet: arc-rimi: Mark expected switch fall-throughs · 26027f42
      Gustavo A. R. Silva authored
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warnings (Building: powerpc allyesconfig):
      
      drivers/net/arcnet/arc-rimi.c: In function 'arcrimi_setup':
      include/linux/printk.h:304:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
        printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/arcnet/arc-rimi.c:365:3: note: in expansion of macro 'pr_err'
         pr_err("Too many arguments\n");
         ^~~~~~
      drivers/net/arcnet/arc-rimi.c:366:2: note: here
        case 3:  /* Node ID */
        ^~~~
      drivers/net/arcnet/arc-rimi.c:367:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
         node = ints[3];
         ~~~~~^~~~~~~~~
      drivers/net/arcnet/arc-rimi.c:368:2: note: here
        case 2:  /* IRQ */
        ^~~~
      drivers/net/arcnet/arc-rimi.c:369:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
         irq = ints[2];
         ~~~~^~~~~~~~~
      drivers/net/arcnet/arc-rimi.c:370:2: note: here
        case 1:  /* IO address */
        ^~~~
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26027f42
    • Gustavo A. R. Silva's avatar
      arcnet: com90io: Mark expected switch fall-throughs · 56f37a3f
      Gustavo A. R. Silva authored
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warnings (Building: powerpc allyesconfig):
      
      drivers/net/arcnet/com90io.c: In function 'com90io_setup':
      include/linux/printk.h:304:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
        printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/arcnet/com90io.c:365:3: note: in expansion of macro 'pr_err'
         pr_err("Too many arguments\n");
         ^~~~~~
      drivers/net/arcnet/com90io.c:366:2: note: here
        case 2:  /* IRQ */
        ^~~~
      drivers/net/arcnet/com90io.c:367:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
         irq = ints[2];
         ~~~~^~~~~~~~~
      drivers/net/arcnet/com90io.c:368:2: note: here
        case 1:  /* IO address */
        ^~~~
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      56f37a3f
    • Gustavo A. R. Silva's avatar
      arcnet: com90xx: Mark expected switch fall-throughs · f3eb2c33
      Gustavo A. R. Silva authored
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warnings (Building: powerpc allyesconfig):
      
      drivers/net/arcnet/com90xx.c: In function 'com90xx_setup':
      include/linux/printk.h:304:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
        printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/arcnet/com90xx.c:695:3: note: in expansion of macro 'pr_err'
         pr_err("Too many arguments\n");
         ^~~~~~
      drivers/net/arcnet/com90xx.c:696:2: note: here
        case 3:  /* Mem address */
        ^~~~
      drivers/net/arcnet/com90xx.c:697:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
         shmem = ints[3];
         ~~~~~~^~~~~~~~~
      drivers/net/arcnet/com90xx.c:698:2: note: here
        case 2:  /* IRQ */
        ^~~~
      drivers/net/arcnet/com90xx.c:699:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
         irq = ints[2];
         ~~~~^~~~~~~~~
      drivers/net/arcnet/com90xx.c:700:2: note: here
        case 1:  /* IO address */
        ^~~~
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f3eb2c33
  2. 27 Jul, 2019 6 commits
  3. 26 Jul, 2019 10 commits
  4. 25 Jul, 2019 9 commits