1. 14 Oct, 2019 3 commits
    • Max Filippov's avatar
      xtensa: fix type conversion in __get_user_[no]check · c9c63f3c
      Max Filippov authored
      __get_user_[no]check uses temporary buffer of type long to store result
      of __get_user_size and do sign extension on it when necessary. This
      doesn't work correctly for 64-bit data. Fix it by moving temporary
      buffer/sign extension logic to __get_user_asm.
      
      Don't do assignment of __get_user_bad result to (x) as it may not always
      be integer-compatible now and issue warning even when it's going to be
      optimized. Instead do (x) = 0; and call __get_user_bad separately.
      
      Zero initialize __x in __get_user_asm and use '+' constraint for its
      assembly argument, so that its value is preserved in error cases. This
      may add at most 1 cycle to the fast path, but saves an instruction and
      two padding bytes in the fixup section for each use of this macro and
      works for both misaligned store and store exception.
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      c9c63f3c
    • Max Filippov's avatar
      xtensa: clean up assembly arguments in uaccess macros · c0437642
      Max Filippov authored
      Numeric assembly arguments are hard to understand and assembly code that
      uses them is hard to modify. Use named arguments in __check_align_*,
      __get_user_asm and __put_user_asm. Modify macro parameter names so that
      they don't affect argument names. Use '+' constraint for the [err]
      argument instead of having it as both input and output.
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      c0437642
    • Al Viro's avatar
      xtensa: fix {get,put}_user() for 64bit values · 6595d144
      Al Viro authored
      First of all, on short copies __copy_{to,from}_user() return the amount
      of bytes left uncopied, *not* -EFAULT.  get_user() and put_user() are
      expected to return -EFAULT on failure.
      
      Another problem is get_user(v32, (__u64 __user *)p); that should
      fetch 64bit value and the assign it to v32, truncating it in process.
      Current code, OTOH, reads 8 bytes of data and stores them at the
      address of v32, stomping on the 4 bytes that follow v32 itself.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      6595d144
  2. 13 Oct, 2019 16 commits
  3. 12 Oct, 2019 21 commits