Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling net.Interfaces() on Android 30+ results in selinux errors #228

Closed
gurupras opened this issue Feb 23, 2023 · 1 comment
Closed

Calling net.Interfaces() on Android 30+ results in selinux errors #228

gurupras opened this issue Feb 23, 2023 · 1 comment

Comments

@gurupras
Copy link

Your environment.

  • Version: v2
  • Browser: NA
  • Other Information:
    • pion/webrtc: v3
Stacktrace
E/GoLog   (27844): runtime/debug.Stack()
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/bridge/android/go/src/runtime/debug/stack.go:24 +0x64
E/GoLog   (27844): runtime/debug.PrintStack()
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/bridge/android/go/src/runtime/debug/stack.go:16 +0x1c
E/GoLog   (27844): net.interfaceTable(0x0)
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/bridge/android/go/src/net/interface_linux.go:18 +0x28
E/GoLog   (27844): net.Interfaces()
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/bridge/android/go/src/net/interface.go:101 +0x20
E/GoLog   (27844): github.com/pion/transport/v2/stdnet.(*Net).UpdateInterfaces(0x400029a948)
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/pion/transport/v2@v2.0.2/stdnet/net.go:38 +0x28
E/GoLog   (27844): github.com/pion/transport/v2/stdnet.NewNet(...)
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/pion/transport/v2@v2.0.2/stdnet/net.go:27
E/GoLog   (27844): github.com/pion/ice/v2.NewAgent(0x40000cccf0)
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/pion/ice/v2@v2.3.0/agent.go:320 +0x888
E/GoLog   (27844): github.com/pion/webrtc/v3.(*ICEGatherer).createAgent(0x40002187e0)
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/pion/webrtc/v3@v3.1.55/icegatherer.go:131 +0x43c
E/GoLog   (27844): github.com/pion/webrtc/v3.(*ICEGatherer).GetLocalParameters(0x40000ccf00?)
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/pion/webrtc/v3@v3.1.55/icegatherer.go:202 +0x2c
E/GoLog   (27844): github.com/pion/webrtc/v3.(*PeerConnection).generateUnmatchedSDP(0x4000151440, {0x0, 0x0, 0x6bf41d2a70?}, 0xe8?)
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/pion/webrtc/v3@v3.1.55/peerconnection.go:2272 +0x58
E/GoLog   (27844): github.com/pion/webrtc/v3.(*PeerConnection).CreateOffer(0x4000151440, 0x40002989d0?)
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/pion/webrtc/v3@v3.1.55/peerconnection.go:681 +0x290
E/GoLog   (27844): github.com/gurupras/maxp2p.(*MaxP2P).newPeerConnection(0x40000005a0, {0x40002944f8, 0x4})
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/gurupras/maxp2p@v1.0.0/maxp2p.go:382 +0x314
E/GoLog   (27844): github.com/gurupras/maxp2p.(*MaxP2P).Start(0x40000005a0, {0x4000145630?, 0x4?, 0x40002960e8?})
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/gurupras/maxp2p@v1.0.0/maxp2p.go:149 +0x70
E/GoLog   (27844): github.com/filemingo/app/server.(*Server).getConn(0x400029a030, 0x40002a8190, {0x40002944f8, 0x4}, 0x1)
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/server/server.go:204 +0x114
E/GoLog   (27844): github.com/filemingo/app/server.(*Server).SendFiles(0x400029a030, {0x40002944f8, 0x4}, 0x4000290f00, 0x0?, 0x40002a8190)
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/server/server.go:216 +0x4c
E/GoLog   (27844): github.com/filemingo/app/server.SetupServer.func1({0x6bf4356710, 0x40002200e0}, 0x40002a6080?)
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/server/server.go:398 +0x710
E/GoLog   (27844): net/http.HandlerFunc.ServeHTTP(0x4000230300?, {0x6bf4356710?, 0x40002200e0?}, 0x6bf40708c4?)
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/bridge/android/go/src/net/http/server.go:2109 +0x38
E/GoLog   (27844): github.com/gorilla/mux.(*Router).ServeHTTP(0x400018e180, {0x6bf4356710, 0x40002200e0}, 0x40001c8800)
E/GoLog   (27844): 	/tmp/gomobile-work-106875378/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x19c
E/GoLog   (27844): net/http.serverHandler.ServeHTTP({0x40001c6990?}, {0x6bf4356710, 0x40002200e0}, 0x40001c8800)
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/bridge/android/go/src/net/http/server.go:2947 +0x2cc
E/GoLog   (27844): net/http.(*conn).serve(0x400012cd20, {0x6bf4356c90, 0x4000115e90})
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/bridge/android/go/src/net/http/server.go:1991 +0x560
E/GoLog   (27844): created by net/http.(*Server).Serve
E/GoLog   (27844): 	/home/guru/workspace/go/src/github.com/filemingo/app/bridge/android/go/src/net/http/server.go:3102 +0x444

What did you do?

Compiled a pion-based project with gomobile for use on Android

What did you expect?

Code to work as it does on other platforms

What happened?

Ran into selinux errors because the app was trying to perform certain network operations that are prohibited.

W/Thread-9(27844): type=1400 audit(0.0:252917): avc: denied { bind } for scontext=u:r:untrusted_app_30:s0:c24,c257,c512,c768 tcontext=u:r:untrusted_app_30:s0:c24,c257,c512,c768 tclass=netlink_route_socket permissive=0 app=com.example.mobile

Please see golang/go#40569 for more info.

@stv0g
Copy link
Member

stv0g commented Apr 12, 2023

This appears to be an issue in Go's standard library as you hinted with golang/go#40569

Hence, there seems nothing we can about here.

I will close this issue. This needs to be fixed elsewhere.

@stv0g stv0g closed this as completed Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants