1. 16 May, 2019 15 commits
  2. 15 May, 2019 8 commits
  3. 14 May, 2019 17 commits
    • Pieter Jansen van Vuuren's avatar
      nfp: flower: add rcu locks when accessing netdev for tunnels · cb07d915
      Pieter Jansen van Vuuren authored
      Add rcu locks when accessing netdev when processing route request
      and tunnel keep alive messages received from hardware.
      
      Fixes: 8e6a9046 ("nfp: flower vxlan neighbour offload")
      Fixes: 856f5b13 ("nfp: flower vxlan neighbour keep-alive")
      Signed-off-by: default avatarPieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
      Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarJohn Hurley <john.hurley@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb07d915
    • YueHaibing's avatar
      ppp: deflate: Fix possible crash in deflate_init · 3ebe1bca
      YueHaibing authored
      BUG: unable to handle kernel paging request at ffffffffa018f000
      PGD 3270067 P4D 3270067 PUD 3271063 PMD 2307eb067 PTE 0
      Oops: 0000 [#1] PREEMPT SMP
      CPU: 0 PID: 4138 Comm: modprobe Not tainted 5.1.0-rc7+ #1
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
      rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
      RIP: 0010:ppp_register_compressor+0x3e/0xd0 [ppp_generic]
      Code: 98 4a 3f e2 48 8b 15 c1 67 00 00 41 8b 0c 24 48 81 fa 40 f0 19 a0
      75 0e eb 35 48 8b 12 48 81 fa 40 f0 19 a0 74
      RSP: 0018:ffffc90000d93c68 EFLAGS: 00010287
      RAX: ffffffffa018f000 RBX: ffffffffa01a3000 RCX: 000000000000001a
      RDX: ffff888230c750a0 RSI: 0000000000000000 RDI: ffffffffa019f000
      RBP: ffffc90000d93c80 R08: 0000000000000001 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffa0194080
      R13: ffff88822ee1a700 R14: 0000000000000000 R15: ffffc90000d93e78
      FS:  00007f2339557540(0000) GS:ffff888237a00000(0000)
      knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffffffffa018f000 CR3: 000000022bde4000 CR4: 00000000000006f0
      Call Trace:
       ? 0xffffffffa01a3000
       deflate_init+0x11/0x1000 [ppp_deflate]
       ? 0xffffffffa01a3000
       do_one_initcall+0x6c/0x3cc
       ? kmem_cache_alloc_trace+0x248/0x3b0
       do_init_module+0x5b/0x1f1
       load_module+0x1db1/0x2690
       ? m_show+0x1d0/0x1d0
       __do_sys_finit_module+0xc5/0xd0
       __x64_sys_finit_module+0x15/0x20
       do_syscall_64+0x6b/0x1d0
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      If ppp_deflate fails to register in deflate_init,
      module initialization failed out, however
      ppp_deflate_draft may has been regiestred and not
      unregistered before return.
      Then the seconed modprobe will trigger crash like this.
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Acked-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ebe1bca
    • Luca Ceresoli's avatar
      net: macb: fix error format in dev_err() · f413cbb3
      Luca Ceresoli authored
      Errors are negative numbers. Using %u shows them as very large positive
      numbers such as 4294967277 that don't make sense. Use the %d format
      instead, and get a much nicer -19.
      Signed-off-by: default avatarLuca Ceresoli <luca@lucaceresoli.net>
      Fixes: b48e0bab ("net: macb: Migrate to devm clock interface")
      Fixes: 93b31f48 ("net/macb: unify clock management")
      Fixes: 421d9df0 ("net/macb: merge at91_ether driver into macb driver")
      Fixes: aead88bd ("net: ethernet: macb: Add support for rx_clk")
      Fixes: f5473d1d ("net: macb: Support clock management for tsu_clk")
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f413cbb3
    • Sabrina Dubroca's avatar
      rtnetlink: always put IFLA_LINK for links with a link-netnsid · feadc4b6
      Sabrina Dubroca authored
      Currently, nla_put_iflink() doesn't put the IFLA_LINK attribute when
      iflink == ifindex.
      
      In some cases, a device can be created in a different netns with the
      same ifindex as its parent. That device will not dump its IFLA_LINK
      attribute, which can confuse some userspace software that expects it.
      For example, if the last ifindex created in init_net and foo are both
      8, these commands will trigger the issue:
      
          ip link add parent type dummy                   # ifindex 9
          ip link add link parent netns foo type macvlan  # ifindex 9 in ns foo
      
      So, in case a device puts the IFLA_LINK_NETNSID attribute in a dump,
      always put the IFLA_LINK attribute as well.
      
      Thanks to Dan Winship for analyzing the original OpenShift bug down to
      the missing netlink attribute.
      
      v2: change Fixes tag, it's been here forever, as Nicolas Dichtel said
          add Nicolas' ack
      v3: change Fixes tag
          fix subject typo, spotted by Edward Cree
      Analyzed-by: default avatarDan Winship <danw@redhat.com>
      Fixes: d8a5ec67 ("[NET]: netlink support for moving devices between network namespaces.")
      Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
      Acked-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      feadc4b6
    • Yunjian Wang's avatar
      net/mlx4_core: Change the error print to info print · 00f9fec4
      Yunjian Wang authored
      The error print within mlx4_flow_steer_promisc_add() should
      be a info print.
      
      Fixes: 592e49dd ('net/mlx4: Implement promiscuous mode with device managed flow-steering')
      Signed-off-by: default avatarYunjian Wang <wangyunjian@huawei.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00f9fec4
    • Johannes Berg's avatar
      NFC: Orphan the subsystem · d0a7e8cb
      Johannes Berg authored
      Samuel clearly hasn't been working on this in many years and
      patches getting to the wireless list are just being ignored
      entirely now. Mark the subsystem as orphan to reflect the
      current state and revert back to the netdev list so at least
      some fixes can be picked up by Dave.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Acked-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0a7e8cb
    • Florian Fainelli's avatar
      net: Always descend into dsa/ · 0fe9f173
      Florian Fainelli authored
      Jiri reported that with a kernel built with CONFIG_FIXED_PHY=y,
      CONFIG_NET_DSA=m and CONFIG_NET_DSA_LOOP=m, we would not get to a
      functional state where the mock-up driver is registered. Turns out that
      we are not descending into drivers/net/dsa/ unconditionally, and we
      won't be able to link-in dsa_loop_bdinfo.o which does the actual mock-up
      mdio device registration.
      Reported-by: default avatarJiri Pirko <jiri@resnulli.us>
      Fixes: 40013ff2 ("net: dsa: Fix functional dsa-loop dependency on FIXED_PHY")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Tested-by: default avatarJiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0fe9f173
    • Yuchung Cheng's avatar
      tcp: fix retrans timestamp on passive Fast Open · cd736d8b
      Yuchung Cheng authored
      Commit c7d13c8f ("tcp: properly track retry time on
      passive Fast Open") sets the start of SYNACK retransmission
      time on passive Fast Open in "retrans_stamp". However the
      timestamp is not reset upon the handshake has completed. As a
      result, future data packet retransmission may not update it in
      tcp_retransmit_skb(). This may lead to socket aborting earlier
      unexpectedly by retransmits_timed_out() since retrans_stamp remains
      the SYNACK rtx time.
      
      This bug only manifests on passive TFO sender that a) suffered
      SYNACK timeout and then b) stalls on very first loss recovery. Any
      successful loss recovery would reset the timestamp to avoid this
      issue.
      
      Fixes: c7d13c8f ("tcp: properly track retry time on passive Fast Open")
      Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd736d8b
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 35c99ffa
      Linus Torvalds authored
      Pull virtio updates from Michael Tsirkin:
      
       - enable packed ring support for s390
      
       - several fixes
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        virtio/s390: enable packed ring
        virtio/s390: DMA support for virtio-ccw
        virtio/s390: use vring_create_virtqueue
        virtio/virtio_ring: do some comment fixes
        vhost-scsi: remove incorrect memory barrier
        tools/virtio/ringtest: Remove bogus definition of BUG_ON()
        virtio_ring: Fix potential mem leak in virtqueue_add_indirect_packed
      35c99ffa
    • Linus Torvalds's avatar
      Add gitignore file for samples/vfs/ generated files · 81413776
      Linus Torvalds authored
      Commit f1b5618e ("vfs: Add a sample program for the new mount API")
      added sample programs that get built during the kernel build, but then
      cause 'git status' to worry about whether the resulting binaries should
      be managed by git.
      
      Tell git not to worry, and to ignore the sample binaries.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      81413776
    • Linus Torvalds's avatar
      Merge branch 'parisc-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · b2c91128
      Linus Torvalds authored
      Pull more parisc updates from Helge Deller:
       "Two small enhancements, which I didn't included in the last pull
        request because I wanted to keep them a few more days in for-next
        before sending upstream:
      
         - Replace the ldcw barrier instruction by a nop instruction in the
           CAS code on uniprocessor machines.
      
         - Map variables read-only after init (enable ro_after_init feature)"
      
      * 'parisc-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Use __ro_after_init in init.c
        parisc: Use __ro_after_init in unwind.c
        parisc: Use __ro_after_init in time.c
        parisc: Use __ro_after_init in processor.c
        parisc: Use __ro_after_init in process.c
        parisc: Use __ro_after_init in perf_images.h
        parisc: Use __ro_after_init in pci.c
        parisc: Use __ro_after_init in inventory.c
        parisc: Use __ro_after_init in head.S
        parisc: Use __ro_after_init in firmware.c
        parisc: Use __ro_after_init in drivers.c
        parisc: Use __ro_after_init in cache.c
        parisc: Enable the ro_after_init feature
        parisc: Drop LDCW barrier in CAS code when running UP
      b2c91128
    • Linus Torvalds's avatar
      Merge tag 'kgdb-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux · ca4b4062
      Linus Torvalds authored
      Pull kgdb updates from Daniel Thompson:
       "Mostly cleanups but there are also a couple of fixes for out-of-bounds
        accesses (including a potential write to the byte before a static
        buffer).
      
        The main changes are:
      
         - Fixes to those out-of-bounds access (empty string to configure test
           module could write the byte before a buffer, high cpu counts could
           read outside of per-cpu structures).
      
         - Improvements to string handling problems picked up by new compiler
           warnings and other static checks. Most are fixing benign issues
           that can't be tickled without code changes but still reduce the wtf
           factor a little.
      
         - Tidy up the terminal output"
      
      * tag 'kgdb-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux:
        kdb: Fix bound check compiler warning
        kdb: do a sanity check on the cpu in kdb_per_cpu()
        kdb: Get rid of broken attempt to print CCVERSION in kdb summary
        misc: kgdbts: fix out-of-bounds access in function param_set_kgdbts_var
        kdb: kdb_support: replace strcpy() by strscpy()
        gdbstub: Replace strcpy() by strscpy()
        gdbstub: mark expected switch fall-throughs
      ca4b4062
    • Linus Torvalds's avatar
      Merge tag 'modules-for-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux · 280664f5
      Linus Torvalds authored
      Pull modules updates from Jessica Yu:
      
       - Use a separate table to store symbol types instead of hijacking
         fields in struct Elf_Sym
      
       - Trivial code cleanups
      
      * tag 'modules-for-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
        module: add stubs for within_module functions
        kallsyms: store type information in its own array
        vmlinux.lds.h: drop unused __vermagic
      280664f5
    • Alexei Starovoitov's avatar
      Merge branch 'lru-map-fix' · 5db17c96
      Alexei Starovoitov authored
      Daniel Borkmann says:
      
      ====================
      This set fixes LRU map eviction in combination with map lookups out
      of system call side from user space. Main patch is the second one and
      test cases are adapted and added in the last one. Thanks!
      ====================
      Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      5db17c96
    • Daniel Borkmann's avatar
      bpf: test ref bit from data path and add new tests for syscall path · d2baab62
      Daniel Borkmann authored
      The test_lru_map is relying on marking the LRU map entry via regular
      BPF map lookup from system call side. This is basically for simplicity
      reasons. Given we fixed marking entries in that case, the test needs
      to be fixed as well. Here we add a small drop-in replacement to retain
      existing behavior for the tests by marking out of the BPF program and
      transferring the retrieved value out via temporary map. This also adds
      new test cases to track the new behavior where two elements are marked,
      one via system call side and one via program side, where the next update
      then evicts the key looked up only from system call side.
      
        # ./test_lru_map
        nr_cpus:8
      
        test_lru_sanity0 (map_type:9 map_flags:0x0): Pass
        test_lru_sanity1 (map_type:9 map_flags:0x0): Pass
        test_lru_sanity2 (map_type:9 map_flags:0x0): Pass
        test_lru_sanity3 (map_type:9 map_flags:0x0): Pass
        test_lru_sanity4 (map_type:9 map_flags:0x0): Pass
        test_lru_sanity5 (map_type:9 map_flags:0x0): Pass
        test_lru_sanity7 (map_type:9 map_flags:0x0): Pass
        test_lru_sanity8 (map_type:9 map_flags:0x0): Pass
      
        test_lru_sanity0 (map_type:10 map_flags:0x0): Pass
        test_lru_sanity1 (map_type:10 map_flags:0x0): Pass
        test_lru_sanity2 (map_type:10 map_flags:0x0): Pass
        test_lru_sanity3 (map_type:10 map_flags:0x0): Pass
        test_lru_sanity4 (map_type:10 map_flags:0x0): Pass
        test_lru_sanity5 (map_type:10 map_flags:0x0): Pass
        test_lru_sanity7 (map_type:10 map_flags:0x0): Pass
        test_lru_sanity8 (map_type:10 map_flags:0x0): Pass
      
        test_lru_sanity0 (map_type:9 map_flags:0x2): Pass
        test_lru_sanity4 (map_type:9 map_flags:0x2): Pass
        test_lru_sanity6 (map_type:9 map_flags:0x2): Pass
        test_lru_sanity7 (map_type:9 map_flags:0x2): Pass
        test_lru_sanity8 (map_type:9 map_flags:0x2): Pass
      
        test_lru_sanity0 (map_type:10 map_flags:0x2): Pass
        test_lru_sanity4 (map_type:10 map_flags:0x2): Pass
        test_lru_sanity6 (map_type:10 map_flags:0x2): Pass
        test_lru_sanity7 (map_type:10 map_flags:0x2): Pass
        test_lru_sanity8 (map_type:10 map_flags:0x2): Pass
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      d2baab62
    • Daniel Borkmann's avatar
      bpf, lru: avoid messing with eviction heuristics upon syscall lookup · 50b045a8
      Daniel Borkmann authored
      One of the biggest issues we face right now with picking LRU map over
      regular hash table is that a map walk out of user space, for example,
      to just dump the existing entries or to remove certain ones, will
      completely mess up LRU eviction heuristics and wrong entries such
      as just created ones will get evicted instead. The reason for this
      is that we mark an entry as "in use" via bpf_lru_node_set_ref() from
      system call lookup side as well. Thus upon walk, all entries are
      being marked, so information of actual least recently used ones
      are "lost".
      
      In case of Cilium where it can be used (besides others) as a BPF
      based connection tracker, this current behavior causes disruption
      upon control plane changes that need to walk the map from user space
      to evict certain entries. Discussion result from bpfconf [0] was that
      we should simply just remove marking from system call side as no
      good use case could be found where it's actually needed there.
      Therefore this patch removes marking for regular LRU and per-CPU
      flavor. If there ever should be a need in future, the behavior could
      be selected via map creation flag, but due to mentioned reason we
      avoid this here.
      
        [0] http://vger.kernel.org/bpfconf.html
      
      Fixes: 29ba732a ("bpf: Add BPF_MAP_TYPE_LRU_HASH")
      Fixes: 8f844938 ("bpf: Add BPF_MAP_TYPE_LRU_PERCPU_HASH")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      50b045a8
    • Daniel Borkmann's avatar
      bpf: add map_lookup_elem_sys_only for lookups from syscall side · c6110222
      Daniel Borkmann authored
      Add a callback map_lookup_elem_sys_only() that map implementations
      could use over map_lookup_elem() from system call side in case the
      map implementation needs to handle the latter differently than from
      the BPF data path. If map_lookup_elem_sys_only() is set, this will
      be preferred pick for map lookups out of user space. This hook is
      used in a follow-up fix for LRU map, but once development window
      opens, we can convert other map types from map_lookup_elem() (here,
      the one called upon BPF_MAP_LOOKUP_ELEM cmd is meant) over to use
      the callback to simplify and clean up the latter.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      c6110222