1. 22 11月, 2022 1 次提交
  2. 03 10月, 2022 4 次提交
  3. 18 9月, 2022 1 次提交
  4. 14 7月, 2022 1 次提交
  5. 13 7月, 2022 1 次提交
  6. 12 7月, 2022 2 次提交
  7. 07 7月, 2022 1 次提交
  8. 06 7月, 2022 2 次提交
  9. 09 2月, 2022 2 次提交
  10. 21 1月, 2022 1 次提交
  11. 15 10月, 2021 1 次提交
  12. 28 9月, 2021 2 次提交
  13. 26 9月, 2021 1 次提交
  14. 19 9月, 2021 1 次提交
  15. 16 9月, 2021 1 次提交
  16. 29 8月, 2021 1 次提交
  17. 27 8月, 2021 1 次提交
  18. 25 8月, 2021 8 次提交
  19. 17 8月, 2021 2 次提交
  20. 02 8月, 2021 1 次提交
  21. 02 7月, 2021 3 次提交
  22. 23 6月, 2021 1 次提交
    • K
      octeontx2-af: Avoid field-overflowing memcpy() · ee8e7622
      Kees Cook 提交于
      In preparation for FORTIFY_SOURCE performing compile-time and run-time
      field bounds checking for memcpy(), memmove(), and memset(), avoid
      intentionally writing across neighboring fields.
      
      To avoid having memcpy() think a u64 "prof" is being written beyond,
      adjust the prof member type by adding struct nix_bandprof_s to the union
      to match the other structs. This silences the following future warning:
      
      In file included from ./include/linux/string.h:253,
                       from ./include/linux/bitmap.h:10,
                       from ./include/linux/cpumask.h:12,
                       from ./arch/x86/include/asm/cpumask.h:5,
                       from ./arch/x86/include/asm/msr.h:11,
                       from ./arch/x86/include/asm/processor.h:22,
                       from ./arch/x86/include/asm/timex.h:5,
                       from ./include/linux/timex.h:65,
                       from ./include/linux/time32.h:13,
                       from ./include/linux/time.h:60,
                       from ./include/linux/stat.h:19,
                       from ./include/linux/module.h:13,
                       from drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c:11:
      In function '__fortify_memcpy_chk',
          inlined from '__fortify_memcpy' at ./include/linux/fortify-string.h:310:2,
          inlined from 'rvu_nix_blk_aq_enq_inst' at drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c:910:5:
      ./include/linux/fortify-string.h:268:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); please use struct_group() [-Wattribute-warning]
        268 |    __write_overflow_field();
            |    ^~~~~~~~~~~~~~~~~~~~~~~~
      
      drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c:
      ...
                              else if (req->ctype == NIX_AQ_CTYPE_BANDPROF)
                                      memcpy(&rsp->prof, ctx,
                                             sizeof(struct nix_bandprof_s));
      ...
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Tested-by: Subbaraya Sundeep<sbhatta@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee8e7622
  23. 16 6月, 2021 1 次提交