1. 10 11月, 2020 1 次提交
    • A
      firmware: xilinx: fix out-of-bounds access · f3217d6f
      Arnd Bergmann 提交于
      The zynqmp_pm_set_suspend_mode() and zynqmp_pm_get_trustzone_version()
      functions pass values as api_id into zynqmp_pm_invoke_fn
      that are beyond PM_API_MAX, resulting in an out-of-bounds access:
      
      drivers/firmware/xilinx/zynqmp.c: In function 'zynqmp_pm_set_suspend_mode':
      drivers/firmware/xilinx/zynqmp.c:150:24: warning: array subscript 2562 is above array bounds of 'u32[64]' {aka 'unsigned int[64]'} [-Warray-bounds]
        150 |  if (zynqmp_pm_features[api_id] != PM_FEATURE_UNCHECKED)
            |      ~~~~~~~~~~~~~~~~~~^~~~~~~~
      drivers/firmware/xilinx/zynqmp.c:28:12: note: while referencing 'zynqmp_pm_features'
         28 | static u32 zynqmp_pm_features[PM_API_MAX];
            |            ^~~~~~~~~~~~~~~~~~
      
      Replace the resulting undefined behavior with an error return.
      This may break some things that happen to work at the moment
      but seems better than randomly overwriting kernel data.
      
      I assume we need additional fixes for the two functions that now
      return an error.
      
      Fixes: 76582671 ("firmware: xilinx: Add Zynqmp firmware driver")
      Fixes: e178df31 ("firmware: xilinx: Implement ZynqMP power management APIs")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20201026155449.3703142-1-arnd@kernel.org
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f3217d6f
  2. 15 5月, 2020 1 次提交
  3. 04 5月, 2020 1 次提交
  4. 28 4月, 2020 25 次提交
  5. 24 3月, 2020 2 次提交
  6. 28 2月, 2020 1 次提交
  7. 24 1月, 2020 1 次提交
  8. 12 12月, 2019 1 次提交
  9. 16 10月, 2019 1 次提交
  10. 15 4月, 2019 1 次提交
  11. 18 3月, 2019 1 次提交
  12. 12 2月, 2019 3 次提交
  13. 05 2月, 2019 1 次提交