1. 07 Nov, 2019 7 commits
    • Jose Abreu's avatar
      net: stmmac: gmac4: bitrev32 returns u32 · 4d7c47e3
      Jose Abreu authored
      The bitrev32 function returns an u32 var, not an int. Fix it.
      
      Fixes: 477286b5 ("stmmac: add GMAC4 core support")
      Signed-off-by: default avatarJose Abreu <Jose.Abreu@synopsys.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d7c47e3
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · 53ba60af
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      1) Missing register size validation in bitwise and cmp offloads.
      
      2) Fix error code in ip_set_sockfn_get() when copy_to_user() fails,
         from Dan Carpenter.
      
      3) Oneliner to copy MAC address in IPv6 hash:ip,mac sets, from
         Stefano Brivio.
      
      4) Missing policy validation in ipset with NL_VALIDATE_STRICT,
         from Jozsef Kadlecsik.
      
      5) Fix unaligned access to private data area of nf_tables instructions,
         from Lukas Wunner.
      
      6) Relax check for object updates, reported as a regression by
         Eric Garver, patch from Fernando Fernandez Mancera.
      
      7) Crash on ebtables dnat extension when used from the output path.
         From Florian Westphal.
      
      8) Fix bogus EOPNOTSUPP when updating basechain flags.
      
      9) Fix bogus EBUSY when updating a basechain that is already offloaded.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      53ba60af
    • Ursula Braun's avatar
      net/smc: fix ethernet interface refcounting · 98f33755
      Ursula Braun authored
      If a pnet table entry is to be added mentioning a valid ethernet
      interface, but an invalid infiniband or ISM device, the dev_put()
      operation for the ethernet interface is called twice, resulting
      in a negative refcount for the ethernet interface, which disables
      removal of such a network interface.
      
      This patch removes one of the dev_put() calls.
      
      Fixes: 890a2cb4 ("net/smc: rework pnet table")
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      98f33755
    • David S. Miller's avatar
      Merge branch 'net-tls-add-a-TX-lock' · 9990a79d
      David S. Miller authored
      Jakub Kicinski says:
      
      ====================
      net/tls: add a TX lock
      
      Some time ago Pooja and Mallesham started reporting crashes with
      an async accelerator. After trying to poke the existing logic into
      shape I came to the conclusion that it can't be trusted, and to
      preserve our sanity we should just add a lock around the TX side.
      
      First patch removes the sk_write_pending checks from the write
      space callbacks. Those don't seem to have a logical justification.
      
      Patch 2 adds the TX lock and patch 3 associated test (which should
      hang with current net).
      
      Mallesham reports that even with these fixes applied the async
      accelerator workload still occasionally hangs waiting for socket
      memory. I suspect that's strictly related to the way async crypto
      is integrated in TLS, so I think we should get these into net or
      net-next and move from there.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9990a79d
    • Jakub Kicinski's avatar
      selftests/tls: add test for concurrent recv and send · 41098af5
      Jakub Kicinski authored
      Add a test which spawns 16 threads and performs concurrent
      send and recv calls on the same socket.
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41098af5
    • Jakub Kicinski's avatar
      net/tls: add a TX lock · 79ffe608
      Jakub Kicinski authored
      TLS TX needs to release and re-acquire the socket lock if send buffer
      fills up.
      
      TLS SW TX path currently depends on only allowing one thread to enter
      the function by the abuse of sk_write_pending. If another writer is
      already waiting for memory no new ones are allowed in.
      
      This has two problems:
       - writers don't wake other threads up when they leave the kernel;
         meaning that this scheme works for single extra thread (second
         application thread or delayed work) because memory becoming
         available will send a wake up request, but as Mallesham and
         Pooja report with larger number of threads it leads to threads
         being put to sleep indefinitely;
       - the delayed work does not get _scheduled_ but it may _run_ when
         other writers are present leading to crashes as writers don't
         expect state to change under their feet (same records get pushed
         and freed multiple times); it's hard to reliably bail from the
         work, however, because the mere presence of a writer does not
         guarantee that the writer will push pending records before exiting.
      
      Ensuring wakeups always happen will make the code basically open
      code a mutex. Just use a mutex.
      
      The TLS HW TX path does not have any locking (not even the
      sk_write_pending hack), yet it uses a per-socket sg_tx_data
      array to push records.
      
      Fixes: a42055e8 ("net/tls: Add support for async encryption of records for performance")
      Reported-by: default avatarMallesham  Jatharakonda <mallesh537@gmail.com>
      Reported-by: default avatarPooja Trivedi <poojatrivedi@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79ffe608
    • Jakub Kicinski's avatar
      net/tls: don't pay attention to sk_write_pending when pushing partial records · 02b1fa07
      Jakub Kicinski authored
      sk_write_pending being not zero does not guarantee that partial
      record will be pushed. If the thread waiting for memory times out
      the pending record may get stuck.
      
      In case of tls_device there is no path where parial record is
      set and writer present in the first place. Partial record is
      set only in tls_push_sg() and tls_push_sg() will return an
      error immediately. All tls_device callers of tls_push_sg()
      will return (and not wait for memory) if it failed.
      
      Fixes: a42055e8 ("net/tls: Add support for async encryption of records for performance")
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02b1fa07
  2. 06 Nov, 2019 19 commits
  3. 05 Nov, 2019 4 commits
    • Ivan Khoronzhuk's avatar
      taprio: fix panic while hw offload sched list swap · 0763b3e8
      Ivan Khoronzhuk authored
      Don't swap oper and admin schedules too early, it's not correct and
      causes crash.
      
      Steps to reproduce:
      
      1)
      tc qdisc replace dev eth0 parent root handle 100 taprio \
          num_tc 3 \
          map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
          queues 1@0 1@1 1@2 \
          base-time $SOME_BASE_TIME \
          sched-entry S 01 80000 \
          sched-entry S 02 15000 \
          sched-entry S 04 40000 \
          flags 2
      
      2)
      tc qdisc replace dev eth0 parent root handle 100 taprio \
          base-time $SOME_BASE_TIME \
          sched-entry S 01 90000 \
          sched-entry S 02 20000 \
          sched-entry S 04 40000 \
          flags 2
      
      3)
      tc qdisc replace dev eth0 parent root handle 100 taprio \
          base-time $SOME_BASE_TIME \
          sched-entry S 01 150000 \
          sched-entry S 02 200000 \
          sched-entry S 04 40000 \
          flags 2
      
      Do 2 3 2 .. steps  more times if not happens and observe:
      
      [  305.832319] Unable to handle kernel write to read-only memory at
      virtual address ffff0000087ce7f0
      [  305.910887] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
      [  305.919306] Hardware name: Texas Instruments AM654 Base Board (DT)
      
      [...]
      
      [  306.017119] x1 : ffff800848031d88 x0 : ffff800848031d80
      [  306.022422] Call trace:
      [  306.024866]  taprio_free_sched_cb+0x4c/0x98
      [  306.029040]  rcu_process_callbacks+0x25c/0x410
      [  306.033476]  __do_softirq+0x10c/0x208
      [  306.037132]  irq_exit+0xb8/0xc8
      [  306.040267]  __handle_domain_irq+0x64/0xb8
      [  306.044352]  gic_handle_irq+0x7c/0x178
      [  306.048092]  el1_irq+0xb0/0x128
      [  306.051227]  arch_cpu_idle+0x10/0x18
      [  306.054795]  do_idle+0x120/0x138
      [  306.058015]  cpu_startup_entry+0x20/0x28
      [  306.061931]  rest_init+0xcc/0xd8
      [  306.065154]  start_kernel+0x3bc/0x3e4
      [  306.068810] Code: f2fbd5b7 f2fbd5b6 d503201f f9400422 (f9000662)
      [  306.074900] ---[ end trace 96c8e2284a9d9d6e ]---
      [  306.079507] Kernel panic - not syncing: Fatal exception in interrupt
      [  306.085847] SMP: stopping secondary CPUs
      [  306.089765] Kernel Offset: disabled
      
      Try to explain one of the possible crash cases:
      
      The "real" admin list is assigned when admin_sched is set to
      new_admin, it happens after "swap", that assigns to oper_sched NULL.
      Thus if call qdisc show it can crash.
      
      Farther, next second time, when sched list is updated, the admin_sched
      is not NULL and becomes the oper_sched, previous oper_sched was NULL so
      just skipped. But then admin_sched is assigned new_admin, but schedules
      to free previous assigned admin_sched (that already became oper_sched).
      
      Farther, next third time, when sched list is updated,
      while one more swap, oper_sched is not null, but it was happy to be
      freed already (while prev. admin update), so while try to free
      oper_sched the kernel panic happens at taprio_free_sched_cb().
      
      So, move the "swap emulation" where it should be according to function
      comment from code.
      
      Fixes: 9c66d156 ("taprio: Add support for hardware offloading")
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Tested-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0763b3e8
    • David S. Miller's avatar
      Merge tag 'linux-can-fixes-for-5.4-20191105' of... · fc564e09
      David S. Miller authored
      Merge tag 'linux-can-fixes-for-5.4-20191105' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2019-11-05
      
      this is a pull request of 33 patches for net/master.
      
      In the first patch Wen Yang's patch adds a missing of_node_put() to CAN device
      infrastructure.
      
      Navid Emamdoost's patch for the gs_usb driver fixes a memory leak in the
      gs_can_open() error path.
      
      Johan Hovold provides two patches, one for the mcba_usb, the other for the
      usb_8dev driver. Both fix a use-after-free after USB-disconnect.
      
      Joakim Zhang's patch improves the flexcan driver, the ECC mechanism is now
      completely disabled instead of masking the interrupts.
      
      The next three patches all target the peak_usb driver. Stephane Grosjean's
      patch fixes a potential out-of-sync while decoding packets, Johan Hovold's
      patch fixes a slab info leak, Jeroen Hofstee's patch adds missing reporting of
      bus off recovery events.
      
      Followed by three patches for the c_can driver. Kurt Van Dijck's patch fixes
      detection of potential missing status IRQs, Jeroen Hofstee's patches add a chip
      reset on open and add missing reporting of bus off recovery events.
      
      Appana Durga Kedareswara rao's patch for the xilinx driver fixes the flags
      field initialization for axi CAN.
      
      The next seven patches target the rx-offload helper, they are by me and Jeroen
      Hofstee. The error handling in case of a queue overflow is fixed removing a
      memory leak. Further the error handling in case of queue overflow and skb OOM
      is cleaned up.
      
      The next two patches are by me and target the flexcan and ti_hecc driver. In
      case of a error during can_rx_offload_queue_sorted() the error counters in the
      drivers are incremented.
      
      Jeroen Hofstee provides 6 patches for the ti_hecc driver, which properly stop
      the device in ifdown, improve the rx-offload support (which hit mainline in
      v5.4-rc1), and add missing FIFO overflow and state change reporting.
      
      The following four patches target the j1939 protocol. Colin Ian King's patch
      fixes a memory leak in the j1939_sk_errqueue() handling. Three patches by
      Oleksij Rempel fix a memory leak on socket release and fix the EOMA packet in
      the transport protocol.
      
      Timo Schlüßler's patch fixes a potential race condition in the mcp251x driver
      on after suspend.
      
      The last patch is by Yegor Yefremov and updates the SPDX-License-Identifier to
      v3.0.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc564e09
    • Yegor Yefremov's avatar
      can: don't use deprecated license identifiers · 3926a3a0
      Yegor Yefremov authored
      The "GPL-2.0" license identifier changed to "GPL-2.0-only" in SPDX v3.0.
      Signed-off-by: default avatarYegor Yefremov <yegorslists@googlemail.com>
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      3926a3a0
    • Timo Schlüßler's avatar
      can: mcp251x: mcp251x_restart_work_handler(): Fix potential force_quit race condition · 27a0e54b
      Timo Schlüßler authored
      In mcp251x_restart_work_handler() the variable to stop the interrupt
      handler (priv->force_quit) is reset after the chip is restarted and thus
      a interrupt might occur.
      
      This patch fixes the potential race condition by resetting force_quit
      before enabling interrupts.
      Signed-off-by: default avatarTimo Schlüßler <schluessler@krause.de>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      27a0e54b
  4. 04 Nov, 2019 10 commits