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

Issue 330373002: Reorder IntegrityLevel enum to be less confusing (Closed)

Created:
6 years, 6 months ago by jschuh
Modified:
6 years, 6 months ago
CC:
chromium-reviews
Project:
chromium
Visibility:
Public.

Description

Reorder IntegrityLevel enum to be less confusing The enum should be in ascending order like the levels themselves. R=rvargas

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -7 lines) Patch
M sandbox/win/src/security_level.h View 1 chunk +7 lines, -7 lines 1 comment Download

Messages

Total messages: 10 (0 generated)
jschuh
ptal
6 years, 6 months ago (2014-06-16 14:37:13 UTC) #1
rvargas (doing something else)
https://codereview.chromium.org/330373002/diff/1/sandbox/win/src/security_level.h File sandbox/win/src/security_level.h (right): https://codereview.chromium.org/330373002/diff/1/sandbox/win/src/security_level.h#newcode23 sandbox/win/src/security_level.h:23: INTEGRITY_LEVEL_LAST Today we init variables to LAST, that has ...
6 years, 6 months ago (2014-06-16 19:16:58 UTC) #2
jschuh
On 2014/06/16 19:16:58, rvargas wrote: > https://codereview.chromium.org/330373002/diff/1/sandbox/win/src/security_level.h > File sandbox/win/src/security_level.h (right): > > https://codereview.chromium.org/330373002/diff/1/sandbox/win/src/security_level.h#newcode23 > ...
6 years, 6 months ago (2014-06-17 16:45:47 UTC) #3
rvargas (doing something else)
On 2014/06/17 16:45:47, Justin Schuh wrote: > On 2014/06/16 19:16:58, rvargas wrote: > > > ...
6 years, 6 months ago (2014-06-17 17:49:12 UTC) #4
jschuh
On 2014/06/17 17:49:12, rvargas wrote: > On 2014/06/17 16:45:47, Justin Schuh wrote: > > On ...
6 years, 6 months ago (2014-06-17 18:12:41 UTC) #5
rvargas (doing something else)
On 2014/06/17 18:12:41, Justin Schuh wrote: > On 2014/06/17 17:49:12, rvargas wrote: > > On ...
6 years, 6 months ago (2014-06-17 18:23:24 UTC) #6
jschuh
On Tue, Jun 17, 2014 at 11:23 AM, <rvargas@chromium.org> wrote: > On 2014/06/17 18:12:41, Justin ...
6 years, 6 months ago (2014-06-17 18:30:41 UTC) #7
rvargas (doing something else)
On 2014/06/17 18:30:41, Justin Schuh wrote: > On Tue, Jun 17, 2014 at 11:23 AM, ...
6 years, 6 months ago (2014-06-17 19:28:02 UTC) #8
jschuh
Lets try to reset this discussion. The IntegrityLevel values cannot be passed to Windows system ...
6 years, 6 months ago (2014-06-17 20:52:34 UTC) #9
rvargas (doing something else)
6 years, 6 months ago (2014-06-17 21:32:26 UTC) #10
On 2014/06/17 20:52:34, Justin Schuh wrote:
> Lets try to reset this discussion. The IntegrityLevel values cannot be passed
to
> Windows system functions directly. We need to map the value to a SDDL string
> using GetIntegrityLevelString(), which returns a NULL on INTEGRITY_LEVEL_LAST.
> So, anything passing INTEGRITY_LEVEL_LAST is just going to crash and does not
> represent a risk. Given that, are you comfortable with this CL?

I'm not.

I'm fine with reversing the order. I'm also fine with having
INTEGRITY_LEVEL_LAST at the end (well, it is the last one no matter what). I'm
not OK with changing the enum and nothing else. There are not that many uses of
INTEGRITY_LEVEL_LAST, but they should be revised. 

For example, the code on StartRestrictedProcessInJob() reads wrong to me
regardless of being a crash/vulnerability or not. To me it makes sense to say
"create this token so that this process runs with the lowest integrity level[1],
whatever that means, unless it is overridden by someone else". It doesn't make
sense to say "create this token so that this process runs with the highest
integrity level, whatever that means, unless it is overridden by someone else".
I don't like having code that relies by design on things being fixed later by
someone else.

Now if you were to argue that calling CreateRestrictedToken(...,
INTEGRITY_LEVEL_LAST,...) is just a way to say "I don't know what integrity
level to use so take this invalid value here that has to be fixed later", I
would say that then we need another constant below INTEGRITY_LEVEL_UNTRUSTED to
be used in that case.

[1] As you point out, this is not an OS call, this uses our definition and
ordering of IntegrityLevel and we are implicitly saying that there is an
ordering to that.

Powered by Google App Engine
This is Rietveld 408576698