GithubHelp home page GithubHelp logo

sctp_nke_yosemite's People

Contributors

tuexen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sctp_nke_yosemite's Issues

No ABORT is sent on reception of a DATA chunk followed by control length of length less than 16

The following packetdrill script shows the problem:

`sysctl -w net.inet.sctp.strict_data_order=1`
// Create a non-blocking 1-to-1 style socket
 0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
+0.0 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
+0.0 setsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=100, srto_max=800, srto_min=100}, 16) = 0
// Trigger the active associtation setup
+0.1 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.0 > sctp: INIT[flgs=0, tag=1, a_rwnd=..., os=..., is=..., tsn=1, ...]
+0.0 < sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=1500, os=1, is=1, tsn=1, STATE_COOKIE[len=4, val=...]]
+0.0 > sctp: COOKIE_ECHO[flgs=0, len=4, val=...]
+0.0 < sctp: COOKIE_ACK[flgs=0]
// Check if the setup was sucessful
+0.0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
// Inject a DATA chunk followed by a control chunk
+0.0 < sctp: DATA[flgs=BE, len=1016, tsn=1, sid=0, ssn=0, ppid=0];
             HEARTBEAT[flgs=0, HEARTBEAT_INFORMATION[len=4, val=...]]
+0.0 > sctp: ABORT[flgs=0x00, PROTOCOL_VIOLATION[info="DATA chunk followed by chunk of type 04"]]

SHUTDOWN is accepted even if incoming user data is missing

Why does the following script does not issue an ABORT in response to the SHUTDOWN?

// Create a blocking 1-to-1 style socket
+0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
+0.0 bind(3, ..., ...) = 0
+0.0 listen(3, 1) = 0
+0.0 < sctp: INIT[flgs=0, tag=1, a_rwnd=1500, os=1, is=1, tsn=1]
+0.0 > sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=..., os=..., is=..., tsn=1, ...]
+0.1 < sctp: COOKIE_ECHO[flgs=0, len=..., val=...]
+0.0 > sctp: COOKIE_ACK[flgs=0]
+0.0 accept(3, ..., ...) = 4
+0.0 close(3) = 0

// Inject the first message and verify the immediate sending of a SACK
+0.0 < sctp: DATA[flgs=BE, len=116, tsn=1, sid=0, ssn=0, ppid=0]
+0.0 read(4, ..., 200) = 100
+0.0 > sctp: SACK[flgs=0, cum_tsn=1, a_rwnd=..., gaps=[], dups=[]]
// Inject the third message (the second is missing)
+0.0 < sctp: DATA[flgs=BE, len=116, tsn=3, sid=0, ssn=3, ppid=0]
// Check if a SACK with a gap report is sent immediately
+0.0 > sctp: SACK[flgs=0, cum_tsn=1, a_rwnd=..., gaps=[2:2], dups=[]]

// Tear down the association
+1.0 < sctp: SHUTDOWN[flgs=0, cum_tsn=0]
+0.0 > sctp: SHUTDOWN_ACK[flgs=0]
+0.0 < sctp: SHUTDOWN_COMPLETE[flgs=0]
+0.0 close(4) = 0

No ABORT is sent on reception of a DATA chunk which is too short

The problem can be triggered by the following packetdrill script:

// Create a non-blocking 1-to-1 style socket
 0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
+0.0 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
+0.0 setsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=100, srto_max=800, srto_min=100}, 16) = 0
// Trigger the active associtation setup
+0.1 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.0 > sctp: INIT[flgs=0, tag=1, a_rwnd=..., os=..., is=..., tsn=1, ...]
+0.0 < sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=1500, os=1, is=1, tsn=1, STATE_COOKIE[len=4, val=...]]
+0.0 > sctp: COOKIE_ECHO[flgs=0, len=4, val=...]
+0.0 < sctp: COOKIE_ACK[flgs=0]
// Check if the setup was sucessful
+0.0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
// Inject a too short DATA chunk (len can be 4..15)
+0.0 < sctp: CHUNK[type=0x00, flgs=0x00, len=4, val=[]]
+0.0 > sctp: ABORT[flgs=0x00, PROTOCOL_VIOLATION[info="DATA chunk of length 4"]]

Handling of SHUTDOWN_ACK chunks when the verification tag does not match

When a packet containing a SHUTDOWN-ACK chunk is received with a wrong verification tag, it is still responded with a SHUTDOWN-COMPLETE chunk and the T-bit set. The actual association is not affected. See sctp-imh-i-3-9. The following shows FreeBSD's behaviour:

+0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
+0.0 bind(3, ..., ...) = 0
+0.0 setsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=100, srto_max=800, srto_min=100}, 16) = 0
+0.0 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0.0 listen(3, 1) = 0
+0.0 < sctp: INIT[flgs=0, tag=1, a_rwnd=1500, os=1, is=1, tsn=1]
+0.0 > sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=..., os=..., is=..., tsn=1, ...]
+0.0 < sctp: COOKIE_ECHO[flgs=0, len=..., val=...]
+0.0 > sctp: COOKIE_ACK[flgs=0]
+0.0 accept(3, ..., ...) = 4
+0.0 close(3) = 0
+0.0 close(4) = 0
+0.0 > sctp: SHUTDOWN[flgs=0, cum_tsn=0]
+0.0 < sctp(tag=3): SHUTDOWN_ACK[flgs=0]
+0.0 > sctp: SHUTDOWN_COMPLETE[flgs=T]
+0.1 > sctp: SHUTDOWN[flgs=0, cum_tsn=0]
+0.0 < sctp: SHUTDOWN_ACK[flgs=0]
+0.0 > sctp: SHUTDOWN_COMPLETE[flgs=0]

KPI issue. Kext not loading due to unresolved symbols KXLD freaking out

I am trying to get a kext loaded for a fusion-io (ioDrive II) card. The kext was originally from the Yosemite bundle that SanDisk (at the time maybe even still Fusion-io themselves?) released. Now I am trying to make it load on ElCapitan. The bundle installs fine and after compulsory restart I end up with a kext in my Extensions folder. The problem is it doesn't load! Here is what terminal tells me:

sh-3.2# kextutil -t /System/Library/Extensions/iomemory-vsl.kext
Notice: /System/Library/Extensions/iomemory-vsl.kext has debug properties set.
Diagnostics for /System/Library/Extensions/iomemory-vsl.kext:
Code Signing Failure: not code signed
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext "/System/Library/Extensions/iomemory-vsl.kext"
kext signature failure override allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext "/System/Library/Extensions/iomemory-vsl.kext"
(kernel) kxld[com.fusionio.driver.iomemory-vsl]: The following symbols are unresolved for this kext:
(kernel) kxld[com.fusionio.driver.iomemory-vsl]: __ZN8IOMapper11NewARTTableEyPPvPj
(kernel) kxld[com.fusionio.driver.iomemory-vsl]: __ZN8IOMapper12FreeARTTableEP6OSDatay
(kernel) Can't load kext com.fusionio.driver.iomemory-vsl - link failed.
(kernel) Failed to load executable for kext com.fusionio.driver.iomemory-vsl.
(kernel) Kext com.fusionio.driver.iomemory-vsl failed to load (0xdc008016).
(kernel) Failed to load kext com.fusionio.driver.iomemory-vsl (error 0xdc008016).
Failed to load /System/Library/Extensions/iomemory-vsl.kext - (libkern/kext) link error.
Check library declarations for your kext with kextlibs(8).
sh-3.2# kextlibs /System/Library/Extensions/iomemory-vsl.kext
For all architectures:
com.apple.iokit.IOStorageFamily = 2.1
com.apple.kpi.bsd = 15.6
com.apple.kpi.iokit = 15.6
com.apple.kpi.libkern = 15.6
com.apple.kpi.mach = 15.6

For x86_64:
11 symbols not found in any library kext.

It looks like it could be an easy fix? I am by no means an expert, but I am sure there must be a way? Any suggestions/help would be much appreciated.

Inconsistent error handling

Should an ABORT chunk indicating a protocol violation be sent if

  • a chunk with an inconsistent chunk length is received
  • partial chunks are received
  • a SHUTDOWN bundled with a DATA chunk is received
  • a SHUTDOWN-ACK bundled with a DATA chunk is received
  • control chunks follow DATA chunks in a packet
  • an INIT-ACK chunk bundled with another chunk is received
  • a SHUTDOWN-COMPLETE chunk bundled with another chunk is received

ERROR chunks sent without padding

The following packetdrill script:

 0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
+0.0 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
// Trigger the active associtation setup
+0.1 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.0 > sctp: INIT[flgs=0, tag=1, a_rwnd=..., os=..., is=..., tsn=1, ...]
// Inject an INIT-ACK with an unknown parameter using the upper bits 11.
+0.0 < sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=1500, os=1, is=1, tsn=1,
                      PARAMETER[type=0xc00c, len=5, val=[0xff]],
                      STATE_COOKIE[len=4, val=...]]
// Verify that the SUT reports the unknown parameter
+0.0 > sctp: COOKIE_ECHO[flgs=0, len=4, val=...];
             ERROR[flgs=0, UNRECOGNIZED_PARAMETERS[params=[PARAMETER[type=0xc00c, len=5, val=[0xff]]]]]

triggers the sending of an unpadded ERROR chunk.
This is a special case of sctp-e-i-6-5.

Kernel module not loading in El Capitan

Here is what I get when trying to load the module:

โžœ ~ sudo kextutil /System/Library/Extensions/SCTP.kext
Diagnostics for /System/Library/Extensions/SCTP.kext:
Code Signing Failure: not code signed
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext "/System/Library/Extensions/SCTP.kext"
(kernel) kxld[org.sctp.nke.SCTP]: In interface org.sctp.kpi.sctpsupport of kernel, couldn't find symbol _nd_ifinfo

(kernel) kxld[org.sctp.nke.SCTP]: In interface org.sctp.kpi.sctpsupport of kernel, couldn't find symbol _nd_ifinfo_indexlim

(kernel) kxld[org.sctp.nke.SCTP]: The following symbols are unresolved for this kext:
(kernel) kxld[org.sctp.nke.SCTP]: _nd_ifinfo
(kernel) kxld[org.sctp.nke.SCTP]: _nd_ifinfo_indexlim
(kernel) Can't load kext org.sctp.nke.SCTP - link failed.
(kernel) Failed to load executable for kext org.sctp.nke.SCTP.
(kernel) Kext org.sctp.nke.SCTP failed to load (0xdc008016).
(kernel) Failed to load kext org.sctp.nke.SCTP (error 0xdc008016).
Failed to load /System/Library/Extensions/SCTP.kext - (libkern/kext) link error.
Check library declarations for your kext with kextlibs(8).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.