Closed Bug 1207790 Opened 4 years ago Closed 4 years ago

Fix sandbox build on old Linux kernels (2.6.28 through 2.6.39)

Categories

(Core :: Security: Process Sandboxing, defect)

Unspecified
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox41 --- wontfix
firefox42 --- wontfix
firefox43 --- fixed
firefox44 --- fixed
firefox45 --- fixed
b2g-v2.5 --- fixed

People

(Reporter: jld, Assigned: jld)

References

Details

Attachments

(1 file)

This was reported on IRC #boxing last night (in my time zone's “night”, anyway):

23:11 < arlolra> anyone seen this before?
23:11 < arlolra> 14:37.47 
/var/tmp/tmp.fasPeCKAag/instantbird-a3192a7cdb5a/mozilla/security/sandbox/linux/SandboxFilterUtil.cpp:84:43: error: 'SYS_RECVMMSG' was not declared in this scope
23:11 < arlolra> 14:37.47 DISPATCH_SOCKETCALL(__NR_recvmmsg, SYS_RECVMMSG);

I didn't have a chance to ask that a bug be filed, but I think I know what's going on here.  SandboxFilterUtil.cpp does this:

#ifndef SYS_ACCEPT4
// Android's kernel headers don't define these.
#define SYS_ACCEPT4  18
#define SYS_RECVMMSG 19
#define SYS_SENDMMSG 20
#endif

Which means that if your kernel headers are new enough to define SYS_ACCEPT4 but not SYS_RECVMMSG, you'll get that error.  The commits involved are:

accept4: de11defebf00, in 2.6.28
recvmmsg: a2e2725541fa, in 2.6.33
sendmmsg: 228e548e6020, in 3.0

This hasn't affected any of the Tier 1 build platforms, but it's simple enough to ifndef each define separately (and edit the comment) to fix it.
Duplicate of this bug: 1219141
Assignee: nobody → jld
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=69e0f800fba4

Also, noting that this is fallout from bug 1055310, so affects branches back to 41 (and was reported on 41 in bug 1219141).  I don't know what release management's policies are for non-Tier-1-only bugs (although the uplift risk is basically zero), but it's worth having on record at least.
(In reply to Jed Davis [:jld] from comment #3)
> Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=69e0f800fba4
> 
> Also, noting that this is fallout from bug 1055310, so affects branches back
> to 41 (and was reported on 41 in bug 1219141).  I don't know what release
> management's policies are for non-Tier-1-only bugs (although the uplift risk
> is basically zero), but it's worth having on record at least.

cc'ing sylvestre and liz to this bug, they might have a answer to you to that question about policies
Flags: needinfo?(sledru)
Flags: needinfo?(lhenry)
This is too late for 42 as the release date is tomorrow but still have time for 43.
Please submit and uplift request.
Flags: needinfo?(sledru)
Flags: needinfo?(lhenry)
Yes I would like this for 43 before I start the build.
Flags: needinfo?(jld)
Don't bother about this one. As 2.6.39 is very old, there is no rush.
(In reply to Sylvestre Ledru [:sylvestre] from comment #8)
> Don't bother about this one. As 2.6.39 is very old, there is no rush.

I'm using RHED 6, because it's very stable. I didn't want to upgrade to 7 because of GNOME3 and because RHED costs money. I want threading optimizations from Firefox 40, and I have been applied a patch (that was posted yesterday) to the source code when upgrade Firefox version!

Is it bad? Much people are using Windows XP that released in 2002!
Zenitur, we are discussing about building the software, not running it.
(In reply to Sylvestre Ledru [:sylvestre] from comment #10)
> Zenitur, we are discussing about building the software, not running it.

It's impossible to build on new environment when run on an old. If I'll try to build Firefox on RHEL 7 environment, when start that on 6, I will get "too old Glibc in your system, and where is your GTK3?". That's why I can build current Firefox for Enterprise Linux 6 only with EL ≤ 6.
when = then
https://hg.mozilla.org/mozilla-central/rev/5cbef5458e6b
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment on attachment 8681525 [details] [diff] [review]
bug1207790-netcall-build-hg0.diff

Approval Request Comment
[Feature/regressing bug #]: Bug 1055310
[User impact if declined]: Build breakage on some non-Tier-1 systems (see comment #0 and bug 1219141)
[Describe test coverage new/current, TreeHerder]: It's been stable on m-c for a few days.
[Risks and why]: Effectively none; this patch shouldn't affect Tier 1 builds at all, and only affects whether the build is broken.
[String/UUID change made/needed]: None
Flags: needinfo?(jld)
Attachment #8681525 - Flags: approval-mozilla-beta?
Attachment #8681525 - Flags: approval-mozilla-aurora?
Also, anyone doing a build of one of the wontfix'ed versions on an affected system, or building packages of them for one, should be able to apply the patch locally.
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
Comment on attachment 8681525 [details] [diff] [review]
bug1207790-netcall-build-hg0.diff

Taking it to help people developing on old kernels.
Should be in 43 beta 2.
Attachment #8681525 - Flags: approval-mozilla-beta?
Attachment #8681525 - Flags: approval-mozilla-beta+
Attachment #8681525 - Flags: approval-mozilla-aurora?
Attachment #8681525 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.