1. 04 Dec, 2015 3 commits
    • Wang, Rui Y's avatar
      crypto: ghash-clmulni - Fix load failure · 3a020a72
      Wang, Rui Y authored
      ghash_clmulni_intel fails to load on Linux 4.3+ with the following message:
      "modprobe: ERROR: could not insert 'ghash_clmulni_intel': Invalid argument"
      
      After 8996eafd ("crypto: ahash - ensure statesize is non-zero") all ahash
      drivers are required to implement import()/export(), and must have a non-
      zero statesize.
      
      This patch has been tested with the algif_hash interface. The calculated
      digest values, after several rounds of import()s and export()s, match those
      calculated by tcrypt.
      Signed-off-by: default avatarRui Wang <rui.y.wang@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      3a020a72
    • Heiko Stuebner's avatar
      crypto: rockchip - fix possible deadlock · ac7c8e6b
      Heiko Stuebner authored
      Lockdep warns about a possible deadlock resulting from the use of regular
      spin_locks:
      
      =================================
      [ INFO: inconsistent lock state ]
      4.4.0-rc2+ #2724 Not tainted
      ---------------------------------
      inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
      ksoftirqd/0/3 [HC0[0]:SC1[1]:HE1:SE0] takes:
      (&(&crypto_info->lock)->rlock){+.?...}, at: [<bf14a65c>] rk_crypto_tasklet_cb+0x24/0xb4 [rk_crypto]
      {SOFTIRQ-ON-W} state was registered at:
        [<c007f4ac>] lock_acquire+0x178/0x218
        [<c0759bac>] _raw_spin_lock+0x54/0x64
        [<bf14af88>] rk_handle_req+0x7c/0xbc [rk_crypto]
        [<bf14b040>] rk_des_ecb_encrypt+0x2c/0x30 [rk_crypto]
        [<bf14b05c>] rk_aes_ecb_encrypt+0x18/0x1c [rk_crypto]
        [<c028c820>] skcipher_encrypt_ablkcipher+0x64/0x68
        [<c0290770>] __test_skcipher+0x2a8/0x8dc
        [<c0292e94>] test_skcipher+0x38/0xc4
        [<c0292fb0>] alg_test_skcipher+0x90/0xb0
        [<c0292158>] alg_test+0x1e8/0x280
        [<c028f6f4>] cryptomgr_test+0x34/0x54
        [<c004bbe8>] kthread+0xf4/0x10c
        [<c0010010>] ret_from_fork+0x14/0x24
      irq event stamp: 10672
      hardirqs last  enabled at (10672): [<c002fac8>] tasklet_action+0x48/0x104
      hardirqs last disabled at (10671): [<c002faa0>] tasklet_action+0x20/0x104
      softirqs last  enabled at (10658): [<c002ef84>] __do_softirq+0x358/0x49c
      softirqs last disabled at (10669): [<c002f108>] run_ksoftirqd+0x40/0x80
      
      other info that might help us debug this:
      Possible unsafe locking scenario:
      
          CPU0
          ----
        lock(&(&crypto_info->lock)->rlock);
        <Interrupt>
          lock(&(&crypto_info->lock)->rlock);
      
       *** DEADLOCK ***
      
      Fix this by moving to irq-disabling spinlocks.
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ac7c8e6b
    • Jiri Slaby's avatar
      hwrng: core - sleep interruptible in read · 1ab87298
      Jiri Slaby authored
      hwrng kthread can be waiting via hwrng_fillfn for some data from a rng
      like virtio-rng:
      hwrng           D ffff880093e17798     0   382      2 0x00000000
      ...
      Call Trace:
       [<ffffffff817339c6>] wait_for_completion_killable+0x96/0x210
       [<ffffffffa00aa1b7>] virtio_read+0x57/0xf0 [virtio_rng]
       [<ffffffff814f4a35>] hwrng_fillfn+0x75/0x130
       [<ffffffff810aa243>] kthread+0xf3/0x110
      
      And when some user program tries to read the /dev node in this state,
      we get:
      rngd            D ffff880093e17798     0   762      1 0x00000004
      ...
      Call Trace:
       [<ffffffff817351ac>] mutex_lock_nested+0x15c/0x3e0
       [<ffffffff814f478e>] rng_dev_read+0x6e/0x240
       [<ffffffff81231958>] __vfs_read+0x28/0xe0
       [<ffffffff81232393>] vfs_read+0x83/0x130
      
      And this is indeed unkillable. So use mutex_lock_interruptible
      instead of mutex_lock in rng_dev_read and exit immediatelly when
      interrupted. And possibly return already read data, if any (as POSIX
      allows).
      
      v2: use ERESTARTSYS instead of EINTR
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: <linux-crypto@vger.kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      1ab87298
  2. 27 Nov, 2015 3 commits
  3. 24 Nov, 2015 3 commits
  4. 23 Nov, 2015 8 commits
  5. 17 Nov, 2015 19 commits
  6. 16 Nov, 2015 3 commits
  7. 15 Nov, 2015 1 commit
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0ca9b676
      Linus Torvalds authored
      Pull perf updates from Thomas Gleixner:
       "Mostly updates to the perf tool plus two fixes to the kernel core code:
      
         - Handle tracepoint filters correctly for inherited events (Peter
           Zijlstra)
      
         - Prevent a deadlock in perf_lock_task_context (Paul McKenney)
      
         - Add missing newlines to some pr_err() calls (Arnaldo Carvalho de
           Melo)
      
         - Print full source file paths when using 'perf annotate --print-line
           --full-paths' (Michael Petlan)
      
         - Fix 'perf probe -d' when just one out of uprobes and kprobes is
           enabled (Wang Nan)
      
         - Add compiler.h to list.h to fix 'make perf-tar-src-pkg' generated
           tarballs, i.e. out of tree building (Arnaldo Carvalho de Melo)
      
         - Add the llvm-src-base.c and llvm-src-kbuild.c files, generated by
           the 'perf test' LLVM entries, when running it in-tree, to
           .gitignore (Yunlong Song)
      
         - libbpf error reporting improvements, using a strerror interface to
           more precisely tell the user about problems with the provided
           scriptlet, be it in C or as a ready made object file (Wang Nan)
      
         - Do not be case sensitive when searching for matching 'perf test'
           entries (Arnaldo Carvalho de Melo)
      
         - Inform the user about objdump failures in 'perf annotate' (Andi
           Kleen)
      
         - Improve the LLVM 'perf test' entry, introduce a new ones for BPF
           and kbuild tests to check the environment used by clang to compile
           .c scriptlets (Wang Nan)"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (32 commits)
        perf/x86/intel/rapl: Remove the unused RAPL_EVENT_DESC() macro
        tools include: Add compiler.h to list.h
        perf probe: Verify parameters in two functions
        perf session: Add missing newlines to some pr_err() calls
        perf annotate: Support full source file paths for srcline fix
        perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore
        perf: Fix inherited events vs. tracepoint filters
        perf: Disable IRQs across RCU RS CS that acquires scheduler lock
        perf test: Do not be case sensitive when searching for matching tests
        perf test: Add 'perf test BPF'
        perf test: Enhance the LLVM tests: add kbuild test
        perf test: Enhance the LLVM test: update basic BPF test program
        perf bpf: Improve BPF related error messages
        perf tools: Make fetch_kernel_version() publicly available
        bpf tools: Add new API bpf_object__get_kversion()
        bpf tools: Improve libbpf error reporting
        perf probe: Cleanup find_perf_probe_point_from_map to reduce redundancy
        perf annotate: Inform the user about objdump failures in --stdio
        perf stat: Make stat options global
        perf sched latency: Fix thread pid reuse issue
        ...
      0ca9b676