Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Issue 10829110: Fix two register leaks in the trusted->untrusted context switch (Closed)

Created:
8 years, 4 months ago by Mark Seaborn
Modified:
8 years, 4 months ago
Reviewers:
bsy
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Fix two register leaks in the trusted->untrusted context switch x86-32: Stop leaking the address of the NaClThreadContext in %ecx. ARM: Stop leaking the value of r12 from trusted code. Add a comprehensive test to check that registers are reset when a syscall returns. Add some comments about resetting flags. On x86-64, reorder an instruction which resets flags so that the flags don't depend on the return address, to ease testing. Move UnsetNonCalleeSavedRegisters() out of suspend_test_guest.c into tests/common. BUG=http://code.google.com/p/nativeclient/issues/detail?id=2919 TEST=run_syscall_return_regs_test Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=9343

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+191 lines, -31 lines) Patch
M SConstruct View 1 chunk +1 line, -0 lines 0 comments Download
M src/trusted/service_runtime/arch/arm/nacl_switch.S View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/trusted/service_runtime/arch/x86_32/springboard.S View 1 chunk +2 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/arch/x86_64/nacl_switch_64.S View 1 chunk +3 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/arch/x86_64/nacl_syscall_64.S View 1 chunk +7 lines, -1 line 0 comments Download
M tests/common/register_set.h View 1 chunk +3 lines, -0 lines 0 comments Download
M tests/common/register_set.c View 1 chunk +27 lines, -0 lines 0 comments Download
A tests/syscall_return_regs/nacl.scons View 1 chunk +16 lines, -0 lines 0 comments Download
A tests/syscall_return_regs/syscall_return_regs_test.c View 1 chunk +128 lines, -0 lines 0 comments Download
M tests/thread_suspension/suspend_test_guest.c View 2 chunks +1 line, -28 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mark Seaborn
8 years, 4 months ago (2012-08-01 16:26:09 UTC) #1
bsy
comment nit. plz fix. o/w lgtm. btw, might also note aliase r12==ip http://codereview.chromium.org/10829110/diff/1/src/trusted/service_runtime/arch/arm/nacl_switch.S File src/trusted/service_runtime/arch/arm/nacl_switch.S ...
8 years, 4 months ago (2012-08-01 17:24:46 UTC) #2
Mark Seaborn
8 years, 4 months ago (2012-08-01 17:46:06 UTC) #3
http://codereview.chromium.org/10829110/diff/1/src/trusted/service_runtime/ar...
File src/trusted/service_runtime/arch/arm/nacl_switch.S (right):

http://codereview.chromium.org/10829110/diff/1/src/trusted/service_runtime/ar...
src/trusted/service_runtime/arch/arm/nacl_switch.S:25: * We clear registers r2,
r3, lr, flag and status fields in CPSR
On 2012/08/01 17:24:46, bsy wrote:
> and r12

Fixed, and mentioned its alias, 'ip'.  Thanks.

Powered by Google App Engine
This is Rietveld 408576698