Thread (23 messages) flat view 23 messages, 7 authors, 2017-03-09
STALE3435d

Re: [PATCH v2 4/4] arm64/syscalls: Specific usage of verify_pre_usermode_state

From: Thomas Garnier <hidden>
Date: 2017-03-09 16:35:30
Also in: linux-arm-kernel

On Thu, Mar 9, 2017 at 8:26 AM, Russell King - ARM Linux
[off-list ref] wrote:
On Thu, Mar 09, 2017 at 07:56:49AM -0800, Thomas Garnier wrote:
quoted
On Thu, Mar 9, 2017 at 4:23 AM, Mark Rutland [off-list ref] wrote:
quoted
We generally stick to lower case for the arm64 assembly macros. If we
need this, we should stick to the existing convention.
quoted
+/* Similar to set_fs(USER_DS) in verify_pre_usermode_state without a warning. */
+.macro VERIFY_PRE_USERMODE_STATE
+     mov     x1, #TASK_SIZE_64
+     str     x1, [tsk, #TSK_TI_ADDR_LIMIT]
+.endm
We need arm64's set_fs() to configure UAO, too, so this is much weaker
than set_fs(), and will leave __{get,put}_user and
__copy_{to,from}_user() able to access kernel memory.

We don't currently have an asm helper to clear UAO, and unconditionally
poking that on exception return is liable to be somewhat expensive.

Also, given we're only trying to catch this in syscalls, I'm afraid I
don't see what we gain by doing this in the entry assembly.
I optimized all architectures from the arm (32-bit) discussion. I will
come back to a simple bl to the verify function. Thanks!
I wouldn't call what you've done on ARM an "optimisation", because my
comment about making the fast path worthless still stands.
Why does it still stands on the latest proposal?
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.


-- 
Thomas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help