Comments (6)
Such strings used to be sanitized before letting them on DBus. I'm guessing that code was somehow lost in a refactor at some point.
from wpantund.
I encountered the same issue, which for me was caused by a networkname of exactly 16 characters. Create any Thread network with a networkname of 16 characters, then scan with wpanctl. wpantund will crash:
wpantund[28027]: Scan -> Name:codelabacodelabb���z���z�, PanId:0xC0DE, Ch:11, Joinable:NO , XPanId:0xC0DE7AB5C0DE7AB5, HwAddr:0x62991E21E38AE4B5, RSSI:-39 , LQI:54 , ProtoId:3 , Version: 0, ShortAddr:0xFFFF
process 28027: arguments to dbus_message_iter_append_basic() were incorrect, assertion "_dbus_check_is_valid_utf8 (*string_p)" failed in file ../../../dbus/dbus-message.c line 2753.
This is normally a bug in some application using the D-Bus library.
wpantund[28027]: DBUSIPCServer.cpp:194: Requirement Failed (dbus_connection_get_unix_fd(mConnection, &unix_fd))
On the wpanctl side:
wpanctl:utun7> scan
| Joinable | NetworkName | PAN ID | Ch | XPanID | HWAddr | RSSI
---+----------+--------------------+--------+----+------------------+------------------+------
scan: error: Server returned a bad response ('s')
Error 4 (0x04)
from wpantund.
Do you have an SNIFFER log of the network when this occurs?
In my case - it was another (rouge device - in a co-workers office) that was broadcasting a bad/INVALID network name over the air
Meaning - I saw the illegal network name comming from something not on my network.
from wpantund.
No I wasn't using a sniffer, and I had formed the network myself. A 16 character networkname like the one I used ("codelabacodelabb") should be valid, but is not. Any 16 character networkname I tried resulted in the same crash.
So seems to be two different scenarios causing this crash... wpantund needs to be updated to handle illegal and 16 character network names.
from wpantund.
Hmm - 16bytes is a often a magic number.
There's a funkyness with the strcpy() function if the two strings overlap each other by a certain amount that shows up in for example situations like this:
char buf[20];
strcpy( buf, "Xhello, world" );
/* goal here is to remove the X from the string */
/* this is the bug: the strings overlap */
strcpy( buf, buf+1 );
Technically - this is not allowed - (go RTFM...) what happens is one of 2 things:
Option 1 - the string functions are simple C functions and not optimized.
Option 2 - the string functions are written in hand optimized assembly, and use funky opcodes for speed... (this is found in places like linux glibc) those funky opcodes and tricks do not work when the strings overlap each other - and depending upon the architecture often do things wrong in exactly 16byte increments.
And this is cpu architecture specific -
I've been writing C code for a very long time and I only learned about this in the last year or so... You learn something every day.
What you describe smells like this type of bug, but then I'm only guessing.
I would setup a sniffer and sniff your NCP/WPANTUND configuration and see if it is transmitting garbage or not {goal being to divide the problem in 2 ie: is this problem from the "set the network name" side, or is it in the "get the network name" side}
from wpantund.
Adressed by #420. Closing issue.
from wpantund.
Related Issues (20)
- Error code definition with wpanctl in Diagnostic mode HOT 1
- Unit wpantund.service could not be found. HOT 4
- ping a node in thread network with the ipv6 address. HOT 2
- removing devices from a thread network. HOT 5
- Unable to forward NCP logs HOT 6
- Bidirectional IPv6 reachability between Thread and Ethernet/Wi-Fi HOT 1
- joiner -e <psk> fails on NCP firmware HOT 1
- Cross compile configure error: Unable to find a usable implementation of boost::signals2 HOT 1
- Build errors on macOS HOT 3
- New Release ?
- stack-buffer-overflow in metric_len
- wpantund on NCP? HOT 6
- NCP is in offline state HOT 6
- configure: error: Package requirements (dbus-1 >= 1.4) were not met: HOT 2
- Unexpected reset on connected board HOT 1
- Install doesn't create a wpantund.service on Ubuntu 21.10 HOT 8
- wpantund.service is not running by default
- HomeBrew Formulae ist deprecated; manual installation is not applicable. HOT 2
- brew install for OSX no formulae exists HOT 1
- Problem with wpanctl getprop HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpantund.