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

ERRNO 84 on recv() #48

Closed
polybassa opened this issue Jul 28, 2021 · 2 comments
Closed

ERRNO 84 on recv() #48

polybassa opened this issue Jul 28, 2021 · 2 comments

Comments

@polybassa
Copy link

Hi, I recently discovered an error during receive. This error was discovered during some tests from Scapy.

Here is a log from python:

>>> load_contrib("isotp")
>>> s = ISOTPNativeSocket("vcan0", did=0x587, sid=0x607)
>>> s.recv()
WARNING: Captured no data. [Errno 84] Invalid or incomplete multibyte or wide character
Traceback (most recent call last):
  File "/home/nils/PycharmProjects/secdev_scapy/scapy/contrib/isotp/isotp_native_socket.py", line 332, in recv_raw
    pkt, _, ts = self._recv_raw(self.ins, x)
  File "/home/nils/PycharmProjects/secdev_scapy/scapy/supersocket.py", line 130, in _recv_raw
    pkt, ancdata, flags, sa_ll = sock.recvmsg(x, flags_len)
OSError: [Errno 84] Invalid or incomplete multibyte or wide character

Anyway, I could track this error down and found a way to reproduce it. Here is a candump file, which triggers this error.
candump_error.log

This error can even be triggered on isotprecv. I've attached a patch to show this error.
isotprecv.patch.txt

This patch produces the following output:

 ./isotprecv -d 587 -s 607 vcan0
received -1, 84

I've sent the malformed CAN messages with canplayer like this:

canplayer -I candump_error.log vcan0=can1 

From my first quick analysis, this bug comes from somewhere underneath the isotp-kernel module.

@polybassa
Copy link
Author

I'm running this on Linux 5.10.42-1-MANJARO #1 SMP PREEMPT Thu Jun 3 14:37:11 UTC 2021 x86_64 GNU/Linux

@polybassa
Copy link
Author

Ok, I figured out that this issues is because my PC is missing some consecutive frame.

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

1 participant