1. 02 Aug, 2020 9 commits
    • Tsang-Shian Lin's avatar
      rtw88: fix LDPC field for RA info · ae44fa99
      Tsang-Shian Lin authored
      Convert the type of LDPC field to boolen because
      LDPC field of RA info H2C command to firmware
      is only one bit.
      
      Fixes: e3037485 ("rtw88: new Realtek 802.11ac driver")
      Signed-off-by: default avatarTsang-Shian Lin <thlin@realtek.com>
      Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200717064937.27966-2-yhchuang@realtek.com
      ae44fa99
    • Christophe JAILLET's avatar
      prism54: switch from 'pci_' to 'dma_' API · 84d47961
      Christophe JAILLET authored
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below and has been
      hand modified to replace GFP_ with a correct flag.
      It has been compile tested.
      
      When memory is allocated in 'islpci_alloc_memory()' (islpci_dev.c),
      GFP_KERNEL can be used because it is only called from a probe function
      and no spin_lock is taken in the between.
      
      The call chain is:
         prism54_probe                   (probe function, in 'islpci_hotplug.c')
            --> islpci_setup             (in 'islpci_dev.c')
               --> islpci_alloc_memory   (in 'islpci_dev.c')
      
      @@
      @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@
      @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@
      @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@
      @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200722104534.30760-1-christophe.jaillet@wanadoo.fr
      84d47961
    • Vaibhav Gupta's avatar
      prism54: islpci_hotplug: use generic power management · 81cf72b7
      Vaibhav Gupta authored
      Drivers using legacy power management .suspen()/.resume() callbacks
      have to manage PCI states and device's PM states themselves. They also
      need to take care of standard configuration registers.
      
      Switch to generic power management framework using a single
      "struct dev_pm_ops" variable to take the unnecessary load from the driver.
      This also avoids the need for the driver to directly call most of the PCI
      helper functions and device power state control functions as through
      the generic framework, PCI Core takes care of the necessary operations,
      and drivers are required to do only device-specific jobs.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200721125514.145607-1-vaibhavgupta40@gmail.com
      81cf72b7
    • Alexander A. Klimov's avatar
      prism54: Replace HTTP links with HTTPS ones · 87b589a1
      Alexander A. Klimov authored
      Rationale:
      Reduces attack surface on kernel devs opening the links for MITM
      as HTTPS traffic is much harder to manipulate.
      
      Deterministic algorithm:
      For each file:
        If not .svg:
          For each line:
            If doesn't contain `\bxmlns\b`:
              For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
      	  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
                  If both the HTTP and HTTPS versions
                  return 200 OK and serve the same content:
                    Replace HTTP with HTTPS.
      Signed-off-by: default avatarAlexander A. Klimov <grandmaster@al2klimov.de>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200719121224.58581-1-grandmaster@al2klimov.de
      87b589a1
    • Christophe JAILLET's avatar
      p54: switch from 'pci_' to 'dma_' API · ba78405e
      Christophe JAILLET authored
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below and has been
      hand modified to replace GFP_ with a correct flag.
      It has been compile tested.
      
      When memory is allocated in 'p54p_probe()', GFP_KERNEL can be used because
      it is the probe function and no spin_lock is taken in the between.
      
      @@
      @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@
      @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@
      @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@
      @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200722102707.27486-1-christophe.jaillet@wanadoo.fr
      ba78405e
    • Xu Wang's avatar
      mwifiex: 11n_rxreorder: Remove unnecessary cast in kfree() · 61494648
      Xu Wang authored
      Remove unnecassary casts in the argument to kfree.
      Signed-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200727020405.8476-1-vulab@iscas.ac.cn
      61494648
    • Andy Shevchenko's avatar
    • Colin Ian King's avatar
      rtlwifi: btcoex: remove redundant initialization of variables ant_num and single_ant_path · 56b06d4d
      Colin Ian King authored
      The variables ant_num and single_ant_path are being initialized with a
      value that is never read and are being updated later with a new value.
      The initializations are redundant and can be removed.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Acked-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200723163214.995226-1-colin.king@canonical.com
      56b06d4d
    • Kalle Valo's avatar
      Merge tag 'mt76-for-kvalo-2020-07-21' of https://github.com/nbd168/wireless · 98f80899
      Kalle Valo authored
      mt76 patches for 5.9
      
      * locking fixes
      * tx queue mapping fixes for 7615/7915
      * ARP filter offload for 7663
      * runtime power management for 7663
      * testmode support for mfg calibration
      * memory leak fixes
      * support for more channels
      
      # gpg: Signature made Tue 21 Jul 2020 08:01:28 PM EEST using DSA key ID 02A76EF5
      # gpg: Good signature from "Felix Fietkau <nbd@nbd.name>"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 75D1 1A7D 91A7 710F 4900  42EF D77D 141D 02A7 6EF5
      98f80899
  2. 25 Jul, 2020 20 commits
  3. 24 Jul, 2020 11 commits
    • Eelco Chaudron's avatar
      net: openvswitch: fixes potential deadlock in dp cleanup code · a65878d6
      Eelco Chaudron authored
      The previous patch introduced a deadlock, this patch fixes it by making
      sure the work is canceled without holding the global ovs lock. This is
      done by moving the reorder processing one layer up to the netns level.
      
      Fixes: eac87c41 ("net: openvswitch: reorder masks array based on usage")
      Reported-by: syzbot+2c4ff3614695f75ce26c@syzkaller.appspotmail.com
      Reported-by: syzbot+bad6507e5db05017b008@syzkaller.appspotmail.com
      Reviewed-by: default avatarPaolo <pabeni@redhat.com>
      Signed-off-by: default avatarEelco Chaudron <echaudro@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a65878d6
    • Christoph Hellwig's avatar
      sctp: fix slab-out-of-bounds in SCTP_DELAYED_SACK processing · dfd3d526
      Christoph Hellwig authored
      This sockopt accepts two kinds of parameters, using struct
      sctp_sack_info and struct sctp_assoc_value. The mentioned commit didn't
      notice an implicit cast from the smaller (latter) struct to the bigger
      one (former) when copying the data from the user space, which now leads
      to an attempt to write beyond the buffer (because it assumes the storing
      buffer is bigger than the parameter itself).
      
      Fix it by allocating a sctp_sack_info on stack and filling it out based
      on the small struct for the compat case.
      
      Changelog stole from an earlier patch from Marcelo Ricardo Leitner.
      
      Fixes: ebb25def ("sctp: pass a kernel pointer to sctp_setsockopt_delayed_ack")
      Reported-by: syzbot+0e4699d000d8b874d8dc@syzkaller.appspotmail.com
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dfd3d526
    • David S. Miller's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · aab99b62
      David S. Miller authored
      Tony Nguyen says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2020-07-23
      
      This series contains updates to ice driver only.
      
      Jake refactors ice_discover_caps() to reduce the number of AdminQ calls
      made. Splits ice_parse_caps() to separate functions to update function
      and device capabilities separately to allow for updating outside of
      initialization.
      
      Akeem adds power management support.
      
      Paul G refactors FC and FEC code to aid in restoring of PHY settings
      on media insertion. Implements lenient mode and link override support.
      Adds link debug info and formats existing debug info to be more
      readable. Adds support to check and report additional autoneg
      capabilities. Implements the capability to detect media cage in order to
      differentiate AUI types as Direct Attach or backplane.
      
      Bruce implements Total Port Shutdown for devices that support it.
      
      Lev renames low_power_ctrl field to lower_power_ctrl_an to be more
      descriptive of the field.
      
      Doug reports AOC types as media type fiber.
      
      Paul S adds code to handle 1G SGMII PHY type.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aab99b62
    • David S. Miller's avatar
      mISDN: Don't try to print a sockptr_t from debug logging code. · 2d6be17d
      David S. Miller authored
      drivers/isdn/mISDN/socket.c: In function ‘data_sock_setsockopt’:
      ./include/linux/kern_levels.h:5:18: warning: format ‘%p’ expects argument of type ‘void *’, but argument 6 has type ‘sockptr_t’ [-Wformat=]
          5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
            |                  ^~~~~~
      ./include/linux/kern_levels.h:15:20: note: in expansion of macro ‘KERN_SOH’
         15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
            |                    ^~~~~~~~
      drivers/isdn/mISDN/socket.c:410:10: note: in expansion of macro ‘KERN_DEBUG’
        410 |   printk(KERN_DEBUG "%s(%p, %d, %x, %p, %d)\n", __func__, sock,
            |          ^~~~~~~~~~
      drivers/isdn/mISDN/socket.c:410:38: note: format string is defined here
        410 |   printk(KERN_DEBUG "%s(%p, %d, %x, %p, %d)\n", __func__, sock,
            |                                     ~^
            |                                      |
            |                                      void *
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d6be17d
    • David S. Miller's avatar
      Merge branch 'get-rid-of-the-address_space-override-in-setsockopt-v2' · 7c4c2416
      David S. Miller authored
      Christoph Hellwig says:
      
      ====================
      get rid of the address_space override in setsockopt v2
      
      setsockopt is the last place in architecture-independ code that still
      uses set_fs to force the uaccess routines to operate on kernel pointers.
      
      This series adds a new sockptr_t type that can contained either a kernel
      or user pointer, and which has accessors that do the right thing, and
      then uses it for setsockopt, starting by refactoring some low-level
      helpers and moving them over to it before finally doing the main
      setsockopt method.
      
      Note that apparently the eBPF selftests do not even cover this path, so
      the series has been tested with a testing patch that always copies the
      data first and passes a kernel pointer.  This is something that works for
      most common sockopts (and is something that the ePBF support relies on),
      but unfortunately in various corner cases we either don't use the passed
      in length, or in one case actually copy data back from setsockopt, or in
      case of bpfilter straight out do not work with kernel pointers at all.
      
      Against net-next/master.
      
      Changes since v1:
       - check that users don't pass in kernel addresses
       - more bpfilter cleanups
       - cosmetic mptcp tweak
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c4c2416
    • Christoph Hellwig's avatar
      net: optimize the sockptr_t for unified kernel/user address spaces · 6d04fe15
      Christoph Hellwig authored
      For architectures like x86 and arm64 we don't need the separate bit to
      indicate that a pointer is a kernel pointer as the address spaces are
      unified.  That way the sockptr_t can be reduced to a union of two
      pointers, which leads to nicer calling conventions.
      
      The only caveat is that we need to check that users don't pass in kernel
      address and thus gain access to kernel memory.  Thus the USER_SOCKPTR
      helper is replaced with a init_user_sockptr function that does this check
      and returns an error if it fails.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d04fe15
    • Christoph Hellwig's avatar
      net: pass a sockptr_t into ->setsockopt · a7b75c5a
      Christoph Hellwig authored
      Rework the remaining setsockopt code to pass a sockptr_t instead of a
      plain user pointer.  This removes the last remaining set_fs(KERNEL_DS)
      outside of architecture specific code.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: Stefan Schmidt <stefan@datenfreihafen.org> [ieee802154]
      Acked-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7b75c5a
    • Christoph Hellwig's avatar
      net/tcp: switch do_tcp_setsockopt to sockptr_t · d38d2b00
      Christoph Hellwig authored
      Pass a sockptr_t to prepare for set_fs-less handling of the kernel
      pointer from bpf-cgroup.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d38d2b00
    • Christoph Hellwig's avatar
      net/tcp: switch ->md5_parse to sockptr_t · d4c19c49
      Christoph Hellwig authored
      Pass a sockptr_t to prepare for set_fs-less handling of the kernel
      pointer from bpf-cgroup.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4c19c49
    • Christoph Hellwig's avatar
      net/udp: switch udp_lib_setsockopt to sockptr_t · 91ac1cca
      Christoph Hellwig authored
      Pass a sockptr_t to prepare for set_fs-less handling of the kernel
      pointer from bpf-cgroup.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      91ac1cca
    • Christoph Hellwig's avatar
      net/ipv6: switch do_ipv6_setsockopt to sockptr_t · 894cfbc0
      Christoph Hellwig authored
      Pass a sockptr_t to prepare for set_fs-less handling of the kernel
      pointer from bpf-cgroup.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      894cfbc0