1. 01 Dec, 2023 6 commits
    • Gustavo A. R. Silva's avatar
      crypto: p10-aes-gcm - Avoid -Wstringop-overflow warnings · aaa03fdb
      Gustavo A. R. Silva authored
      The compiler doesn't know that `32` is an offset into the Hash table:
      
       56 struct Hash_ctx {
       57         u8 H[16];       /* subkey */
       58         u8 Htable[256]; /* Xi, Hash table(offset 32) */
       59 };
      
      So, it legitimately complains about a potential out-of-bounds issue
      if `256 bytes` are accessed in `htable` (this implies going
      `32 bytes` beyond the boundaries of `Htable`):
      
      arch/powerpc/crypto/aes-gcm-p10-glue.c: In function 'gcmp10_init':
      arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224 [-Werror=stringop-overflow=]
        120 |         gcm_init_htable(hash->Htable+32, hash->H);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: note: referencing argument 1 of type 'unsigned char[256]'
      arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: note: referencing argument 2 of type 'unsigned char[16]'
      arch/powerpc/crypto/aes-gcm-p10-glue.c:40:17: note: in a call to function 'gcm_init_htable'
         40 | asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]);
            |                 ^~~~~~~~~~~~~~~
      
      Address this by avoiding specifying the size of `htable` in the function
      prototype; and just for consistency, do the same for parameter `Xi`.
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Closes: https://lore.kernel.org/linux-next/20231121131903.68a37932@canb.auug.org.au/Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      aaa03fdb
    • Damian Muszynski's avatar
      crypto: qat - add sysfs_added flag for rate limiting · d71fdd0f
      Damian Muszynski authored
      The qat_rl sysfs attribute group is registered within the adf_dev_start()
      function, alongside other driver components.
      If any of the functions preceding the group registration fails,
      the adf_dev_start() function returns, and the caller, to undo the
      operation, invokes adf_dev_stop() followed by adf_dev_shutdown().
      However, the current flow lacks information about whether the
      registration of the qat_rl attribute group was successful or not.
      
      In cases where this condition is encountered, an error similar to
      the following might be reported:
      
          4xxx 0000:6b:00.0: Starting device qat_dev0
          4xxx 0000:6b:00.0: qat_dev0 started 9 acceleration engines
          4xxx 0000:6b:00.0: Failed to send init message
          4xxx 0000:6b:00.0: Failed to start device qat_dev0
          sysfs group 'qat_rl' not found for kobject '0000:6b:00.0'
          ...
          sysfs_remove_groups+0x2d/0x50
          adf_sysfs_rl_rm+0x44/0x70 [intel_qat]
          adf_rl_stop+0x2d/0xb0 [intel_qat]
          adf_dev_stop+0x33/0x1d0 [intel_qat]
          adf_dev_down+0xf1/0x150 [intel_qat]
          ...
          4xxx 0000:6b:00.0: qat_dev0 stopped 9 acceleration engines
          4xxx 0000:6b:00.0: Resetting device qat_dev0
      
      To prevent attempting to remove attributes from a group that has not
      been added yet, a flag named 'sysfs_added' is introduced. This flag
      is set to true upon the successful registration of the attribute group.
      
      Fixes: d9fb8408 ("crypto: qat - add rate limiting feature to qat_4xxx")
      Signed-off-by: default avatarDamian Muszynski <damian.muszynski@intel.com>
      Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
      Reviewed-by: default avatarAhsan Atta <ahsan.atta@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      d71fdd0f
    • Damian Muszynski's avatar
      crypto: qat - add sysfs_added flag for ras · 65089000
      Damian Muszynski authored
      The qat_ras sysfs attribute group is registered within the
      adf_dev_start() function, alongside other driver components.
      If any of the functions preceding the group registration fails,
      the adf_dev_start() function returns, and the caller, to undo the
      operation, invokes adf_dev_stop() followed by adf_dev_shutdown().
      However, the current flow lacks information about whether the
      registration of the qat_ras attribute group was successful or not.
      
      In cases where this condition is encountered, an error similar to
      the following might be reported:
      
          4xxx 0000:6b:00.0: Starting device qat_dev0
          4xxx 0000:6b:00.0: qat_dev0 started 9 acceleration engines
          4xxx 0000:6b:00.0: Failed to send init message
          4xxx 0000:6b:00.0: Failed to start device qat_dev0
          sysfs group 'qat_ras' not found for kobject '0000:6b:00.0'
          ...
          sysfs_remove_groups+0x29/0x50
          adf_sysfs_stop_ras+0x4b/0x80 [intel_qat]
          adf_dev_stop+0x43/0x1d0 [intel_qat]
          adf_dev_down+0x4b/0x150 [intel_qat]
          ...
          4xxx 0000:6b:00.0: qat_dev0 stopped 9 acceleration engines
          4xxx 0000:6b:00.0: Resetting device qat_dev0
      
      To prevent attempting to remove attributes from a group that has not
      been added yet, a flag named 'sysfs_added' is introduced. This flag
      is set to true upon the successful registration of the attribute group.
      
      Fixes: 532d7f6b ("crypto: qat - add error counters")
      Signed-off-by: default avatarDamian Muszynski <damian.muszynski@intel.com>
      Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
      Reviewed-by: default avatarAhsan Atta <ahsan.atta@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      65089000
    • Jia Jie Ho's avatar
      hwrng: starfive - Fix dev_err_probe return error · 2d37b364
      Jia Jie Ho authored
      Current dev_err_probe will return 0 instead of proper error code if
      driver failed to get irq number. Fix the return err code.
      Signed-off-by: default avatarJia Jie Ho <jiajie.ho@starfivetech.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <error27@gmail.com>
      Closes: https://lore.kernel.org/r/202311160649.3GhKCfhd-lkp@intel.com/Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      2d37b364
    • Gonglei (Arei)'s avatar
      crypto: virtio - Handle dataq logic with tasklet · fed93fb6
      Gonglei (Arei) authored
      Doing ipsec produces a spinlock recursion warning.
      This is due to crypto_finalize_request() being called in the upper half.
      Move virtual data queue processing of virtio-crypto driver to tasklet.
      
      Fixes: dbaf0624 ("crypto: add virtio-crypto driver")
      Reported-by: default avatarHalil Pasic <pasic@linux.ibm.com>
      Signed-off-by: default avatarwangyangxin <wangyangxin1@huawei.com>
      Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      fed93fb6
    • Jia Jie Ho's avatar
      crypto: starfive - Pad adata with zeroes · 8a0d929b
      Jia Jie Ho authored
      Aad requires padding with zeroes up to 15 bytes in some cases. This
      patch increases the allocated buffer size for aad and prevents the
      driver accessing uninitialized memory region.
      
      v1->v2: Specify reason for alloc size change in descriptions.
      Signed-off-by: default avatarJia Jie Ho <jiajie.ho@starfivetech.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      8a0d929b
  2. 24 Nov, 2023 3 commits
  3. 17 Nov, 2023 22 commits
  4. 13 Nov, 2023 1 commit
  5. 12 Nov, 2023 5 commits
  6. 11 Nov, 2023 1 commit
    • Linus Torvalds's avatar
      Merge tag 'probes-fixes-v6.7-rc1' of... · 3ca112b7
      Linus Torvalds authored
      Merge tag 'probes-fixes-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
      
      Pull probes fixes from Masami Hiramatsu:
      
       - Documentation update: Add a note about argument and return value
         fetching is the best effort because it depends on the type.
      
       - objpool: Fix to make internal global variables static in
         test_objpool.c.
      
       - kprobes: Unify kprobes_exceptions_nofify() prototypes. There are the
         same prototypes in asm/kprobes.h for some architectures, but some of
         them are missing the prototype and it causes a warning. So move the
         prototype into linux/kprobes.h.
      
       - tracing: Fix to check the tracepoint event and return event at
         parsing stage. The tracepoint event doesn't support %return but if
         $retval exists, it will be converted to %return silently. This finds
         that case and rejects it.
      
       - tracing: Fix the order of the descriptions about the parameters of
         __kprobe_event_gen_cmd_start() to be consistent with the argument
         list of the function.
      
      * tag 'probes-fixes-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing/kprobes: Fix the order of argument descriptions
        tracing: fprobe-event: Fix to check tracepoint event and return
        kprobes: unify kprobes_exceptions_nofify() prototypes
        lib: test_objpool: make global variables static
        Documentation: tracing: Add a note about argument and retval access
      3ca112b7
  7. 10 Nov, 2023 2 commits
    • Linus Torvalds's avatar
      Merge tag 'fbdev-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev · 18553507
      Linus Torvalds authored
      Pull fbdev fixes and cleanups from Helge Deller:
      
       - fix double free and resource leaks in imsttfb
      
       - lots of remove callback cleanups and section mismatch fixes in
         omapfb, amifb and atmel_lcdfb
      
       - error code fix and memparse simplification in omapfb
      
      * tag 'fbdev-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (31 commits)
        fbdev: fsl-diu-fb: mark wr_reg_wa() static
        fbdev: amifb: Convert to platform remove callback returning void
        fbdev: amifb: Mark driver struct with __refdata to prevent section mismatch warning
        fbdev: hyperv_fb: fix uninitialized local variable use
        fbdev: omapfb/tpd12s015: Convert to platform remove callback returning void
        fbdev: omapfb/tfp410: Convert to platform remove callback returning void
        fbdev: omapfb/sharp-ls037v7dw01: Convert to platform remove callback returning void
        fbdev: omapfb/opa362: Convert to platform remove callback returning void
        fbdev: omapfb/hdmi: Convert to platform remove callback returning void
        fbdev: omapfb/dvi: Convert to platform remove callback returning void
        fbdev: omapfb/dsi-cm: Convert to platform remove callback returning void
        fbdev: omapfb/dpi: Convert to platform remove callback returning void
        fbdev: omapfb/analog-tv: Convert to platform remove callback returning void
        fbdev: atmel_lcdfb: Convert to platform remove callback returning void
        fbdev: omapfb/tpd12s015: Don't put .remove() in .exit.text and drop suppress_bind_attrs
        fbdev: omapfb/tfp410: Don't put .remove() in .exit.text and drop suppress_bind_attrs
        fbdev: omapfb/sharp-ls037v7dw01: Don't put .remove() in .exit.text and drop suppress_bind_attrs
        fbdev: omapfb/opa362: Don't put .remove() in .exit.text and drop suppress_bind_attrs
        fbdev: omapfb/hdmi: Don't put .remove() in .exit.text and drop suppress_bind_attrs
        fbdev: omapfb/dvi: Don't put .remove() in .exit.text and drop suppress_bind_attrs
        ...
      18553507
    • Yujie Liu's avatar
      tracing/kprobes: Fix the order of argument descriptions · f032c53b
      Yujie Liu authored
      The order of descriptions should be consistent with the argument list of
      the function, so "kretprobe" should be the second one.
      
      int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe,
                                       const char *name, const char *loc, ...)
      
      Link: https://lore.kernel.org/all/20231031041305.3363712-1-yujie.liu@intel.com/
      
      Fixes: 2a588dd1 ("tracing: Add kprobe event command generation functions")
      Suggested-by: default avatarMukesh Ojha <quic_mojha@quicinc.com>
      Signed-off-by: default avatarYujie Liu <yujie.liu@intel.com>
      Reviewed-by: default avatarMukesh Ojha <quic_mojha@quicinc.com>
      Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      f032c53b