Closed Bug 1709617 Opened 4 years ago Closed 4 years ago

sctp_userspace_get_mtu_from_ifn should not try to get MTU from socket

Categories

(Core :: WebRTC: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: gerard-majax, Assigned: gerard-majax)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

From bug 1434134:

(gdb) bt
#0  mozilla::SandboxPolicyCommon::SocketpairDatagramTrap(sandbox::arch_seccomp_data const&, void*) (aArgs=..., aux=0x0) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/security/sandbox/linux/SandboxFilter.cpp:449
#1  0x00007f8a0b2ee04b in sandbox::Trap::SigSys(int, siginfo_t*, ucontext_t*) (this=<optimized out>, nr=<optimized out>, info=<optimized out>, ctx=<optimized out>) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc:251
#2  0x00007f8a0b322db4 in mozilla::SigSysHandler(int, siginfo_t*, void*) (nr=31, info=0x7f89fc26c4f0, void_context=0x7f89fc26c3c0) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/security/sandbox/linux/Sandbox.cpp:135
#3  0x00007f8a0b28b140 in <signal handler called> () at /lib/x86_64-linux-gnu/libpthread.so.0
#4  0x00007f8a0ae7e4aa in socketpair () at ../sysdeps/unix/syscall-template.S:120
#5  0x00007f8a0b32b8c8 in mozilla::ContentSandboxPolicy::FakeSocketTrapCommon(int, int, int) (domain=<optimized out>, type=524290, protocol=0) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/security/sandbox/linux/SandboxFilter.cpp:1007
#6  mozilla::ContentSandboxPolicy::FakeSocketTrap(sandbox::arch_seccomp_data const&, void*) (aArgs=<optimized out>, aux=<optimized out>) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/security/sandbox/linux/SandboxFilter.cpp:1015
#7  0x00007f8a0b2ee04b in sandbox::Trap::SigSys(int, siginfo_t*, ucontext_t*) (this=<optimized out>, nr=<optimized out>, info=<optimized out>, ctx=<optimized out>) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc:251
#8  0x00007f8a0b322db4 in mozilla::SigSysHandler(int, siginfo_t*, void*) (nr=31, info=0x7f89fc26d1f0, void_context=0x7f89fc26d0c0) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/security/sandbox/linux/Sandbox.cpp:135
#9  0x00007f8a0b28b140 in <signal handler called> () at /lib/x86_64-linux-gnu/libpthread.so.0
#10 0x00007f8a0ae7e477 in socket () at ../sysdeps/unix/syscall-template.S:120
#11 0x00007f8a0ae7e593 in __opensock () at ../sysdeps/unix/sysv/linux/opensock.c:65
#12 0x00007f8a0ae96744 in __if_indextoname (ifindex=ifindex@entry=4294967295, ifname=ifname@entry=0x7f89fc26d720 "") at ../sysdeps/unix/sysv/linux/if_index.c:226
#13 0x00007f8a01524a89 in sctp_userspace_get_mtu_from_ifn (if_index=1, if_index@entry=4294967295, af=123) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/netwerk/sctp/src/netinet/sctp_userspace.c:105
#14 0x00007f8a01516f9e in sctp_add_addr_to_vrf (vrf_id=vrf_id@entry=0, ifn=ifn@entry=0x0, ifn_index=ifn_index@entry=4294967295, ifn_type=<optimized out>, ifn_type@entry=0, if_name=0x7f89fe42a454 "conn", ifa=ifa@entry=0x0, addr=0x7f89fc26d808, ifa_flags=0, dynamic_add=0)
    at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/netwerk/sctp/src/netinet/sctp_pcb.c:594
#15 0x00007f8a0153d29f in usrsctp_register_address (addr=<optimized out>) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/netwerk/sctp/src/user_socket.c:3153
#16 0x00007f8a0154a5d5 in mozilla::DataChannelConnection::Init(unsigned short, unsigned short, mozilla::Maybe<unsigned long> const&)::$_1::operator()() const (this=0x7f89fa923420) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/netwerk/sctp/datachannel/DataChannel.cpp:608
#17 mozilla::detail::RunnableFunction<mozilla::DataChannelConnection::Init(unsigned short, unsigned short, mozilla::Maybe<unsigned long> const&)::$_1>::Run() (this=0x7f89fa923400) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/obj-browser/dist/include/nsThreadUtils.h:534
#18 0x00007f8a00f3429e in nsThread::ProcessNextEvent(bool, bool*) (this=0x7f8a0ab9abb0, aMayWait=<optimized out>, aResult=<optimized out>) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/xpcom/threads/nsThread.cpp:1153
#19 0x00007f8a00f37e38 in NS_ProcessNextEvent(nsIThread*, bool) (aThread=0x1, aMayWait=true) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/xpcom/threads/nsThreadUtils.cpp:548
#20 0x00007f8a01052bbf in mozilla::net::nsSocketTransportService::Run() (this=0x7f89fcb1f580) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/netwerk/base/nsSocketTransportService2.cpp:1200
#21 0x00007f8a010537fd in non-virtual thunk to mozilla::net::nsSocketTransportService::Run() () at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/netwerk/base/nsSocketTransportService2.cpp:1279
#22 0x00007f8a00f3429e in nsThread::ProcessNextEvent(bool, bool*) (this=0x7f8a0ab9abb0, aMayWait=<optimized out>, aResult=<optimized out>) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/xpcom/threads/nsThread.cpp:1153
#23 0x00007f8a00f37e38 in NS_ProcessNextEvent(nsIThread*, bool) (aThread=0x1, aThread@entry=0x7f8a0ab9abb0, aMayWait=false) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/xpcom/threads/nsThreadUtils.cpp:548
#24 0x00007f8a015d6868 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) (this=0x7f89fcb82f00, aDelegate=0x7f89fc26dc70) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/ipc/glue/MessagePump.cpp:300
#25 0x00007f8a0155cfa6 in MessageLoop::RunInternal() (this=0x80002) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/ipc/chromium/src/base/message_loop.cc:335
#26 MessageLoop::RunHandler() (this=0x80002) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/ipc/chromium/src/base/message_loop.cc:328
#27 MessageLoop::Run() (this=0x80002) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/ipc/chromium/src/base/message_loop.cc:310
#28 0x00007f8a00f31b57 in nsThread::ThreadFunc(void*) (aArg=0x7f89fcb85940) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/xpcom/threads/nsThread.cpp:395
#29 0x00007f8a0ad77cd5 in _pt_root (arg=0x7f89fc08edc0) at /home/alexandre/Documents/codaz/Mozilla/MiscWork/mozilla-source/mozilla-unified/nsprpub/pr/src/pthreads/ptthread.c:201
#30 0x00007f8a0b27fea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#31 0x00007f8a0ae7cdef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

There's a socket() call generated by sctp_userspace_get_mtu_from_ifn to read MTU, which should not happen.

I agree, that in this case (using an AF_CONN address) it doesn't make sense, to get the MTU from the system, which seems to require to have a socket. I'll fix this and report back.

The issue should by fixed in:

(In reply to Michael Tüxen from comment #2)

The issue should by fixed in:

Thanks, I can confirm it's good locally at least, I've pushed it to try with my changes from bug 1434134: https://treeherder.mozilla.org/jobs?repo=try&revision=570cc23ecb13791d34ebf40d85c2e9899f274c0d

Cherry-picked patches from upstream using:
for commit in 7f0e11fa29ad83194b60180fdf64a0ea4908549a acfce46e428cc084b4bd0164e1b019261a8dbeda; do
curl -vsSL https://github.com/sctplab/usrsctp/commit/${commit}.patch | patch -d netwerk/sctp/src/ -p 2;
done;

Assignee: nobody → lissyx+mozillians
Status: NEW → ASSIGNED
Component: DOM: Networking → WebRTC: Networking
Severity: -- → S3
Priority: -- → P2
Pushed by alissy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e6921fac394a Don't generate socket() in content process for getting MTU r=jesup

Cherry-picked patches from upstream using:
for commit in 7f0e11fa29ad83194b60180fdf64a0ea4908549a acfce46e428cc084b4bd0164e1b019261a8dbeda; do
curl -vsSL https://github.com/sctplab/usrsctp/commit/${commit}.patch | patch -d netwerk/sctp/src/ -p 2;
done;

Attachment #9221401 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: