]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: Fix the bug in memory access fixup code
authorAlan Kao <alankao@andestech.com>
Tue, 8 May 2018 02:59:33 +0000 (10:59 +0800)
committerPalmer Dabbelt <palmer@sifive.com>
Mon, 4 Jun 2018 20:33:31 +0000 (13:33 -0700)
commit30fe8bb93dabf07bde7c20d6ddcc4b2d7fb9bd46
tree3f48c0cd8ed6fc785005891225ff42169e5b7335
parentd618df40a378cfa3ecd4741315a7498707cc3c0f
riscv: Fix the bug in memory access fixup code

A piece of fixup code is currently shared by __copy_user and
__clear_user.  It first disables the access to user-space memory
and then returns the "n" argument, which represents #(bytes not processed).
However,__copy_user's "n" is in register a2, while __clear_user's in a1,
and thus it causes errors for programs like setdomainname02 testcase in LTP.

This patch fixes this issue by separating their fixup code and returning
the right value for the kernel to handle a relative fault properly.

Signed-off-by: Alan Kao <alankao@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Cc: Zong Li <zong@andestech.com>
Cc: Vincent Chen <vincentc@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/lib/uaccess.S