1. 20 Feb, 2020 1 commit
    • Yonghong Song's avatar
      bpf: Fix a potential deadlock with bpf_map_do_batch · b9aff38d
      Yonghong Song authored
      Commit 05799638 ("bpf: Add batch ops to all htab bpf map")
      added lookup_and_delete batch operation for hash table.
      The current implementation has bpf_lru_push_free() inside
      the bucket lock, which may cause a deadlock.
      
      syzbot reports:
         -> #2 (&htab->buckets[i].lock#2){....}:
             __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
             _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:159
             htab_lru_map_delete_node+0xce/0x2f0 kernel/bpf/hashtab.c:593
             __bpf_lru_list_shrink_inactive kernel/bpf/bpf_lru_list.c:220 [inline]
             __bpf_lru_list_shrink+0xf9/0x470 kernel/bpf/bpf_lru_list.c:266
             bpf_lru_list_pop_free_to_local kernel/bpf/bpf_lru_list.c:340 [inline]
             bpf_common_lru_pop_free kernel/bpf/bpf_lru_list.c:447 [inline]
             bpf_lru_pop_free+0x87c/0x1670 kernel/bpf/bpf_lru_list.c:499
             prealloc_lru_pop+0x2c/0xa0 kernel/bpf/hashtab.c:132
             __htab_lru_percpu_map_update_elem+0x67e/0xa90 kernel/bpf/hashtab.c:1069
             bpf_percpu_hash_update+0x16e/0x210 kernel/bpf/hashtab.c:1585
             bpf_map_update_value.isra.0+0x2d7/0x8e0 kernel/bpf/syscall.c:181
             generic_map_update_batch+0x41f/0x610 kernel/bpf/syscall.c:1319
             bpf_map_do_batch+0x3f5/0x510 kernel/bpf/syscall.c:3348
             __do_sys_bpf+0x9b7/0x41e0 kernel/bpf/syscall.c:3460
             __se_sys_bpf kernel/bpf/syscall.c:3355 [inline]
             __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:3355
             do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
             entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
         -> #0 (&loc_l->lock){....}:
             check_prev_add kernel/locking/lockdep.c:2475 [inline]
             check_prevs_add kernel/locking/lockdep.c:2580 [inline]
             validate_chain kernel/locking/lockdep.c:2970 [inline]
             __lock_acquire+0x2596/0x4a00 kernel/locking/lockdep.c:3954
             lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4484
             __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
             _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:159
             bpf_common_lru_push_free kernel/bpf/bpf_lru_list.c:516 [inline]
             bpf_lru_push_free+0x250/0x5b0 kernel/bpf/bpf_lru_list.c:555
             __htab_map_lookup_and_delete_batch+0x8d4/0x1540 kernel/bpf/hashtab.c:1374
             htab_lru_map_lookup_and_delete_batch+0x34/0x40 kernel/bpf/hashtab.c:1491
             bpf_map_do_batch+0x3f5/0x510 kernel/bpf/syscall.c:3348
             __do_sys_bpf+0x1f7d/0x41e0 kernel/bpf/syscall.c:3456
             __se_sys_bpf kernel/bpf/syscall.c:3355 [inline]
             __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:3355
             do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
             entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
          Possible unsafe locking scenario:
      
                CPU0                    CPU2
                ----                    ----
           lock(&htab->buckets[i].lock#2);
                                        lock(&l->lock);
                                        lock(&htab->buckets[i].lock#2);
           lock(&loc_l->lock);
      
          *** DEADLOCK ***
      
      To fix the issue, for htab_lru_map_lookup_and_delete_batch() in CPU0,
      let us do bpf_lru_push_free() out of the htab bucket lock. This can
      avoid the above deadlock scenario.
      
      Fixes: 05799638 ("bpf: Add batch ops to all htab bpf map")
      Reported-by: syzbot+a38ff3d9356388f2fb83@syzkaller.appspotmail.com
      Reported-by: syzbot+122b5421d14e68f29cd1@syzkaller.appspotmail.com
      Suggested-by: default avatarHillf Danton <hdanton@sina.com>
      Suggested-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Acked-by: default avatarBrian Vazquez <brianvv@google.com>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Link: https://lore.kernel.org/bpf/20200219234757.3544014-1-yhs@fb.com
      b9aff38d
  2. 19 Feb, 2020 1 commit
    • Brian Vazquez's avatar
      bpf: Do not grab the bucket spinlock by default on htab batch ops · 492e0d0d
      Brian Vazquez authored
      Grabbing the spinlock for every bucket even if it's empty, was causing
      significant perfomance cost when traversing htab maps that have only a
      few entries. This patch addresses the issue by checking first the
      bucket_cnt, if the bucket has some entries then we go and grab the
      spinlock and proceed with the batching.
      
      Tested with a htab of size 50K and different value of populated entries.
      
      Before:
        Benchmark             Time(ns)        CPU(ns)
        ---------------------------------------------
        BM_DumpHashMap/1       2759655        2752033
        BM_DumpHashMap/10      2933722        2930825
        BM_DumpHashMap/200     3171680        3170265
        BM_DumpHashMap/500     3639607        3635511
        BM_DumpHashMap/1000    4369008        4364981
        BM_DumpHashMap/5k     11171919       11134028
        BM_DumpHashMap/20k    69150080       69033496
        BM_DumpHashMap/39k   190501036      190226162
      
      After:
        Benchmark             Time(ns)        CPU(ns)
        ---------------------------------------------
        BM_DumpHashMap/1        202707         200109
        BM_DumpHashMap/10       213441         210569
        BM_DumpHashMap/200      478641         472350
        BM_DumpHashMap/500      980061         967102
        BM_DumpHashMap/1000    1863835        1839575
        BM_DumpHashMap/5k      8961836        8902540
        BM_DumpHashMap/20k    69761497       69322756
        BM_DumpHashMap/39k   187437830      186551111
      
      Fixes: 05799638 ("bpf: Add batch ops to all htab bpf map")
      Signed-off-by: default avatarBrian Vazquez <brianvv@google.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarYonghong Song <yhs@fb.com>
      Link: https://lore.kernel.org/bpf/20200218172552.215077-1-brianvv@google.com
      492e0d0d
  3. 18 Feb, 2020 2 commits
  4. 17 Feb, 2020 1 commit
  5. 12 Feb, 2020 2 commits
  6. 11 Feb, 2020 1 commit
    • Magnus Karlsson's avatar
      xsk: Publish global consumer pointers when NAPI is finished · 30744a68
      Magnus Karlsson authored
      The commit 4b638f13 ("xsk: Eliminate the RX batch size")
      introduced a much more lazy way of updating the global consumer
      pointers from the kernel side, by only doing so when running out of
      entries in the fill or Tx rings (the rings consumed by the
      kernel). This can result in a deadlock with the user application if
      the kernel requires more than one entry to proceed and the application
      cannot put these entries in the fill ring because the kernel has not
      updated the global consumer pointer since the ring is not empty.
      
      Fix this by publishing the local kernel side consumer pointer whenever
      we have completed Rx or Tx processing in the kernel. This way, user
      space will have an up-to-date view of the consumer pointers whenever it
      gets to execute in the one core case (application and driver on the
      same core), or after a certain number of packets have been processed
      in the two core case (application and driver on different cores).
      
      A side effect of this patch is that the one core case gets better
      performance, but the two core case gets worse. The reason that the one
      core case improves is that updating the global consumer pointer is
      relatively cheap since the application by definition is not running
      when the kernel is (they are on the same core) and it is beneficial
      for the application, once it gets to run, to have pointers that are
      as up to date as possible since it then can operate on more packets
      and buffers. In the two core case, the most important performance
      aspect is to minimize the number of accesses to the global pointers
      since they are shared between two cores and bounces between the caches
      of those cores. This patch results in more updates to global state,
      which means lower performance in the two core case.
      
      Fixes: 4b638f13 ("xsk: Eliminate the RX batch size")
      Reported-by: default avatarRyan Goodfellow <rgoodfel@isi.edu>
      Reported-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarJonathan Lemon <jonathan.lemon@gmail.com>
      Acked-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Link: https://lore.kernel.org/bpf/1581348432-6747-1-git-send-email-magnus.karlsson@intel.com
      30744a68
  7. 10 Feb, 2020 8 commits
    • Hongbo Yao's avatar
      bpf: Make btf_check_func_type_match() static · 2bf0eb9b
      Hongbo Yao authored
      Fix the following sparse warning:
      
      kernel/bpf/btf.c:4131:5: warning: symbol 'btf_check_func_type_match' was
      not declared. Should it be static?
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarHongbo Yao <yaohongbo@huawei.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20200210011441.147102-1-yaohongbo@huawei.com
      2bf0eb9b
    • John Fastabend's avatar
      bpf: Selftests build error in sockmap_basic.c · f2e97dc1
      John Fastabend authored
      Fix following build error. We could push a tcp.h header into one of the
      include paths, but I think its easy enough to simply pull in the three
      defines we need here. If we end up using more of tcp.h at some point
      we can pull it in later.
      
      /home/john/git/bpf/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c: In function ‘connected_socket_v4’:
      /home/john/git/bpf/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c:20:11: error: ‘TCP_REPAIR_ON’ undeclared (first use in this function)
        repair = TCP_REPAIR_ON;
                 ^
      /home/john/git/bpf/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c:20:11: note: each undeclared identifier is reported only once for each function it appears in
      /home/john/git/bpf/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c:29:11: error: ‘TCP_REPAIR_OFF_NO_WP’ undeclared (first use in this function)
        repair = TCP_REPAIR_OFF_NO_WP;
      
      Then with fix,
      
      $ ./test_progs -n 44
      #44/1 sockmap create_update_free:OK
      #44/2 sockhash create_update_free:OK
      #44 sockmap_basic:OK
      
      Fixes: 5d3919a9 ("selftests/bpf: Test freeing sockmap/sockhash with a socket in it")
      Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Link: https://lore.kernel.org/bpf/158131347731.21414.12120493483848386652.stgit@john-Precision-5820-Tower
      f2e97dc1
    • Bjørn Mork's avatar
      qmi_wwan: unconditionally reject 2 ep interfaces · 00516d13
      Bjørn Mork authored
      We have been using the fact that the QMI and DIAG functions
      usually are the only ones with class/subclass/protocol being
      ff/ff/ff on Quectel modems. This has allowed us to match the
      QMI function without knowing the exact interface number,
      which can vary depending on firmware configuration.
      
      The ability to silently reject the DIAG function, which is
      usually handled by the option driver, is important for this
      method to work.  This is done based on the knowledge that it
      has exactly 2 bulk endpoints.  QMI function control interfaces
      will have either 3 or 1 endpoint. This rule is universal so
      the quirk condition can be removed.
      
      The fixed layouts known from the Gobi1k and Gobi2k modems
      have been gradually replaced by more dynamic layouts, and
      many vendors now use configurable layouts without changing
      device IDs.  Renaming the class/subclass/protocol matching
      macro makes it more obvious that this is now not Quectel
      specific anymore.
      
      Cc: Kristian Evensen <kristian.evensen@gmail.com>
      Cc: Aleksander Morgado <aleksander@aleksander.es>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00516d13
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Prevent truncation of longer interrupt names · 5d1fbdf2
      Andrew Lunn authored
      When adding support for unique interrupt names, after testing on a few
      devices, it was assumed 32 characters would be sufficient. This
      assumption turned out to be incorrect, ZII RDU2 for example uses a
      device base name of mv88e6xxx-30be0000.ethernet-1:0, leaving no space
      for post fixes such as -g1-atu-prob and -watchdog. The names then
      become identical, defeating the point of the patch.
      
      Increase the length of the string to 64 charactoes.
      Reported-by: default avatarChris Healy <Chris.Healy@zii.aero>
      Fixes: 3095383a ("net: dsa: mv88e6xxx: Unique IRQ name")
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5d1fbdf2
    • Bjørn Mork's avatar
      qmi_wwan: re-add DW5821e pre-production variant · 88bf5460
      Bjørn Mork authored
      Commit f25e1392 removed the support for the pre-production variant
      of the Dell DW5821e to avoid probing another USB interface unnecessarily.
      However, the pre-production samples are found in the wild, and this lack
      of support is causing problems for users of such samples.  It is therefore
      necessary to support both variants.
      
      Matching on both interfaces 0 and 1 is not expected to cause any problem
      with either variant, as only the QMI function will be probed successfully
      on either.  Interface 1 will be rejected based on the HID class for the
      production variant:
      
      T:  Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  2
      P:  Vendor=413c ProdID=81d7 Rev=03.18
      S:  Manufacturer=DELL
      S:  Product=DW5821e Snapdragon X20 LTE
      S:  SerialNumber=0123456789ABCDEF
      C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
      I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
      I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      
      And interface 0 will be rejected based on too few endpoints for the
      pre-production variant:
      
      T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=03 Dev#= 7 Spd=480 MxCh= 0
      D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 2
      P: Vendor=413c ProdID=81d7 Rev= 3.18
      S: Manufacturer=DELL
      S: Product=DW5821e Snapdragon X20 LTE
      S: SerialNumber=0123456789ABCDEF
      C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
      I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=
      I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
      I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      
      Fixes: f25e1392 ("qmi_wwan: fix interface number for DW5821e production firmware")
      Link: https://whrl.pl/Rf0vNkReported-by: default avatarLars Melin <larsm17@gmail.com>
      Cc: Aleksander Morgado <aleksander@aleksander.es>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88bf5460
    • Tuong Lien's avatar
      tipc: fix successful connect() but timed out · 5391a877
      Tuong Lien authored
      In commit 9546a0b7 ("tipc: fix wrong connect() return code"), we
      fixed the issue with the 'connect()' that returns zero even though the
      connecting has failed by waiting for the connection to be 'ESTABLISHED'
      really. However, the approach has one drawback in conjunction with our
      'lightweight' connection setup mechanism that the following scenario
      can happen:
      
                (server)                        (client)
      
         +- accept()|                      |             wait_for_conn()
         |          |                      |connect() -------+
         |          |<-------[SYN]---------|                 > sleeping
         |          |                      *CONNECTING       |
         |--------->*ESTABLISHED           |                 |
                    |--------[ACK]-------->*ESTABLISHED      > wakeup()
              send()|--------[DATA]------->|\                > wakeup()
              send()|--------[DATA]------->| |               > wakeup()
                .   .          .           . |-> recvq       .
                .   .          .           . |               .
              send()|--------[DATA]------->|/                > wakeup()
             close()|--------[FIN]-------->*DISCONNECTING    |
                    *DISCONNECTING         |                 |
                    |                      ~~~~~~~~~~~~~~~~~~> schedule()
                                                             | wait again
                                                             .
                                                             .
                                                             | ETIMEDOUT
      
      Upon the receipt of the server 'ACK', the client becomes 'ESTABLISHED'
      and the 'wait_for_conn()' process is woken up but not run. Meanwhile,
      the server starts to send a number of data following by a 'close()'
      shortly without waiting any response from the client, which then forces
      the client socket to be 'DISCONNECTING' immediately. When the wait
      process is switched to be running, it continues to wait until the timer
      expires because of the unexpected socket state. The client 'connect()'
      will finally get ‘-ETIMEDOUT’ and force to release the socket whereas
      there remains the messages in its receive queue.
      
      Obviously the issue would not happen if the server had some delay prior
      to its 'close()' (or the number of 'DATA' messages is large enough),
      but any kind of delay would make the connection setup/shutdown "heavy".
      We solve this by simply allowing the 'connect()' returns zero in this
      particular case. The socket is already 'DISCONNECTING', so any further
      write will get '-EPIPE' but the socket is still able to read the
      messages existing in its receive queue.
      
      Note: This solution doesn't break the previous one as it deals with a
      different situation that the socket state is 'DISCONNECTING' but has no
      error (i.e. sk->sk_err = 0).
      
      Fixes: 9546a0b7 ("tipc: fix wrong connect() return code")
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5391a877
    • Chen Wandun's avatar
      mptcp: make the symbol 'mptcp_sk_clone_lock' static · 5609e2bb
      Chen Wandun authored
      Fix the following sparse warning:
      net/mptcp/protocol.c:646:13: warning: symbol 'mptcp_sk_clone_lock' was not declared. Should it be static?
      
      Fixes: b0519de8 ("mptcp: fix use-after-free for ipv6")
      Signed-off-by: default avatarChen Wandun <chenwandun@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5609e2bb
    • Chen Wandun's avatar
      tipc: make three functions static · 2437fd7b
      Chen Wandun authored
      Fix the following sparse warning:
      
      net/tipc/node.c:281:6: warning: symbol 'tipc_node_free' was not declared. Should it be static?
      net/tipc/node.c:2801:5: warning: symbol '__tipc_nl_node_set_key' was not declared. Should it be static?
      net/tipc/node.c:2878:5: warning: symbol '__tipc_nl_node_flush_key' was not declared. Should it be static?
      
      Fixes: fc1b6d6d ("tipc: introduce TIPC encryption & authentication")
      Fixes: e1f32190 ("tipc: add support for AEAD key setting via netlink")
      Signed-off-by: default avatarChen Wandun <chenwandun@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2437fd7b
  8. 09 Feb, 2020 2 commits
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · fdfa3a67
      Linus Torvalds authored
      Pull misc SCSI fixes from James Bottomley:
       "Five small patches, all in drivers or doc, which missed the initial
        pull request.
      
        The qla2xxx and megaraid_sas are actual fixes and the rest are
        spelling and doc changes"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ufs: fix spelling mistake "initilized" -> "initialized"
        scsi: pm80xx: fix spelling mistake "to" -> "too"
        scsi: MAINTAINERS: ufs: remove pedrom.sousa@synopsys.com
        scsi: megaraid_sas: fixup MSIx interrupt setup during resume
        scsi: qla2xxx: Fix unbound NVME response length
      fdfa3a67
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 291abfea
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Unbalanced locking in mwifiex_process_country_ie, from Brian Norris.
      
       2) Fix thermal zone registration in iwlwifi, from Andrei
          Otcheretianski.
      
       3) Fix double free_irq in sgi ioc3 eth, from Thomas Bogendoerfer.
      
       4) Use after free in mptcp, from Florian Westphal.
      
       5) Use after free in wireguard's root_remove_peer_lists, from Eric
          Dumazet.
      
       6) Properly access packets heads in bonding alb code, from Eric
          Dumazet.
      
       7) Fix data race in skb_queue_len(), from Qian Cai.
      
       8) Fix regression in r8169 on some chips, from Heiner Kallweit.
      
       9) Fix XDP program ref counting in hv_netvsc, from Haiyang Zhang.
      
      10) Certain kinds of set link netlink operations can cause a NULL deref
          in the ipv6 addrconf code. Fix from Eric Dumazet.
      
      11) Don't cancel uninitialized work queue in drop monitor, from Ido
          Schimmel.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits)
        net: thunderx: use proper interface type for RGMII
        mt76: mt7615: fix max_nss in mt7615_eeprom_parse_hw_cap
        bpf: Improve bucket_log calculation logic
        selftests/bpf: Test freeing sockmap/sockhash with a socket in it
        bpf, sockhash: Synchronize_rcu before free'ing map
        bpf, sockmap: Don't sleep while holding RCU lock on tear-down
        bpftool: Don't crash on missing xlated program instructions
        bpf, sockmap: Check update requirements after locking
        drop_monitor: Do not cancel uninitialized work item
        mlxsw: spectrum_dpipe: Add missing error path
        mlxsw: core: Add validation of hardware device types for MGPIR register
        mlxsw: spectrum_router: Clear offload indication from IPv6 nexthops on abort
        selftests: mlxsw: Add test cases for local table route replacement
        mlxsw: spectrum_router: Prevent incorrect replacement of local table routes
        net: dsa: microchip: enable module autoprobe
        ipv6/addrconf: fix potential NULL deref in inet6_set_link_af()
        dpaa_eth: support all modes with rate adapting PHYs
        net: stmmac: update pci platform data to use phy_interface
        net: stmmac: xgmac: fix missing IFF_MULTICAST checki in dwxgmac2_set_filter
        net: stmmac: fix missing IFF_MULTICAST check in dwmac4_set_filter
        ...
      291abfea
  9. 08 Feb, 2020 22 commits
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · d4f309ca
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix an existing bug in our user access handling, exposed by one of
         the bug fixes we merged this cycle.
      
       - A fix for a boot hang on 32-bit with CONFIG_TRACE_IRQFLAGS and the
         recently added CONFIG_VMAP_STACK.
      
      Thanks to: Christophe Leroy, Guenter Roeck.
      
      * tag 'powerpc-5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: Fix CONFIG_TRACE_IRQFLAGS with CONFIG_VMAP_STACK
        powerpc/futex: Fix incorrect user access blocking
      d4f309ca
    • Linus Torvalds's avatar
      Fix up remaining devm_ioremap_nocache() in SGI IOC3 8250 UART driver · b0ef7cda
      Linus Torvalds authored
      This is a merge error on my part - the driver was merged into mainline
      by commit c5951e7c ("Merge tag 'mips_5.6' of git://../mips/linux")
      over a week ago, but nobody apparently noticed that it didn't actually
      build due to still having a reference to the devm_ioremap_nocache()
      function, removed a few days earlier through commit 6a1000bd ("Merge
      tag 'ioremap-5.6' of git://../ioremap").
      
      Apparently this didn't get any build testing anywhere.  Not perhaps all
      that surprising: it's restricted to 64-bit MIPS only, and only with the
      new SGI_MFD_IOC3 support enabled.
      
      I only noticed because the ioremap conflicts in the ARM SoC driver
      update made me check there weren't any others hiding, and I found this
      one.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b0ef7cda
    • Linus Torvalds's avatar
      Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 4ef1a30c
      Linus Torvalds authored
      Pull ARM SoC late updates from Olof Johansson:
       "This is some material that we picked up into our tree late, or that
        had more complex dependencies on more than one topic branch that makes
        sense to keep separately.
      
         - TI support for secure accelerators and hwrng on OMAP4/5
      
         - TI camera changes for dra7 and am437x and SGX improvement due to
           better reset control support on am335x, am437x and dra7
      
         - Davinci moves to proper clocksource on DM365, and regulator/audio
           improvements for DM365 and DM644x eval boards"
      
      * tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (32 commits)
        ARM: dts: omap4-droid4: Enable hdq for droid4 ds250x 1-wire battery nvmem
        ARM: dts: motorola-cpcap-mapphone: Configure calibration interrupt
        ARM: dts: Configure interconnect target module for am437x sgx
        ARM: dts: Configure sgx for dra7
        ARM: dts: Configure rstctrl reset for am335x SGX
        ARM: dts: dra7: Add ti-sysc node for VPE
        ARM: dts: dra7: add vpe clkctrl node
        ARM: dts: am43x-epos-evm: Add VPFE and OV2659 entries
        ARM: dts: am437x-sk-evm: Add VPFE and OV2659 entries
        ARM: dts: am43xx: add support for clkout1 clock
        arm: dts: dra76-evm: Add CAL and OV5640 nodes
        arm: dtsi: dra76x: Add CAL dtsi node
        arm: dts: dra72-evm-common: Add entries for the CSI2 cameras
        ARM: dts: DRA72: Add CAL dtsi node
        ARM: dts: dra7-l4: Add ti-sysc node for CAM
        ARM: OMAP: DRA7xx: Make CAM clock domain SWSUP only
        ARM: dts: dra7: add cam clkctrl node
        ARM: OMAP2+: Drop legacy platform data for omap4 des
        ARM: OMAP2+: Drop legacy platform data for omap4 sham
        ARM: OMAP2+: Drop legacy platform data for omap4 aes
        ...
      4ef1a30c
    • Linus Torvalds's avatar
      Merge tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 5939224c
      Linus Torvalds authored
      Pull ARM SoC defconfig updates from Olof Johansson:
       "We keep this in a separate branch to avoid cross-branch conflicts, but
        most of the material here is fairly boring -- some new drivers turned
        on for hardware since they were merged, and some refreshed files due
        to time having moved a lot of entries around"
      
      * tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (38 commits)
        ARM: configs: at91: enable MMC_SDHCI_OF_AT91 and MICROCHIP_PIT64B
        arm64: defconfig: Enable Broadcom's GENET Ethernet controller
        ARM: multi_v7_defconfig: Enable devfreq thermal integration
        ARM: exynos_defconfig: Enable devfreq thermal integration
        ARM: multi_v7_defconfig: Enable NFS v4.1 and v4.2
        ARM: exynos_defconfig: Enable NFS v4.1 and v4.2
        arm64: defconfig: Enable Actions Semi specific drivers
        arm64: defconfig: Enable Broadcom's STB PCIe controller
        arm64: defconfig: Enable CONFIG_CLK_IMX8MP by default
        ARM: configs: at91: enable config flags for sam9x60 SoC
        ARM: configs: at91: use savedefconfig
        arm64: defconfig: Enable tegra XUDC support
        ARM: defconfig: gemini: Update defconfig
        arm64: defconfig: enable CONFIG_ARM_QCOM_CPUFREQ_NVMEM
        arm64: defconfig: enable CONFIG_QCOM_CPR
        arm64: defconfig: Enable HFPLL
        arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM
        ARM: imx_v6_v7_defconfig: Select the TFP410 driver
        ARM: imx_v6_v7_defconfig: Enable NFS_V4_1 and NFS_V4_2 support
        arm64: defconfig: Enable ATH10K_SNOC
        ...
      5939224c
    • Linus Torvalds's avatar
      Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · eab35405
      Linus Torvalds authored
      Pull ARM SoC-related driver updates from Olof Johansson:
       "Various driver updates for platforms:
      
         - Nvidia: Fuse support for Tegra194, continued memory controller
           pieces for Tegra30
      
         - NXP/FSL: Refactorings of QuickEngine drivers to support
           ARM/ARM64/PPC
      
         - NXP/FSL: i.MX8MP SoC driver pieces
      
         - TI Keystone: ring accelerator driver
      
         - Qualcomm: SCM driver cleanup/refactoring + support for new SoCs.
      
         - Xilinx ZynqMP: feature checking interface for firmware. Mailbox
           communication for power management
      
         - Overall support patch set for cpuidle on more complex hierarchies
           (PSCI-based)
      
        and misc cleanups, refactorings of Marvell, TI, other platforms"
      
      * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (166 commits)
        drivers: soc: xilinx: Use mailbox IPI callback
        dt-bindings: power: reset: xilinx: Add bindings for ipi mailbox
        drivers: soc: ti: knav_qmss_queue: Pass lockdep expression to RCU lists
        MAINTAINERS: Add brcmstb PCIe controller entry
        soc/tegra: fuse: Unmap registers once they are not needed anymore
        soc/tegra: fuse: Correct straps' address for older Tegra124 device trees
        soc/tegra: fuse: Warn if straps are not ready
        soc/tegra: fuse: Cache values of straps and Chip ID registers
        memory: tegra30-emc: Correct error message for timed out auto calibration
        memory: tegra30-emc: Firm up hardware programming sequence
        memory: tegra30-emc: Firm up suspend/resume sequence
        soc/tegra: regulators: Do nothing if voltage is unchanged
        memory: tegra: Correct reset value of xusb_hostr
        soc/tegra: fuse: Add APB DMA dependency for Tegra20
        bus: tegra-aconnect: Remove PM_CLK dependency
        dt-bindings: mediatek: add MT6765 power dt-bindings
        soc: mediatek: cmdq: delete not used define
        memory: tegra: Add support for the Tegra194 memory controller
        memory: tegra: Only include support for enabled SoCs
        memory: tegra: Support DVFS on Tegra186 and later
        ...
      eab35405
    • Linus Torvalds's avatar
      Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 1afa9c3b
      Linus Torvalds authored
      Pull ARM Device-tree updates from Olof Johansson:
       "New SoCs:
      
         - Atmel/Microchip SAM9X60 (ARM926 SoC)
      
         - OMAP 37xx gets split into AM3703/AM3715/DM3725, who are all
           variants of it with different GPU/media IP configurations.
      
         - ST stm32mp15 SoCs (1-2 Cortex-A7, CAN, GPU depending on SKU)
      
         - ST Ericsson ab8505 (variant of ab8500) and db8520 (variant of
           db8500)
      
         - Unisoc SC9863A SoC (8x Cortex-A55 mobile chipset w/ GPU, modem)
      
         - Qualcomm SC7180 (8-core 64bit SoC, unnamed CPU class)
      
        New boards:
      
         - Allwinner:
            + Emlid Neutis SoM (H3 variant)
            + Libre Computer ALL-H3-IT
            + PineH64 Model B
      
         - Amlogic:
            + Libretech Amlogic GX PC (s905d and s912-based variants)
      
         - Atmel/Microchip:
            + Kizboxmini, sam9x60 EK, sama5d27 Wireless SOM (wlsom1)
      
         - Marvell:
            + Armada 385-based SolidRun Clearfog GTR
      
         - NXP:
            + Gateworks GW59xx boards based on i.MX6/6Q/6QDL
            + Tolino Shine 3 eBook reader (i.MX6sl)
            + Embedded Artists COM (i.MX7ULP)
            + SolidRun CLearfog CX/ITX and HoneyComb (LX2160A-based systems)
            + Google Coral Edge TPU (i.MX8MQ)
      
         - Rockchip:
            + Radxa Dalang Carrier (supports rk3288 and rk3399 SOMs)
            + Radxa Rock Pi N10 (RK3399Pro-based)
            + VMARC RK3399Pro SOM
      
         - ST:
            + Reference boards for stm32mp15
      
         - ST Ericsson:
            + Samsung Galaxy S III mini (GT-I8190)
            + HREF520 reference board for DB8520
      
         - TI OMAP:
            + Gen1 Amazon Echo (OMAP3630-based)
      
         - Qualcomm:
            + Inforce 6640 Single Board Computer (msm8996-based)
            + SC7180 IDP (SC7180-based)"
      
      * tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (623 commits)
        dt-bindings: fix compilation error of the example in marvell,mmp3-hsic-phy.yaml
        arm64: dts: ti: k3-am654-base-board: Add CSI2 OV5640 camera
        arm64: dts: ti: k3-am65-main Add CAL node
        arm64: dts: ti: k3-j721e-main: Add McASP nodes
        arm64: dts: ti: k3-am654-main: Add McASP nodes
        arm64: dts: ti: k3-j721e: DMA support
        arm64: dts: ti: k3-j721e-main: Move secure proxy and smmu under main_navss
        arm64: dts: ti: k3-j721e-main: Correct main NAVSS representation
        arm64: dts: ti: k3-j721e: Correct the address for MAIN NAVSS
        arm64: dts: ti: k3-am65: DMA support
        arm64: dts: ti: k3-am65-main: Move secure proxy under cbass_main_navss
        arm64: dts: ti: k3-am65-main: Correct main NAVSS representation
        ARM: dts: aspeed: rainier: Add UCD90320 power sequencer
        ARM: dts: aspeed: rainier: Switch PSUs to unknown version
        arm64: dts: rockchip: Kill off "simple-panel" compatibles
        ARM: dts: rockchip: Kill off "simple-panel" compatibles
        arm64: dts: rockchip: rename dwmmc node names to mmc
        ARM: dts: rockchip: rename dwmmc node names to mmc
        arm64: dts: exynos: Rename Samsung and Exynos to lowercase
        arm64: dts: uniphier: add reset-names to NAND controller node
        ...
      1afa9c3b
    • Linus Torvalds's avatar
      Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 469030d4
      Linus Torvalds authored
      Pull ARM SoC platform updates from Olof Johansson:
       "Most of these are smaller fixes that have accrued, and some continued
        cleanup of OMAP platforms towards shared frameworks.
      
        One new SoC from Atmel/Microchip: sam9x60"
      
      * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (35 commits)
        ARM: OMAP2+: Fix undefined reference to omap_secure_init
        ARM: s3c64xx: Drop unneeded select of TIMER_OF
        ARM: exynos: Drop unneeded select of MIGHT_HAVE_CACHE_L2X0
        ARM: s3c24xx: Switch to atomic pwm API in rx1950
        ARM: OMAP2+: sleep43xx: Call secure suspend/resume handlers
        ARM: OMAP2+: Use ARM SMC Calling Convention when OP-TEE is available
        ARM: OMAP2+: Introduce check for OP-TEE in omap_secure_init()
        ARM: OMAP2+: Add omap_secure_init callback hook for secure initialization
        ARM: at91: Documentation: add sam9x60 product and datasheet
        ARM: at91: pm: use of_device_id array to find the proper shdwc node
        ARM: at91: pm: use SAM9X60 PMC's compatible
        ARM: imx: only select ARM_ERRATA_814220 for ARMv7-A
        ARM: zynq: use physical cpuid in zynq_slcr_cpu_stop/start
        ARM: tegra: Use clk_m CPU on Tegra124 LP1 resume
        ARM: tegra: Modify reshift divider during LP1
        ARM: tegra: Enable PLLP bypass during Tegra124 LP1
        ARM: samsung: Rename Samsung and Exynos to lowercase
        ARM: exynos: Correct the help text for platform Kconfig option
        ARM: bcm: Select ARM_AMBA for ARCH_BRCMSTB
        ARM: brcmstb: Add debug UART entry for 7216
        ...
      469030d4
    • Linus Torvalds's avatar
      Merge tag 'compat-ioctl-fix' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground · b85080c1
      Linus Torvalds authored
      Pull compat-ioctl fix from Arnd Bergmann:
       "One patch in the compat-ioctl series broke 32-bit rootfs for multiple
        people testing on 64-bit kernels. Let's fix it in -rc1 before others
        run into the same issue"
      
      * tag 'compat-ioctl-fix' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground:
        compat_ioctl: fix FIONREAD on devices
      b85080c1
    • Linus Torvalds's avatar
      Merge branch 'merge.nfs-fs_parse.1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · c9d35ee0
      Linus Torvalds authored
      Pull vfs file system parameter updates from Al Viro:
       "Saner fs_parser.c guts and data structures. The system-wide registry
        of syntax types (string/enum/int32/oct32/.../etc.) is gone and so is
        the horror switch() in fs_parse() that would have to grow another case
        every time something got added to that system-wide registry.
      
        New syntax types can be added by filesystems easily now, and their
        namespace is that of functions - not of system-wide enum members. IOW,
        they can be shared or kept private and if some turn out to be widely
        useful, we can make them common library helpers, etc., without having
        to do anything whatsoever to fs_parse() itself.
      
        And we already get that kind of requests - the thing that finally
        pushed me into doing that was "oh, and let's add one for timeouts -
        things like 15s or 2h". If some filesystem really wants that, let them
        do it. Without somebody having to play gatekeeper for the variants
        blessed by direct support in fs_parse(), TYVM.
      
        Quite a bit of boilerplate is gone. And IMO the data structures make a
        lot more sense now. -200LoC, while we are at it"
      
      * 'merge.nfs-fs_parse.1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (25 commits)
        tmpfs: switch to use of invalfc()
        cgroup1: switch to use of errorfc() et.al.
        procfs: switch to use of invalfc()
        hugetlbfs: switch to use of invalfc()
        cramfs: switch to use of errofc() et.al.
        gfs2: switch to use of errorfc() et.al.
        fuse: switch to use errorfc() et.al.
        ceph: use errorfc() and friends instead of spelling the prefix out
        prefix-handling analogues of errorf() and friends
        turn fs_param_is_... into functions
        fs_parse: handle optional arguments sanely
        fs_parse: fold fs_parameter_desc/fs_parameter_spec
        fs_parser: remove fs_parameter_description name field
        add prefix to fs_context->log
        ceph_parse_param(), ceph_parse_mon_ips(): switch to passing fc_log
        new primitive: __fs_parse()
        switch rbd and libceph to p_log-based primitives
        struct p_log, variants of warnf() et.al. taking that one instead
        teach logfc() to handle prefices, give it saner calling conventions
        get rid of cg_invalf()
        ...
      c9d35ee0
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 236f4532
      Linus Torvalds authored
      Pull misc vfs updates from Al Viro:
      
       - bmap series from cmaiolino
      
       - getting rid of convolutions in copy_mount_options() (use a couple of
         copy_from_user() instead of the __get_user() crap)
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        saner copy_mount_options()
        fibmap: Reject negative block numbers
        fibmap: Use bmap instead of ->bmap method in ioctl_fibmap
        ecryptfs: drop direct calls to ->bmap
        cachefiles: drop direct usage of ->bmap method.
        fs: Enable bmap() function to properly return errors
      236f4532
    • Linus Torvalds's avatar
      Merge branch 'pipe-exclusive-wakeup' · 99593330
      Linus Torvalds authored
      Merge thundering herd avoidance on pipe IO.
      
      This would have been applied for 5.5 already, but got delayed because of
      a user-space race condition in the GNU make jobserver code.  Now that
      there's a new GNU make 4.3 release, and most distributions seem to have
      at least applied the (almost three year old) fix for the problem, let's
      see if people notice.
      
      And it might have been just bad random timing luck on my machine.
      
      If you do hit the race condition, things will still work, but the
      symptom is that you don't get nearly the expected parallelism when using
      "make -j<N>".
      
      The jobserver bug can definitely happen without this patch too, but
      seems to be easier to trigger when we no longer wake up pipe waiters
      unnecessarily.
      
      * pipe-exclusive-wakeup:
        pipe: use exclusive waits when reading or writing
      99593330
    • Linus Torvalds's avatar
      pipe: use exclusive waits when reading or writing · 0ddad21d
      Linus Torvalds authored
      This makes the pipe code use separate wait-queues and exclusive waiting
      for readers and writers, avoiding a nasty thundering herd problem when
      there are lots of readers waiting for data on a pipe (or, less commonly,
      lots of writers waiting for a pipe to have space).
      
      While this isn't a common occurrence in the traditional "use a pipe as a
      data transport" case, where you typically only have a single reader and
      a single writer process, there is one common special case: using a pipe
      as a source of "locking tokens" rather than for data communication.
      
      In particular, the GNU make jobserver code ends up using a pipe as a way
      to limit parallelism, where each job consumes a token by reading a byte
      from the jobserver pipe, and releases the token by writing a byte back
      to the pipe.
      
      This pattern is fairly traditional on Unix, and works very well, but
      will waste a lot of time waking up a lot of processes when only a single
      reader needs to be woken up when a writer releases a new token.
      
      A simplified test-case of just this pipe interaction is to create 64
      processes, and then pass a single token around between them (this
      test-case also intentionally passes another token that gets ignored to
      test the "wake up next" logic too, in case anybody wonders about it):
      
          #include <unistd.h>
      
          int main(int argc, char **argv)
          {
              int fd[2], counters[2];
      
              pipe(fd);
              counters[0] = 0;
              counters[1] = -1;
              write(fd[1], counters, sizeof(counters));
      
              /* 64 processes */
              fork(); fork(); fork(); fork(); fork(); fork();
      
              do {
                      int i;
                      read(fd[0], &i, sizeof(i));
                      if (i < 0)
                              continue;
                      counters[0] = i+1;
                      write(fd[1], counters, (1+(i & 1)) *sizeof(int));
              } while (counters[0] < 1000000);
              return 0;
          }
      
      and in a perfect world, passing that token around should only cause one
      context switch per transfer, when the writer of a token causes a
      directed wakeup of just a single reader.
      
      But with the "writer wakes all readers" model we traditionally had, on
      my test box the above case causes more than an order of magnitude more
      scheduling: instead of the expected ~1M context switches, "perf stat"
      shows
      
              231,852.37 msec task-clock                #   15.857 CPUs utilized
              11,250,961      context-switches          #    0.049 M/sec
                 616,304      cpu-migrations            #    0.003 M/sec
                   1,648      page-faults               #    0.007 K/sec
       1,097,903,998,514      cycles                    #    4.735 GHz
         120,781,778,352      instructions              #    0.11  insn per cycle
          27,997,056,043      branches                  #  120.754 M/sec
             283,581,233      branch-misses             #    1.01% of all branches
      
            14.621273891 seconds time elapsed
      
             0.018243000 seconds user
             3.611468000 seconds sys
      
      before this commit.
      
      After this commit, I get
      
                5,229.55 msec task-clock                #    3.072 CPUs utilized
               1,212,233      context-switches          #    0.232 M/sec
                 103,951      cpu-migrations            #    0.020 M/sec
                   1,328      page-faults               #    0.254 K/sec
          21,307,456,166      cycles                    #    4.074 GHz
          12,947,819,999      instructions              #    0.61  insn per cycle
           2,881,985,678      branches                  #  551.096 M/sec
              64,267,015      branch-misses             #    2.23% of all branches
      
             1.702148350 seconds time elapsed
      
             0.004868000 seconds user
             0.110786000 seconds sys
      
      instead. Much better.
      
      [ Note! This kernel improvement seems to be very good at triggering a
        race condition in the make jobserver (in GNU make 4.2.1) for me. It's
        a long known bug that was fixed back in June 2017 by GNU make commit
        b552b0525198 ("[SV 51159] Use a non-blocking read with pselect to
        avoid hangs.").
      
        But there wasn't a new release of GNU make until 4.3 on Jan 19 2020,
        so a number of distributions may still have the buggy version. Some
        have backported the fix to their 4.2.1 release, though, and even
        without the fix it's quite timing-dependent whether the bug actually
        is hit. ]
      
      Josh Triplett says:
       "I've been hammering on your pipe fix patch (switching to exclusive
        wait queues) for a month or so, on several different systems, and I've
        run into no issues with it. The patch *substantially* improves
        parallel build times on large (~100 CPU) systems, both with parallel
        make and with other things that use make's pipe-based jobserver.
      
        All current distributions (including stable and long-term stable
        distributions) have versions of GNU make that no longer have the
        jobserver bug"
      Tested-by: default avatarJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0ddad21d
    • Arnd Bergmann's avatar
      compat_ioctl: fix FIONREAD on devices · 0a061743
      Arnd Bergmann authored
      My final cleanup patch for sys_compat_ioctl() introduced a regression on
      the FIONREAD ioctl command, which is used for both regular and special
      files, but only works on regular files after my patch, as I had missed
      the warning that Al Viro put into a comment right above it.
      
      Change it back so it can work on any file again by moving the implementation
      to do_vfs_ioctl() instead.
      
      Fixes: 77b90401 ("compat_ioctl: simplify the implementation")
      Reported-and-tested-by: default avatarChristian Zigotzky <chzigotzky@xenosoft.de>
      Reported-and-tested-by: default avataryouling257 <youling257@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      0a061743
    • Tim Harvey's avatar
      net: thunderx: use proper interface type for RGMII · 29ca3b31
      Tim Harvey authored
      The configuration of the OCTEONTX XCV_DLL_CTL register via
      xcv_init_hw() is such that the RGMII RX delay is bypassed
      leaving the RGMII TX delay enabled in the MAC:
      
      	/* Configure DLL - enable or bypass
      	 * TX no bypass, RX bypass
      	 */
      	cfg = readq_relaxed(xcv->reg_base + XCV_DLL_CTL);
      	cfg &= ~0xFF03;
      	cfg |= CLKRX_BYP;
      	writeq_relaxed(cfg, xcv->reg_base + XCV_DLL_CTL);
      
      This would coorespond to a interface type of PHY_INTERFACE_MODE_RGMII_RXID
      and not PHY_INTERFACE_MODE_RGMII.
      
      Fixing this allows RGMII PHY drivers to do the right thing (enable
      RX delay in the PHY) instead of erroneously enabling both delays in the
      PHY.
      Signed-off-by: default avatarTim Harvey <tharvey@gateworks.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29ca3b31
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-2020-02-08' of... · c76b305c
      David S. Miller authored
      Merge tag 'wireless-drivers-2020-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for v5.6
      
      First set of fixes for v5.6. Buffer overflow fixes to mwifiex, quite a
      few functionality fixes to iwlwifi and smaller fixes to other drivers.
      
      mwifiex
      
      * fix an unlock from a previous security fix
      
      * fix two buffer overflows
      
      libertas
      
      * fix two bugs from previous security fixes
      
      iwlwifi
      
      * fix module removal with multiple NICs
      
      * don't treat IGTK removal failure as an error
      
      * avoid FW crashes due to DTS measurement races
      
      * fix a potential use after free in FTM code
      
      * prevent a NULL pointer dereference in iwl_mvm_cfg_he_sta()
      
      * fix TDLS discovery
      
      * check all CPUs when trying to detect an error during resume
      
      rtw88
      
      * fix clang warning
      
      mt76
      
      * fix reading of max_nss value from a register
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c76b305c
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 2696e114
      David S. Miller authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2020-02-07
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 15 non-merge commits during the last 10 day(s) which contain
      a total of 12 files changed, 114 insertions(+), 31 deletions(-).
      
      The main changes are:
      
      1) Various BPF sockmap fixes related to RCU handling in the map's tear-
         down code, from Jakub Sitnicki.
      
      2) Fix macro state explosion in BPF sk_storage map when calculating its
         bucket_log on allocation, from Martin KaFai Lau.
      
      3) Fix potential BPF sockmap update race by rechecking socket's established
         state under lock, from Lorenz Bauer.
      
      4) Fix crash in bpftool on missing xlated instructions when kptr_restrict
         sysctl is set, from Toke Høiland-Jørgensen.
      
      5) Fix i40e's XSK wakeup code to return proper error in busy state and
         various misc fixes in xdpsock BPF sample code, from Maciej Fijalkowski.
      
      6) Fix the way modifiers are skipped in BTF in the verifier while walking
         pointers to avoid program rejection, from Alexei Starovoitov.
      
      7) Fix Makefile for runqslower BPF tool to i) rebuild on libbpf changes and
         ii) to fix undefined reference linker errors for older gcc version due to
         order of passed gcc parameters, from Yulia Kartseva and Song Liu.
      
      8) Fix a trampoline_count BPF kselftest warning about missing braces around
         initializer, from Andrii Nakryiko.
      
      9) Fix up redundant "HAVE" prefix from large INSN limit kernel probe in
         bpftool, from Michal Rostecki.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2696e114
    • Christophe Leroy's avatar
      powerpc: Fix CONFIG_TRACE_IRQFLAGS with CONFIG_VMAP_STACK · d4bf9053
      Christophe Leroy authored
      When CONFIG_PROVE_LOCKING is selected together with (now default)
      CONFIG_VMAP_STACK, kernel enter deadlock during boot.
      
      At the point of checking whether interrupts are enabled or not, the
      value of MSR saved on stack is read using the physical address of the
      stack. But at this point, when using VMAP stack the DATA MMU
      translation has already been re-enabled, leading to deadlock.
      
      Don't use the physical address of the stack when
      CONFIG_VMAP_STACK is set.
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Fixes: 02847487 ("powerpc/32: prepare for CONFIG_VMAP_STACK")
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/daeacdc0dec0416d1c587cc9f9e7191ad3068dc0.1581095957.git.christophe.leroy@c-s.fr
      d4bf9053
    • Michael Ellerman's avatar
      powerpc/futex: Fix incorrect user access blocking · 9dc086f1
      Michael Ellerman authored
      The early versions of our kernel user access prevention (KUAP) were
      written by Russell and Christophe, and didn't have separate
      read/write access.
      
      At some point I picked up the series and added the read/write access,
      but I failed to update the usages in futex.h to correctly allow read
      and write.
      
      However we didn't notice because of another bug which was causing the
      low-level code to always enable read and write. That bug was fixed
      recently in commit 1d8f739b ("powerpc/kuap: Fix set direction in
      allow/prevent_user_access()").
      
      futex_atomic_cmpxchg_inatomic() is passed the user address as %3 and
      does:
      
        1:     lwarx   %1,  0, %3
               cmpw    0,  %1, %4
               bne-    3f
        2:     stwcx.  %5,  0, %3
      
      Which clearly loads and stores from/to %3. The logic in
      arch_futex_atomic_op_inuser() is similar, so fix both of them to use
      allow_read_write_user().
      
      Without this fix, and with PPC_KUAP_DEBUG=y, we see eg:
      
        Bug: Read fault blocked by AMR!
        WARNING: CPU: 94 PID: 149215 at arch/powerpc/include/asm/book3s/64/kup-radix.h:126 __do_page_fault+0x600/0xf30
        CPU: 94 PID: 149215 Comm: futex_requeue_p Tainted: G        W         5.5.0-rc7-gcc9x-g4c25df56 #1
        ...
        NIP [c000000000070680] __do_page_fault+0x600/0xf30
        LR [c00000000007067c] __do_page_fault+0x5fc/0xf30
        Call Trace:
        [c00020138e5637e0] [c00000000007067c] __do_page_fault+0x5fc/0xf30 (unreliable)
        [c00020138e5638c0] [c00000000000ada8] handle_page_fault+0x10/0x30
        --- interrupt: 301 at cmpxchg_futex_value_locked+0x68/0xd0
            LR = futex_lock_pi_atomic+0xe0/0x1f0
        [c00020138e563bc0] [c000000000217b50] futex_lock_pi_atomic+0x80/0x1f0 (unreliable)
        [c00020138e563c30] [c00000000021b668] futex_requeue+0x438/0xb60
        [c00020138e563d60] [c00000000021c6cc] do_futex+0x1ec/0x2b0
        [c00020138e563d90] [c00000000021c8b8] sys_futex+0x128/0x200
        [c00020138e563e20] [c00000000000b7ac] system_call+0x5c/0x68
      
      Fixes: de78a9c4 ("powerpc: Add a framework for Kernel Userspace Access Protection")
      Cc: stable@vger.kernel.org # v5.2+
      Reported-by: syzbot+e808452bad7c375cbee6@syzkaller-ppc64.appspotmail.com
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Link: https://lore.kernel.org/r/20200207122145.11928-1-mpe@ellerman.id.au
      9dc086f1
    • Lorenzo Bianconi's avatar
      mt76: mt7615: fix max_nss in mt7615_eeprom_parse_hw_cap · d08f3010
      Lorenzo Bianconi authored
      Fix u8 cast reading max_nss from MT_TOP_STRAP_STA register in
      mt7615_eeprom_parse_hw_cap routine
      
      Fixes: acf5457f ("mt76: mt7615: read {tx,rx} mask from eeprom")
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      d08f3010
    • Linus Torvalds's avatar
      Merge tag 'fuse-fixes-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · f7571657
      Linus Torvalds authored
      Pull fuse fixes from Miklos Szeredi:
      
       - Fix a regression introduced in v5.1 that triggers WARNINGs for some
         fuse filesystems
      
       - Fix an xfstest failure
      
       - Allow overlayfs to be used on top of fuse/virtiofs
      
       - Code and documentation cleanups
      
      * tag 'fuse-fixes-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: use true,false for bool variable
        Documentation: filesystems: convert fuse to RST
        fuse: Support RENAME_WHITEOUT flag
        fuse: don't overflow LLONG_MAX with end offset
        fix up iter on short count in fuse_direct_io()
      f7571657
    • Linus Torvalds's avatar
      Merge tag 'gfs2-for-5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 175787e0
      Linus Torvalds authored
      Pull gfs2 fixes from Andreas Gruenbacher:
      
       - Fix a bug in Abhi Das's journal head lookup improvements that can
         cause a valid journal to be rejected.
      
       - Fix an O_SYNC write handling bug reported by Christoph Hellwig.
      
      * tag 'gfs2-for-5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: fix O_SYNC write handling
        gfs2: move setting current->backing_dev_info
        gfs2: fix gfs2_find_jhead that returns uninitialized jhead with seq 0
      175787e0
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.6-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux · 60ea27e9
      Linus Torvalds authored
      Pull orangefs fix from Mike Marshall:
       "Debugfs fix for orangefs.
      
        Vasliy Averin noticed that 'if seq_file .next function does not change
        position index, read after some lseek can generate unexpected output'
        and sent in this fix"
      
      * tag 'for-linus-5.6-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
        help_next should increase position index
      60ea27e9