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

Issue 4688002: On older 32bit kernels (e.g. Ubuntu Hardy), the seccomp sandbox fails to hand... (Closed)

Created:
10 years, 1 month ago by Markus (顧孟勤)
Modified:
9 years, 7 months ago
Reviewers:
Mark Seaborn
CC:
chromium-reviews, Markus (顧孟勤), Evan Martin
Visibility:
Public.

Description

On older 32bit kernels (e.g. Ubuntu Hardy), the seccomp sandbox fails to handle signals correctly. This is primarily a result of the kernel not supporting non-executable data segments. But it also runs into problems because the format of the signal frame is subtly different and does not appear to always include a "magic restorer function". This changelist removes all dependencies on NX support from the 32bit version of the code. And it eliminates the code that patches the restorer function. Both of these features were originally added to make it easier for gdb to debug code that runs inside of a signal handler. But given the observed problems with this approach, it does not seem worth the effort. 64bit code seems unaffected by all of these problems -- presumably because that architecture is a lot more recent. So, we'll not make any changes to it. BUG=http://code.google.com/p/seccompsandbox/issues/detail?id=5 TEST=make test Committed: http://code.google.com/p/seccompsandbox/source/detail?r=147

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -92 lines) Patch
M sandbox.cc View 10 chunks +51 lines, -92 lines 2 comments Download

Messages

Total messages: 6 (0 generated)
Markus (顧孟勤)
This bug was causing problems with running unittests on the buildbots. In particular, the code ...
10 years, 1 month ago (2010-11-09 03:26:20 UTC) #1
Mark Seaborn
LGTM. I didn't understand this code very well before, but this makes it a bit ...
10 years, 1 month ago (2010-11-09 09:40:31 UTC) #2
Markus (顧孟勤)
On Tue, Nov 9, 2010 at 01:40, <mseaborn@chromium.org> wrote: > LGTM. I didn't understand this ...
10 years, 1 month ago (2010-11-09 16:45:38 UTC) #3
Mark Seaborn
On 9 November 2010 16:45, Markus Gutschke <markus@chromium.org> wrote: > On Tue, Nov 9, 2010 ...
10 years, 1 month ago (2010-11-09 20:01:23 UTC) #4
Markus (顧孟勤)
I am not quite sure about that. Gdb definitely seems to see that label globally. ...
10 years, 1 month ago (2010-11-09 20:04:42 UTC) #5
Mark Seaborn
10 years, 1 month ago (2010-11-09 20:55:02 UTC) #6
On 9 November 2010 20:04, Markus Gutschke <markus@chromium.org> wrote:

> I am not quite sure about that. Gdb definitely seems to see that label
> globally. It also gets confused and thinks it starts a new function. So, if
> you try to disassemble all of playground$runTrustedThread you can't. It will
> stop as soon as it encounters the fatal_error label.
>
> I haven't checked whether gdb is the only thing affected by this, or
> whether the label is confusing other programs (e.g. linker, dynamic loader,
> ...).
>

Hmm, I see what you mean.  I was only considering the linker -- which I
think should be fine, because static functions are declared this way.
Though adding a ".L" prefix wouldn't hurt for more generically-named labels.

It looks like gdb treats runTrustedThread as one function (and not finishing
at fatal_error), if this is added to the end:
        .size playground$runTrustedThread, . - playground$runTrustedThread

Cheers,
Mark

On Tue, Nov 9, 2010 at 12:01, Mark Seaborn <mseaborn@chromium.org> wrote:
>
>> On 9 November 2010 16:45, Markus Gutschke <markus@chromium.org> wrote:
>>
>>>  On Tue, Nov 9, 2010 at 01:40, <mseaborn@chromium.org> wrote:
>>>
>>>> One suggestion: if I commit the asm-file conversion
>>>
>>> (http://codereview.chromium.org/4325001/show), you could add textual
>>>> labels,
>>>> which would make this easier to understand.  Single-char numeric labels
>>>> are very
>>>> hard to navigate (especially with two architectures in one file!).  But
>>>> you are
>>>> welcome to commit this change before that conversion.
>>>>
>>>
>>> Yes, the conversion to an external assembly file is going to help with
>>> making this code easier to read. And symbolic labels are a good idea in that
>>> case.
>>>
>>> But we should make sure that we pick a naming convention that doesn't
>>> pollute the global namespace. I think, this probably means all labels need
>>> to start with ".L". But I haven't actually verified whether that works.
>>>
>>
>> As long as you don't declare a symbol with ".global", you're not polluting
>> the global namespace, just using the compilation unit's local namespace.  I
>> did this with "fatal_error" in trusted_thread_*.S.  So I don't think we need
>> a prefix for that.
>>
>> Cheers,
>> Mark
>>
>>
>

Powered by Google App Engine
This is Rietveld 408576698