Closed Bug 1391494 Opened 7 years ago Closed 7 years ago

call of overloaded 'strlcpy(char [4096], char [4096], long unsigned int)' is ambiguous

Categories

(Core :: Security: Process Sandboxing, defect, P3)

56 Branch
Unspecified
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox56 --- fixed
firefox57 --- fixed

People

(Reporter: anarchy, Assigned: gcp)

Details

(Whiteboard: sb+)

Attachments

(1 file)

var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/ff/_virtualenv/bin/python /var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/config/expandlibs_gen.py -o libsecurity_certverifier.a.desc Unified_cpp_certverifier0.o  
/usr/lib/ccache/bin/x86_64-gentoo-linux-musl-g++ -std=gnu++11 -o utf_string_conversion_utils.o -c  -I/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/ff/dist/system_wrappers -include /var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DNS_NO_XPCOM -I/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/security/sandbox/linux -I/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/ff/security/sandbox/linux -I/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/security/sandbox/linux -I/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/security/sandbox/chromium-shim -I/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/security/sandbox/chromium -I/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/nsprpub -I/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/ff/dist/include  -I/usr/include/nspr -I/usr/include/nss       -fPIC  -DMOZILLA_CLIENT -include /var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/ff/mozilla-config.h -MD -MP -MF .deps/utf_string_conversion_utils.o.pp -D_GNU_SOURCE -fstack-protector-strong -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wc++1z-compat -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-security -Wformat-overflow=2 -march=native -pipe -ggdb -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2 -fstack-protector-strong -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe  -O2 -fomit-frame-pointer  -Wno-shadow  /var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/security/sandbox/chromium/base/strings/utf_string_conversion_utils.cc
/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/security/sandbox/linux/broker/SandboxBrokerRealpath.cpp: In function 'size_t my_strlcat(char*, const char*, size_t)':
/var/tmp/portage/www-client/firefox-56.0_beta2/work/firefox-56.0b2/security/sandbox/linux/broker/SandboxBrokerRealpath.cpp:64:50: error: call of overloaded 'strlcpy(char*, const char*&, size_t)' is ambiguous
   return pos1 + strlcpy(s1 + pos1, s2, len - pos1);
Priority: -- → P5
Whiteboard: sb+
Priority: P5 → P3
It looks like musl includes the (non-standard) strlcpy itself. 

Jory, does the attached patch fix the build issue?
Flags: needinfo?(anarchy)
/usr/lib/ccache/bin/x86_64-gentoo-linux-musl-g++ -std=gnu++11 -o SandboxBrokerRealpath.o -c -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ff/dist/stl_wrappers -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ff/dist/system_wrappers -include /var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DOS_POSIX=1 -DOS_LINUX=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/security/sandbox/linux/broker -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ff/security/sandbox/linux/broker -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/security/sandbox/linux -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ff/ipc/ipdl/_ipdlheaders -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ipc/chromium/src -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ipc/glue -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/security/sandbox/chromium -I/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ff/dist/include  -I/usr/include/nspr -I/usr/include/nss       -fPIC  -DMOZILLA_CLIENT -include /var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ff/mozilla-config.h -MD -MP -MF .deps/SandboxBrokerRealpath.o.pp -D_GNU_SOURCE -fstack-protector-strong -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wc++1z-compat -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-security -Wformat-overflow=2 -march=native -pipe -ggdb -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2 -fstack-protector-strong -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe  -O2 -fomit-frame-pointer  -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  /var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/security/sandbox/linux/broker/SandboxBrokerRealpath.cpp
/var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/ff/_virtualenv/bin/python /var/tmp/portage/www-client/firefox-56.0_beta5/work/firefox-56.0b5/config/expandlibs_gen.py -o libsecurity_sandbox_linux_broker.a.desc SandboxBroker.o SandboxBrokerCommon.o SandboxBrokerPolicyFactory.o SandboxBrokerRealpath.o

That would fix the issue thank you!!
Flags: needinfo?(anarchy)
Attachment #8900814 - Flags: review?(jld)
Comment on attachment 8900814 [details]
Bug 1391494 - Enforce use of our own copy of strlcpy.

https://reviewboard.mozilla.org/r/172262/#review179542
Attachment #8900814 - Flags: review?(jld) → review+
Comment on attachment 8900814 [details]
Bug 1391494 - Enforce use of our own copy of strlcpy.

https://reviewboard.mozilla.org/r/172262/#review179612
Attachment #8900814 - Flags: review+
Pushed by gpascutto@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/10192d9e30b6
Enforce use of our own copy of strlcpy. r=jld
https://hg.mozilla.org/mozilla-central/rev/10192d9e30b6
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Comment on attachment 8900814 [details]
Bug 1391494 - Enforce use of our own copy of strlcpy.

Approval Request Comment
[Feature/Bug causing the regression]: Bug 1308400
[User impact if declined]: Compilation difficulties for some Linux distros
[Is this code covered by automated tests?]: N/A
[Has the fix been verified in Nightly?]: Landed yesterday
[Needs manual test from QE? If yes, steps to reproduce]: No
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: No.
[Why is the change risky/not risky?]: Build-time fix.
[String changes made/needed]: N/A
Attachment #8900814 - Flags: approval-mozilla-beta?
Comment on attachment 8900814 [details]
Bug 1391494 - Enforce use of our own copy of strlcpy.

Build time fix and low risk. Beta56+.
Attachment #8900814 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Assignee: nobody → gpascutto
You need to log in before you can comment on or make changes to this bug.