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

Issue 99203014: [NaCl SDK] Map active fds to absolute paths. (Closed)

Created:
6 years, 11 months ago by Matthew Turk
Modified:
6 years, 11 months ago
Reviewers:
binji, Sam Clegg
CC:
chromium-reviews, Sam Clegg
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

[NaCl SDK] Map active fds to absolute paths. This implements both fchdir and adds an absolute path to the Descriptor_t struct. Typically on Linux systems this information can be obtained by querying the /proc file system, but in absence of that, we can track it ourselves. For pipes and sockets, the path is the empty string. By enabling this behavior, fchdir can also be implemented. This also returns expected errno values from fchdir. This opens up the ability to do relative path operations like openat. While these currently can be executed in user code in a race condition prone way, they could be moved into the KernelProxy, where the absolute paths can be both accessed and resolved with AcquireHandleAndPath. R=binji@chromium.org, sbc@chromium.org BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244267

Patch Set 1 #

Total comments: 7

Patch Set 2 : Map active fds to absolute paths. #

Total comments: 8

Patch Set 3 : Map active fds to absolute paths. #

Total comments: 5

Patch Set 4 : Add absolute path to Descriptor_t #

Total comments: 5

Patch Set 5 : Modifying path to be pass-by-pointer #

Patch Set 6 : Conform to style guide #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -20 lines) Patch
M native_client_sdk/src/libraries/nacl_io/kernel_object.h View 1 2 3 4 5 2 chunks +10 lines, -3 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/kernel_object.cc View 1 2 3 4 4 chunks +27 lines, -4 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc View 1 2 3 4 5 chunks +33 lines, -9 lines 0 comments Download
M native_client_sdk/src/tests/nacl_io_test/kernel_object_test.cc View 1 2 3 2 chunks +5 lines, -4 lines 0 comments Download
M native_client_sdk/src/tests/nacl_io_test/kernel_proxy_test.cc View 1 2 3 1 chunk +56 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Matthew Turk
6 years, 11 months ago (2014-01-04 15:10:54 UTC) #1
Sam Clegg
looks good, thanks! I'll leave to to binji to give the final OK. https://codereview.chromium.org/99203014/diff/1/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc File ...
6 years, 11 months ago (2014-01-06 18:52:49 UTC) #2
Sam Clegg
Also, please at at least one test to nacl_io_test. You can run the tests outside ...
6 years, 11 months ago (2014-01-06 18:55:55 UTC) #3
binji
https://codereview.chromium.org/99203014/diff/1/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc File native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc (right): https://codereview.chromium.org/99203014/diff/1/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc#newcode176 native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc:176: fd_paths_[fd] = GetAbsParts(path).Join(); this probably should be handled in ...
6 years, 11 months ago (2014-01-06 19:32:04 UTC) #4
Matthew Turk
On 2014/01/06 19:32:04, binji wrote: > https://codereview.chromium.org/99203014/diff/1/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc > File native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc (right): > > https://codereview.chromium.org/99203014/diff/1/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc#newcode176 > ...
6 years, 11 months ago (2014-01-07 20:30:54 UTC) #5
Matthew Turk
https://codereview.chromium.org/99203014/diff/1/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc File native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc (right): https://codereview.chromium.org/99203014/diff/1/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc#newcode176 native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc:176: fd_paths_[fd] = GetAbsParts(path).Join(); On 2014/01/06 19:32:04, binji wrote: > ...
6 years, 11 months ago (2014-01-07 20:33:10 UTC) #6
binji
Looking good. I wouldn't worry too much about races with CWD; AFAICT it is inherently ...
6 years, 11 months ago (2014-01-07 21:40:29 UTC) #7
Matthew Turk
Thanks for the comments! I've updated to get rid of the race condition, expanded the ...
6 years, 11 months ago (2014-01-07 23:04:29 UTC) #8
Sam Clegg
https://codereview.chromium.org/99203014/diff/180001/native_client_sdk/src/libraries/nacl_io/kernel_object.cc File native_client_sdk/src/libraries/nacl_io/kernel_object.cc (right): https://codereview.chromium.org/99203014/diff/180001/native_client_sdk/src/libraries/nacl_io/kernel_object.cc#newcode193 native_client_sdk/src/libraries/nacl_io/kernel_object.cc:193: std::string &out_path){ Put '&' next to the type according ...
6 years, 11 months ago (2014-01-07 23:56:39 UTC) #9
Matthew Turk
This patchset removes fd_paths_ and moves the absolute path into the Descriptor_t struct. Thanks for ...
6 years, 11 months ago (2014-01-08 03:05:02 UTC) #10
binji
much better! A few nits, otherwise lgtm https://codereview.chromium.org/99203014/diff/250001/native_client_sdk/src/libraries/nacl_io/kernel_object.h File native_client_sdk/src/libraries/nacl_io/kernel_object.h (right): https://codereview.chromium.org/99203014/diff/250001/native_client_sdk/src/libraries/nacl_io/kernel_object.h#newcode33 native_client_sdk/src/libraries/nacl_io/kernel_object.h:33: Descriptor_t() : ...
6 years, 11 months ago (2014-01-08 17:25:43 UTC) #11
binji
On 2014/01/08 17:25:43, binji wrote: > much better! A few nits, otherwise lgtm > > ...
6 years, 11 months ago (2014-01-08 17:28:09 UTC) #12
Matthew Turk
I've changed the out parameter to be pass-by-pointer, addressed the other items, run the sel_ldr ...
6 years, 11 months ago (2014-01-08 17:47:37 UTC) #13
Sam Clegg
lgtm Can you add [NaCl SDK] at the beginning of the first line of the ...
6 years, 11 months ago (2014-01-08 18:23:24 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/matthewturk@gmail.com/99203014/400001
6 years, 11 months ago (2014-01-10 19:18:22 UTC) #15
commit-bot: I haz the power
6 years, 11 months ago (2014-01-10 22:44:07 UTC) #16
Message was sent while issue was closed.
Change committed as 244267

Powered by Google App Engine
This is Rietveld 408576698