|
|
DescriptionThe current test for sandboxing, trying to retrieve the USER_DATA_DIR
path, is not reliable. Instead, this adds a central check to the sandbox
to see if filesystem access is available (by trying to stat() /proc).
BUG=chromium:630420
Committed: https://crrev.com/33b4324fcc0caf430a5b1012a30176daf6bf4de7
Cr-Commit-Position: refs/heads/master@{#421292}
Patch Set 1 #
Total comments: 1
Patch Set 2 : Fix IsSandboxed() check when loading flash player. #Patch Set 3 : Fix IsSandboxed() check when loading flash player. #
Total comments: 4
Patch Set 4 : Fix IsSandboxed() check when loading flash player. #Patch Set 5 : Fix IsSandboxed() check when loading flash player. #
Total comments: 2
Patch Set 6 : Fix IsSandboxed() check when loading flash player. #
Messages
Total messages: 35 (14 generated)
kerrnel@chromium.org changed reviewers: + rickyz@chromium.org
Ricky, Please review this CL. - Greg
lgtm with comment https://codereview.chromium.org/2357393003/diff/1/chrome/common/chrome_conten... File chrome/common/chrome_content_client.cc (right): https://codereview.chromium.org/2357393003/diff/1/chrome/common/chrome_conten... chrome/common/chrome_content_client.cc:303: // This function tests if DIR_USER_DATA can be accessed, as a simple check to Update the comment as well.
The CQ bit was checked by kerrnel@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from rickyz@chromium.org Link to the patchset: https://codereview.chromium.org/2357393003/#ps20001 (title: "Fix IsSandboxed() check when loading flash player.")
The CQ bit was unchecked by kerrnel@chromium.org
kerrnel@chromium.org changed reviewers: + thakis@chromium.org
thakis@chromium.org: Please review changes in chrome_content_client.cc Thanks, Greg
in what way is it not reliable?
On 2016/09/22 17:37:19, Nico wrote: > in what way is it not reliable? It was always reporting that DIR_USER_DATA was accessible. I believe it was written under the assumption that if the path_service could not access files in DIR_USER_DATA, it would return false when trying to return the path. This, however, is definitely not true today (whether it was ever true I'm not sure). Regards, Greg
Since this possibly never worked and seems to be important enough to change it, is it possible to test this?
On 2016/09/22 18:00:20, Nico wrote: > Since this possibly never worked and seems to be important enough to change it, > is it possible to test this? I could presumably write a test that calls the function, makes sure it returns false, enables the sandbox, and calls IsSandboxed() again. My only concern there is that if the test manually switches on the sandbox, it doesn't fully test real world conditions. Ricky, what do you think? Thanks, Greg
On 2016/09/22 18:06:13, Greg K wrote: > On 2016/09/22 18:00:20, Nico wrote: > > Since this possibly never worked and seems to be important enough to change > it, > > is it possible to test this? > > I could presumably write a test that calls the function, makes sure it returns > false, enables the sandbox, and calls IsSandboxed() again. My only concern there > is that if the test manually switches on the sandbox, it doesn't fully test real > world conditions. > > Ricky, what do you think? > > Thanks, > > Greg In order to test this properly, I created a central function to do it in the sandbox code, and called that. Ricky, please take another look. - Greg
https://codereview.chromium.org/2357393003/diff/40001/sandbox/linux/services/... File sandbox/linux/services/credentials.cc (right): https://codereview.chromium.org/2357393003/diff/40001/sandbox/linux/services/... sandbox/linux/services/credentials.cc:318: CHECK(!base::DirectoryExists(base::FilePath("/proc"))); Mind replacing this line with CHECK(!HasFileSystemAccess()) https://codereview.chromium.org/2357393003/diff/40001/sandbox/linux/services/... File sandbox/linux/services/credentials_unittest.cc (right): https://codereview.chromium.org/2357393003/diff/40001/sandbox/linux/services/... sandbox/linux/services/credentials_unittest.cc:152: CHECK(!base::DirectoryExists(base::FilePath("/proc"))); Would be fine with replacing this line rather than adding a separate test
(er oops, forgot to include lgtm - just a minor comment or two)
Thanks. Nico, would you please review chrome/common? Thanks, Greg https://codereview.chromium.org/2357393003/diff/40001/sandbox/linux/services/... File sandbox/linux/services/credentials.cc (right): https://codereview.chromium.org/2357393003/diff/40001/sandbox/linux/services/... sandbox/linux/services/credentials.cc:318: CHECK(!base::DirectoryExists(base::FilePath("/proc"))); On 2016/09/23 23:40:20, rickyz wrote: > Mind replacing this line with CHECK(!HasFileSystemAccess()) Done. https://codereview.chromium.org/2357393003/diff/40001/sandbox/linux/services/... File sandbox/linux/services/credentials_unittest.cc (right): https://codereview.chromium.org/2357393003/diff/40001/sandbox/linux/services/... sandbox/linux/services/credentials_unittest.cc:152: CHECK(!base::DirectoryExists(base::FilePath("/proc"))); On 2016/09/23 23:40:20, rickyz wrote: > Would be fine with replacing this line rather than adding a separate test Done.
lgtm with updated CL description. thanks!
Description was changed from ========== Fix IsSandboxed() check when loading flash player. The current test for sandboxing, trying to retrieve the USER_DATA_DIR path, is not reliable. Instead, see if the program can access /proc/self/exe. BUG=chromium:630420 ========== to ========== The current test for sandboxing, trying to retrieve the USER_DATA_DIR path, is not reliable. Instead, this adds a central check to the sandbox to see if filesystem access is available (by trying to stat() /proc). BUG=chromium:630420 ==========
Description was changed from ========== The current test for sandboxing, trying to retrieve the USER_DATA_DIR path, is not reliable. Instead, this adds a central check to the sandbox to see if filesystem access is available (by trying to stat() /proc). BUG=chromium:630420 ========== to ========== The current test for sandboxing, trying to retrieve the USER_DATA_DIR path, is not reliable. Instead, this adds a central check to the sandbox to see if filesystem access is available (by trying to stat() /proc). BUG=chromium:630420 ==========
The CQ bit was checked by kerrnel@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from rickyz@chromium.org Link to the patchset: https://codereview.chromium.org/2357393003/#ps60001 (title: "Fix IsSandboxed() check when loading flash player.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_clobber_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Nico, Is the change to chrome/common/BUILD.gn to make the dependency explicit OK? Thanks, Greg On 2016/09/26 21:10:09, commit-bot: I haz the power wrote: > Try jobs failed on following builders: > cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) > chromeos_amd64-generic_chromium_compile_only_ng on > master.tryserver.chromium.linux (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) > chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux > (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) > linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux > (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux > (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > linux_chromium_clobber_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
https://codereview.chromium.org/2357393003/diff/80001/chrome/common/BUILD.gn File chrome/common/BUILD.gn (right): https://codereview.chromium.org/2357393003/diff/80001/chrome/common/BUILD.gn#... chrome/common/BUILD.gn:212: "//sandbox/linux:sandbox_services", You're not including a generated header in a chrome header, so this doesn't need to be a public_deps, a regular deps is enough. Also, the dep should probably only be added if is_linux (?)
https://codereview.chromium.org/2357393003/diff/80001/chrome/common/BUILD.gn File chrome/common/BUILD.gn (right): https://codereview.chromium.org/2357393003/diff/80001/chrome/common/BUILD.gn#... chrome/common/BUILD.gn:212: "//sandbox/linux:sandbox_services", On 2016/09/27 15:39:55, Nico (mostly away until Oct 3) wrote: > You're not including a generated header in a chrome header, so this doesn't need > to be a public_deps, a regular deps is enough. Also, the dep should probably > only be added if is_linux (?) Done.
lgtm
The CQ bit was checked by kerrnel@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from rickyz@chromium.org Link to the patchset: https://codereview.chromium.org/2357393003/#ps100001 (title: "Fix IsSandboxed() check when loading flash player.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== The current test for sandboxing, trying to retrieve the USER_DATA_DIR path, is not reliable. Instead, this adds a central check to the sandbox to see if filesystem access is available (by trying to stat() /proc). BUG=chromium:630420 ========== to ========== The current test for sandboxing, trying to retrieve the USER_DATA_DIR path, is not reliable. Instead, this adds a central check to the sandbox to see if filesystem access is available (by trying to stat() /proc). BUG=chromium:630420 ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== The current test for sandboxing, trying to retrieve the USER_DATA_DIR path, is not reliable. Instead, this adds a central check to the sandbox to see if filesystem access is available (by trying to stat() /proc). BUG=chromium:630420 ========== to ========== The current test for sandboxing, trying to retrieve the USER_DATA_DIR path, is not reliable. Instead, this adds a central check to the sandbox to see if filesystem access is available (by trying to stat() /proc). BUG=chromium:630420 Committed: https://crrev.com/33b4324fcc0caf430a5b1012a30176daf6bf4de7 Cr-Commit-Position: refs/heads/master@{#421292} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/33b4324fcc0caf430a5b1012a30176daf6bf4de7 Cr-Commit-Position: refs/heads/master@{#421292} |