1. 22 Aug, 2019 19 commits
  2. 15 Aug, 2019 18 commits
  3. 09 Aug, 2019 3 commits
    • Daniel Jordan's avatar
      padata: initialize pd->cpu with effective cpumask · ec9c7d19
      Daniel Jordan authored
      Exercising CPU hotplug on a 5.2 kernel with recent padata fixes from
      cryptodev-2.6.git in an 8-CPU kvm guest...
      
          # modprobe tcrypt alg="pcrypt(rfc4106(gcm(aes)))" type=3
          # echo 0 > /sys/devices/system/cpu/cpu1/online
          # echo c > /sys/kernel/pcrypt/pencrypt/parallel_cpumask
          # modprobe tcrypt mode=215
      
      ...caused the following crash:
      
          BUG: kernel NULL pointer dereference, address: 0000000000000000
          #PF: supervisor read access in kernel mode
          #PF: error_code(0x0000) - not-present page
          PGD 0 P4D 0
          Oops: 0000 [#1] SMP PTI
          CPU: 2 PID: 134 Comm: kworker/2:2 Not tainted 5.2.0-padata-base+ #7
          Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-<snip>
          Workqueue: pencrypt padata_parallel_worker
          RIP: 0010:padata_reorder+0xcb/0x180
          ...
          Call Trace:
           padata_do_serial+0x57/0x60
           pcrypt_aead_enc+0x3a/0x50 [pcrypt]
           padata_parallel_worker+0x9b/0xe0
           process_one_work+0x1b5/0x3f0
           worker_thread+0x4a/0x3c0
           ...
      
      In padata_alloc_pd, pd->cpu is set using the user-supplied cpumask
      instead of the effective cpumask, and in this case cpumask_first picked
      an offline CPU.
      
      The offline CPU's reorder->list.next is NULL in padata_reorder because
      the list wasn't initialized in padata_init_pqueues, which only operates
      on CPUs in the effective mask.
      
      Fix by using the effective mask in padata_alloc_pd.
      
      Fixes: 6fc4dbcf ("padata: Replace delayed timer with immediate workqueue in padata_reorder")
      Signed-off-by: default avatarDaniel Jordan <daniel.m.jordan@oracle.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: linux-crypto@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ec9c7d19
    • Bjorn Helgaas's avatar
      crypto: ccp - Remove unnecessary linux/pci.h include · 3a646b6e
      Bjorn Helgaas authored
      Remove unused includes of linux/pci.h.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarGary R Hook <gary.hook@amd.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      3a646b6e
    • Bjorn Helgaas's avatar
      crypto: ccp - Include DMA declarations explicitly · f6b0b78a
      Bjorn Helgaas authored
      ccp-dev.h uses dma_direction, which is defined in linux/dma-direction.h.
      Include that explicitly instead of relying on it being included via
      linux/pci.h, since ccp-dev.h requires nothing else from linux/pci.h.
      
      Similarly, ccp-dmaengine.c uses dma_get_mask(), which is defined in
      linux/dma-mapping.h, so include that explicitly since it requires nothing
      else from linux/pci.h.
      
      A future patch will remove the includes of linux/pci.h where it is not
      needed.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarGary R Hook <gary.hook@amd.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      f6b0b78a