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

Issue 17066002: attempt to make the libc urandom override work for non-glibc too (Closed)

Created:
7 years, 6 months ago by Mostyn Bramley-Moore
Modified:
7 years, 5 months ago
CC:
chromium-reviews, agl, jln+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

attempt to make the libc urandom override work for non-glibc too This patch attempts to generalise the linux libc urandom override, so that it works for non-glibc linux platforms too. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=208924

Patch Set 1 #

Total comments: 4

Patch Set 2 : not finding *stat64 should be fatal #

Patch Set 3 : change TODO note into a regular comment #

Patch Set 4 : split stat overrides into two distinct cases #

Total comments: 4

Patch Set 5 : fix style nits #

Patch Set 6 : remove ifdefs #

Total comments: 14

Patch Set 7 : use fstat* instead of __fxstat* for simplicity #

Total comments: 2

Patch Set 8 : add back some ifdefs, but don't completely disable stat override if xstat is available #

Patch Set 9 : undo changes no longer required #

Patch Set 10 : make InitLibcUrandomOverrides call InitLibcFileIOFunctions #

Patch Set 11 : fixup of previous commit, call the function once only #

Patch Set 12 : comment improvement #

Patch Set 13 : remove obsolete comment #

Total comments: 13

Patch Set 14 : go back to two distinct ifdef cases #

Patch Set 15 : undo copyright year change #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -19 lines) Patch
M sandbox/linux/services/libc_urandom_override.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +86 lines, -19 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
Mostyn Bramley-Moore
@jln, agl: after looking at this some more, I think I have found a reasonable ...
7 years, 6 months ago (2013-06-14 09:54:26 UTC) #1
Mostyn Bramley-Moore
Oh, and note the actual use case for this code... In mozilla/security/nss/lib/freebl/unix_rand.c: RNG_SystemInfoForRNG() calls RNG_FileUpdate("/dev/urandom", ...
7 years, 6 months ago (2013-06-14 09:59:28 UTC) #2
jln (very slow on Chromium)
This looks good in general. Adam: please let me know if there is a reason ...
7 years, 6 months ago (2013-06-14 19:43:16 UTC) #3
jln (very slow on Chromium)
On 2013/06/14 09:59:28, Mostyn Bramley-Moore wrote: > Oh, and note the actual use case for ...
7 years, 6 months ago (2013-06-14 19:44:39 UTC) #4
Sergey Ulanov
lgtm, but I'm not an owner https://codereview.chromium.org/17066002/diff/1/sandbox/linux/services/libc_urandom_override.cc File sandbox/linux/services/libc_urandom_override.cc (right): https://codereview.chromium.org/17066002/diff/1/sandbox/linux/services/libc_urandom_override.cc#newcode74 sandbox/linux/services/libc_urandom_override.cc:74: // TODO(sergeyu, mostynb): ...
7 years, 6 months ago (2013-06-14 20:13:47 UTC) #5
Ryan Sleevi
wtc was just working on this code on the NSS side, he'd be a better ...
7 years, 6 months ago (2013-06-14 20:35:49 UTC) #6
Mostyn Bramley-Moore
https://codereview.chromium.org/17066002/diff/1/sandbox/linux/services/libc_urandom_override.cc File sandbox/linux/services/libc_urandom_override.cc (right): https://codereview.chromium.org/17066002/diff/1/sandbox/linux/services/libc_urandom_override.cc#newcode74 sandbox/linux/services/libc_urandom_override.cc:74: // TODO(sergeyu, mostynb): Hopefully the stat/xstat overrides can work ...
7 years, 6 months ago (2013-06-14 20:38:22 UTC) #7
jln (very slow on Chromium)
On 2013/06/14 20:38:22, Mostyn Bramley-Moore wrote: > https://codereview.chromium.org/17066002/diff/1/sandbox/linux/services/libc_urandom_override.cc > File sandbox/linux/services/libc_urandom_override.cc (right): > > https://codereview.chromium.org/17066002/diff/1/sandbox/linux/services/libc_urandom_override.cc#newcode74 ...
7 years, 6 months ago (2013-06-14 20:55:12 UTC) #8
Mostyn Bramley-Moore
> > I made this change in patchset 2, but now I think we might ...
7 years, 6 months ago (2013-06-14 22:25:03 UTC) #9
Mostyn Bramley-Moore
I checked a 32bit ubuntu precise (12.04) install, libc does not provide stat* symbols- instead ...
7 years, 6 months ago (2013-06-16 10:35:10 UTC) #10
Mostyn Bramley-Moore
@Julien: I successfully tested patchset 4 on a uClibc target. The linux_valgrind error looks unrelated ...
7 years, 6 months ago (2013-06-17 20:30:47 UTC) #11
Mostyn Bramley-Moore
@jln: *ping* :)
7 years, 6 months ago (2013-06-19 08:08:19 UTC) #12
jln (very slow on Chromium)
Sorry, this slipped through. I'm always wary of having #ifdefs for configuration that aren't tested ...
7 years, 6 months ago (2013-06-24 21:53:01 UTC) #13
Mostyn Bramley-Moore
https://chromiumcodereview.appspot.com/17066002/diff/16001/sandbox/linux/services/libc_urandom_override.cc File sandbox/linux/services/libc_urandom_override.cc (right): https://chromiumcodereview.appspot.com/17066002/diff/16001/sandbox/linux/services/libc_urandom_override.cc#newcode197 sandbox/linux/services/libc_urandom_override.cc:197: struct stat *buf) __asm__ ("stat"); On 2013/06/24 21:53:01, Julien ...
7 years, 6 months ago (2013-06-24 22:14:21 UTC) #14
Mostyn Bramley-Moore
On 2013/06/24 21:53:01, Julien Tinnes wrote: > Sorry, this slipped through. > > I'm always ...
7 years, 6 months ago (2013-06-24 22:28:56 UTC) #15
jln (very slow on Chromium)
On 2013/06/24 22:28:56, Mostyn Bramley-Moore wrote: > On 2013/06/24 21:53:01, Julien Tinnes wrote: > > ...
7 years, 6 months ago (2013-06-24 23:01:18 UTC) #16
Mostyn Bramley-Moore
Sounds OK. I will try it out on a couple of different libcs tomorrow morning ...
7 years, 6 months ago (2013-06-24 23:10:56 UTC) #17
Mostyn Bramley-Moore
@jln: How does patchset 6 look? * I didn't need to create IsUsingXstat, instead we ...
7 years, 6 months ago (2013-06-25 10:09:36 UTC) #18
Mostyn Bramley-Moore
7 years, 6 months ago (2013-06-25 11:09:36 UTC) #19
jln (very slow on Chromium)
> @jln: How does patchset 6 look? I'm worried about the complexity. Untested code = ...
7 years, 6 months ago (2013-06-25 23:00:02 UTC) #20
Mostyn Bramley-Moore
https://chromiumcodereview.appspot.com/17066002/diff/33001/sandbox/linux/services/libc_urandom_override.cc File sandbox/linux/services/libc_urandom_override.cc (right): https://chromiumcodereview.appspot.com/17066002/diff/33001/sandbox/linux/services/libc_urandom_override.cc#newcode62 sandbox/linux/services/libc_urandom_override.cc:62: // call it repeatedly with pthread_once() - ZygoteMain is ...
7 years, 6 months ago (2013-06-25 23:40:40 UTC) #21
Mostyn Bramley-Moore
I replaced the __fxstat* code with fstat* in patchset 7. https://chromiumcodereview.appspot.com/17066002/diff/33001/sandbox/linux/services/libc_urandom_override.cc File sandbox/linux/services/libc_urandom_override.cc (right): https://chromiumcodereview.appspot.com/17066002/diff/33001/sandbox/linux/services/libc_urandom_override.cc#newcode59 ...
7 years, 6 months ago (2013-06-26 00:09:57 UTC) #22
jln (very slow on Chromium)
Sorry, this thing is really super hairy and I want to be extremely careful to ...
7 years, 6 months ago (2013-06-26 01:57:21 UTC) #23
Mostyn Bramley-Moore
> Sorry, this thing is really super hairy and I want to be extremely careful ...
7 years, 6 months ago (2013-06-26 10:30:18 UTC) #24
Ryan Sleevi
Mostyn, Is this being done solely for the case of NSS? If so, how receptive ...
7 years, 6 months ago (2013-06-26 17:28:33 UTC) #25
Mostyn Bramley-Moore
On 2013/06/26 17:28:33, Ryan Sleevi wrote: > Mostyn, > > Is this being done solely ...
7 years, 6 months ago (2013-06-26 17:56:58 UTC) #26
Ryan Sleevi
On 2013/06/26 17:56:58, Mostyn Bramley-Moore wrote: > On 2013/06/26 17:28:33, Ryan Sleevi wrote: > > ...
7 years, 6 months ago (2013-06-26 18:03:01 UTC) #27
jln (very slow on Chromium)
Almost there. You can either RAW_CHECK as indicated, or feel free to just #else the ...
7 years, 6 months ago (2013-06-26 23:49:47 UTC) #28
jln (very slow on Chromium)
On 2013/06/26 18:03:01, Ryan Sleevi wrote: > On 2013/06/26 17:56:58, Mostyn Bramley-Moore wrote: > > ...
7 years, 6 months ago (2013-06-26 23:51:45 UTC) #29
Mostyn Bramley-Moore
On 2013/06/26 23:49:47, Julien Tinnes wrote: > Almost there. > > You can either RAW_CHECK ...
7 years, 6 months ago (2013-06-27 00:26:09 UTC) #30
Mostyn Bramley-Moore
I reverted back to two distinct cases in patchset 14, IMO this is simpler and ...
7 years, 6 months ago (2013-06-27 01:45:14 UTC) #31
jln (very slow on Chromium)
On 2013/06/27 01:45:14, Mostyn Bramley-Moore wrote: > I reverted back to two distinct cases in ...
7 years, 6 months ago (2013-06-27 02:42:36 UTC) #32
Mostyn Bramley-Moore
> > We still need to agree on the following: > > * Should I ...
7 years, 6 months ago (2013-06-27 06:00:30 UTC) #33
Mostyn Bramley-Moore
> When I get in to the office later this morning I will confirm that ...
7 years, 6 months ago (2013-06-27 07:48:07 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mostynb@opera.com/17066002/45002
7 years, 6 months ago (2013-06-27 07:48:25 UTC) #35
commit-bot: I haz the power
7 years, 5 months ago (2013-06-27 15:02:55 UTC) #36
Message was sent while issue was closed.
Change committed as 208924

Powered by Google App Engine
This is Rietveld 408576698