]> git.baikalelectronics.ru Git - kernel.git/commit
parisc: Fix some apparent put_user() failures
authorHelge Deller <deller@gmx.de>
Sun, 13 Feb 2022 21:52:11 +0000 (22:52 +0100)
committerHelge Deller <deller@gmx.de>
Mon, 14 Feb 2022 11:36:42 +0000 (12:36 +0100)
commitb8cdafff60f8173c3f64371c137b0407b380a5e2
tree5bda5a8d048534d584756ae593337a3df5d77314
parenta9ea59c4c6d1a6a1ed34569220763d9638b5785e
parisc: Fix some apparent put_user() failures

After commit 65a1d8054d24 ("parisc: Switch user access functions
to signal errors in r29 instead of r8") bash suddenly started
to report those warnings after login:

-bash: cannot set terminal process group (-1): Bad file descriptor
-bash: no job control in this shell

It turned out, that a function call inside a put_user(), e.g.:
put_user(vt_do_kdgkbmode(console), (int __user *)arg);
clobbered the error register (r29) and thus the put_user() call itself
seem to have failed.

Rearrange the C-code to pre-calculate the intermediate value
and then do the put_user().
Additionally prefer the "+" constraint on pu_err and gu_err registers
to tell the compiler that those operands are both read and written by
the assembly instruction.

Reported-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: 65a1d8054d24 ("parisc: Switch user access functions to signal errors in r29 instead of r8")
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/uaccess.h