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

Issue 3142022: Sbox IPC fix (Closed)

Created:
10 years, 4 months ago by cpu_(ooo_6.6-7.5)
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Sbox IPC fix BUG=52682 TEST=included Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=56796

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 11

Patch Set 3 : '' #

Total comments: 11

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -39 lines) Patch
M sandbox/src/crosscall_params.h View 1 2 chunks +31 lines, -20 lines 0 comments Download
M sandbox/src/crosscall_server.cc View 1 2 5 chunks +24 lines, -19 lines 0 comments Download
M sandbox/src/ipc_unittest.cc View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
cpu_(ooo_6.6-7.5)
10 years, 4 months ago (2010-08-19 19:30:04 UTC) #1
rvargas (doing something else)
http://codereview.chromium.org/3142022/diff/5001/6002 File sandbox/src/crosscall_server.cc (right): http://codereview.chromium.org/3142022/diff/5001/6002#newcode84 sandbox/src/crosscall_server.cc:84: // inside this function. Could you add a comment ...
10 years, 4 months ago (2010-08-19 20:55:52 UTC) #2
cpu_(ooo_6.6-7.5)
code updated please look again. http://codereview.chromium.org/3142022/diff/5001/6002 File sandbox/src/crosscall_server.cc (right): http://codereview.chromium.org/3142022/diff/5001/6002#newcode124 sandbox/src/crosscall_server.cc:124: (declared_size < min_declared_size)) { ...
10 years, 4 months ago (2010-08-19 22:11:21 UTC) #3
rvargas (doing something else)
LGTM http://codereview.chromium.org/3142022/diff/5001/6002 File sandbox/src/crosscall_server.cc (right): http://codereview.chromium.org/3142022/diff/5001/6002#newcode124 sandbox/src/crosscall_server.cc:124: (declared_size < min_declared_size)) { On 2010/08/19 22:11:21, cpu ...
10 years, 4 months ago (2010-08-20 00:22:47 UTC) #4
Chris Evans
Some comments. http://codereview.chromium.org/3142022/diff/11001/12002 File sandbox/src/crosscall_server.cc (right): http://codereview.chromium.org/3142022/diff/11001/12002#newcode108 sandbox/src/crosscall_server.cc:108: __try { Can we get rid of ...
10 years, 4 months ago (2010-08-20 01:10:41 UTC) #5
cpu_(ooo_6.6-7.5)
This CL got reverted because broke some tests. Please read my reply here but the ...
10 years, 4 months ago (2010-08-20 03:57:28 UTC) #6
cevans
10 years, 4 months ago (2010-08-20 05:30:47 UTC) #7
On Thu, Aug 19, 2010 at 8:57 PM, <cpu@chromium.org> wrote:

> This CL got reverted because broke some tests. Please read my reply here
> but the
> changes will appear in a new CL.


I LGTM'ed the new CL. Thanks for taking care of that.
Looks like a relatively safe change - can I interest you in merging it to
M6? :)


>
>
>
>
> http://codereview.chromium.org/3142022/diff/11001/12002
> File sandbox/src/crosscall_server.cc (right):
>
> http://codereview.chromium.org/3142022/diff/11001/12002#newcode108
> sandbox/src/crosscall_server.cc:108: __try {
> On 2010/08/20 01:10:41, Chris Evans wrote:
>
>> Can we get rid of this try and move to a model whereby we simply don't
>>
> access
>
>> out-of-bounds memory?
>>
>
> I think we no longer have that risk. I am looking and I don't see the
> danger. I must be a remain of the old code.
>
> I'll talk to Rick to see if he sees value on it.
>
>
> http://codereview.chromium.org/3142022/diff/11001/12002#newcode116
> sandbox/src/crosscall_server.cc:116: sizeof(CrossCallParamsEx) +
> (param_count * sizeof(ParamInfo));
> On 2010/08/20 01:10:41, Chris Evans wrote:
>
>> 1) Should this be sizeof(CrossCallParams) ?
>>
>
>  2) Should it be param_count + 1 ? (Looking at ActualCallParams, a
>>
> 1-parameter
>
>> structure will have 2 ParamInfos: ParamInfo param_info_[NUMBER_PARAMS
>>
> + 1];)
>
> If I appy your two suggestions together then it is equivalent to the
> current code since the difference between CrossCallParams and
> CrossCallParamsEx is exactly one ParamInfo.


Ah, I did wonder about that. Cool.

Cheers
Chris


>
> http://codereview.chromium.org/3142022/diff/11001/12002#newcode120
> sandbox/src/crosscall_server.cc:120: // Integer overflow or computed
> size bigger than untrusted buffer.
> On 2010/08/20 01:10:41, Chris Evans wrote:
>
>> I think this integer overflow check is trying to be too clever. I also
>>
> think
>
>> it's incorrect and that I could hit the NOTREACHED() at line 61.
>> Can we just check for param_count > 9 and reject at that point? No way
>>
> that 9 *
>
>> sizeof(ParamInfo) is going to cause overflow.
>>
>
> Maybe the way is tested is too obscure but that is what we do: note that
> for params > 9 declared_size is 0 which fails the test in line 126 as
> long min_declared_size is positive which is what is tested in line 118.
>
>
> http://codereview.chromium.org/3142022/diff/11001/12002#newcode144
> sandbox/src/crosscall_server.cc:144: const char* first_byte =
> &backing_mem[min_declared_size];
> On 2010/08/20 01:10:41, Chris Evans wrote:
>
>> The above check at line 126 would seem to permit "declared_size ==
>> min_declared_size", which would lead to last_byte < first_byte here?
>>
> That seems
>
>> dangerous. Is there some missing check?
>>
>
> Yes, sort of. See my next CL.
>
>
> http://codereview.chromium.org/3142022/diff/11001/12002#newcode172
> sandbox/src/crosscall_server.cc:172: if (index > GetParamsCount()) {
> On 2010/08/20 01:10:41, Chris Evans wrote:
>
>> If index is 0-based, should this check be >= ?
>>
>
> yep. fixed
>
>
> http://codereview.chromium.org/3142022/show
>

Powered by Google App Engine
This is Rietveld 408576698