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

Issue 957063002: Avoid string instructions in x86_64 memset (Closed)

Created:
5 years, 10 months ago by Derek Schuff
Modified:
5 years, 9 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/nacl-newlib.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Avoid string instructions in x86_64 memset We want to avoid revealing the sandbox base address in newlib code; memset currently uses stos, (which leaves the full 64 bits in rdi) and does not clear it before returning to user code. Instead of just clearing it, we remove the stos instructions because if we want to implement a validator check in the future, it will be easier to just ban them. Also: * Optimize the unrolled loop for large aligned buffers by using rbp as a base register. * Remove non-temporal store instructions (and the fence that separated them from the subsequent stores). R=jvoung@chromium.org, mseaborn@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=4088 Committed: https://git.chromium.org/gitweb?p=native_client/nacl-newlib.git;a=commit;h=8c4da477c5348743d900307ce8443da4cc2fcdb8

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -33 lines) Patch
M newlib/libc/machine/x86_64/memset.S View 1 1 chunk +81 lines, -33 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
Derek Schuff
5 years, 10 months ago (2015-02-25 21:49:09 UTC) #1
jvoung (off chromium)
lgtm https://codereview.chromium.org/957063002/diff/1/newlib/libc/machine/x86_64/memset.S File newlib/libc/machine/x86_64/memset.S (right): https://codereview.chromium.org/957063002/diff/1/newlib/libc/machine/x86_64/memset.S#newcode74 newlib/libc/machine/x86_64/memset.S:74: leal 128 (rdi), edi Might have been able ...
5 years, 9 months ago (2015-02-27 20:33:53 UTC) #3
Derek Schuff
Committed patchset #2 (id:20001) manually as 8c4da477c5348743d900307ce8443da4cc2fcdb8 (tree was closed).
5 years, 9 months ago (2015-02-27 20:56:53 UTC) #4
Derek Schuff
https://codereview.chromium.org/957063002/diff/1/newlib/libc/machine/x86_64/memset.S File newlib/libc/machine/x86_64/memset.S (right): https://codereview.chromium.org/957063002/diff/1/newlib/libc/machine/x86_64/memset.S#newcode74 newlib/libc/machine/x86_64/memset.S:74: leal 128 (rdi), edi On 2015/02/27 20:33:52, jvoung wrote: ...
5 years, 9 months ago (2015-02-27 21:03:19 UTC) #5
Mark Seaborn
5 years, 9 months ago (2015-03-09 17:57:28 UTC) #6
Message was sent while issue was closed.
For context: As with https://codereview.chromium.org/917463003/, the reason for
removing the non-temporal memory accesses here is just in case they can be used
for row hammering.

Powered by Google App Engine
This is Rietveld 408576698