1. 08 11月, 2014 1 次提交
    • I
      misc: genwqe: check for error from get_user_pages_fast() · cf35d6e0
      Ian Abbott 提交于
      `genwqe_user_vmap()` calls `get_user_pages_fast()` and if the return
      value is less than the number of pages requested, it frees the pages and
      returns an error (`-EFAULT`).  However, it fails to consider a negative
      error return value from `get_user_pages_fast()`.  In that case, the test
      `if (rc < m->nr_pages)` will be false (due to promotion of `rc` to a
      large `unsigned int`) and the code will continue on to call
      `genwqe_map_pages()` with an invalid list of page pointers.  Fix it by
      bailing out if `get_user_pages_fast()` returns a negative error value.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Cc: <stable@vger.kernel.org> # 3.14.x # 3.15.x # 3.16.x # 3.17.x
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cf35d6e0
  2. 24 9月, 2014 2 次提交
  3. 10 7月, 2014 2 次提交
  4. 28 5月, 2014 1 次提交
  5. 26 4月, 2014 1 次提交
  6. 17 4月, 2014 1 次提交
  7. 21 12月, 2013 2 次提交
    • F
      GenWQE: Accidently casting to u32 where u64 is required · a45a0258
      Frank Haverkamp 提交于
      Fix a casting to u32 where u64 would be appropriate.
      The bad casting made the driver unusable.
      Signed-off-by: NFrank Haverkamp <haver@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a45a0258
    • F
      GenWQE: Fix endian issues detected by sparse · 58d66ce7
      Frank Haverkamp 提交于
      Fengguang Wu used CF=-D__CHECK_ENDIAN__ to check the GenWQE driver for
      endian issues. Sparse found a couple of those. Most of them were caused
      by not correctly handling __be64/32 and __u64/32. Those I was able to
      fix with appropriate castings.
      
      One more serious issue was the ATS entry in struct genwqe_ddcb_cmd.
      The kernel expected it in big-endian, but the type was defined __u64.
      I decided that it is better to keep the interface consistent using
      host endian byte-odering instead of having a mixture. With this change
      the kernel likes to see host endian byte order for the ATS entry. That
      would have been an interface change, if someone would have used the
      driver already. Since this is not the case, I hope it is ok to fix it
      now.
      
      For the genqwe_readq/writeq/readl/writel functions I enforced the casts.
      
      It still complains, as far as I can see, about some copy_to/from_user()
      usages:
      
        CHECK   char-misc/drivers/misc/genwqe/card_dev.c
      char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
      char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
      char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
      char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
        CC [M]  drivers/misc/genwqe/card_dev.o
        CHECK   char-misc/drivers/misc/genwqe/card_ddcb.c
      char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
      char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
      char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
        CC [M]  drivers/misc/genwqe/card_ddcb.o
        LD [M]  drivers/misc/genwqe/genwqe_card.o
      
      I appreciate some help from you to figure out what is causig those, and
      making a proposal how to fix them.
      
      I included the missing header file to fix the
      implicit-function-declaration warning when using dynamic_hex_dump.
      Signed-off-by: NFrank Haverkamp <haver@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      58d66ce7
  8. 19 12月, 2013 1 次提交