Closed Bug 944625 Opened 6 years ago Closed 6 years ago

B2G Emulator-x86: build failure due to __NR_socketpair, __NR_sendmsg undeclared

Categories

(Firefox OS Graveyard :: Emulator, defect)

x86_64
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: vicamo, Assigned: vicamo)

References

Details

Attachments

(1 file, 1 obsolete file)

security/sandbox/linux/Sandbox.cpp:41: error: '__NR_socketpair' was not declared in this scope
security/sandbox/linux/Sandbox.cpp:41: error: '__NR_sendmsg' was not declared in this scope
security/sandbox/linux/Sandbox.cpp:47: error: too many initializers for 'sock_filter'
security/sandbox/linux/Sandbox.cpp:47: error: too many initializers for 'sock_filter'
make[6]: *** [Sandbox.o] Error 1
make[5]: *** [security/sandbox/linux/compile] Error 2
make[5]: *** Waiting for unfinished jobs....
Attached patch patch (obsolete) — Splinter Review
__NR_sendmsg:
Android has no __NR_sendmsg syscall for sh and x86 platform.  Instead, it provides a libc function |sendmsg|, which is actually wired to |__socketcall(SYS_SENDMSG, t)|.

__NR_socketpair:
Same with __NR_sendmsg.
Attachment #8340271 - Flags: review?(jld)
Attachment #8340271 - Flags: review?(gdestuynder)
Comment on attachment 8340271 [details] [diff] [review]
patch

Review of attachment 8340271 [details] [diff] [review]:
-----------------------------------------------------------------

::: security/sandbox/linux/seccomp_filter.h
@@ +95,5 @@
> +  ALLOW_SYSCALL(fstat64), \
> +  ALLOW_SYSCALL(stat64), \
> +  ALLOW_SYSCALL(lstat64), \
> +  ALLOW_SYSCALL(socketpair), \
> +  ALLOW_SYSCALL(sendmsg), \

Non-Android x86 (32-bit) doesn't have socketpair or sendmsg either, as far as I can tell from `/usr/include/asm/unistd_32.h`.  (seccomp isn't enabled by default on desktop, and I think the work in progress for it has been tested on x86_64 only so far, so I'm not surprised if that combination was broken as well.)
Comment on attachment 8340271 [details] [diff] [review]
patch

Unifdef the ANDROID and it should be good.  Sorry for breaking the build.
Attachment #8340271 - Flags: review?(jld) → review+
Comment on attachment 8340271 [details] [diff] [review]
patch

Review of attachment 8340271 [details] [diff] [review]:
-----------------------------------------------------------------

what jld said :)
Attachment #8340271 - Flags: review?(gdestuynder) → review+
Attached patch patch : v2Splinter Review
Address previous review comments.  Thank you!

@Fabrice, this patch is for fixing build error in B2G emulator-x86.  Should have no effect on B2G emulator and devices.
Attachment #8340271 - Attachment is obsolete: true
Attachment #8342230 - Flags: review+
Attachment #8342230 - Flags: feedback?
Attachment #8342230 - Flags: feedback? → feedback?(fabrice)
Attachment #8342230 - Flags: feedback?(fabrice) → feedback+
Assignee: nobody → vyang
https://hg.mozilla.org/mozilla-central/rev/96fad9bdc012
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.