vooon / ntpd_driver Goto Github PK
View Code? Open in Web Editor NEWThis node convert ROS TimeReference message to ntpd-shm format.
License: BSD 3-Clause "New" or "Revised" License
This node convert ROS TimeReference message to ntpd-shm format.
License: BSD 3-Clause "New" or "Revised" License
This package is released for up to Lunar but does not have a Melodic release. The package is very useful and would be nice to have in Melodic. Thanks!
Hi,
We notice that you are using topic name from ROS parameter at the following locations:
ntpd_driver/src/shm_driver.cpp
Line 230 in b8b9e1d
Although parameters are usually set in parameter files, they can also be changed by nodes. Specifically, other nodes in the same ROS application can also change the parameters listed above before it’s used, either by accident or intentionally (i.e., by potential attackers). If the ~/time_ref_topic
parameter is changed, the shm_driver node will subscribe to a wrong topic, which can interrupt the sending of TimeReference message. If an attacker exists, she can control the time by first fooling the shm_driver node to subscribe to a wrong topic like ~/time_ref_fake
, and then forwarding messages from topic ~/time_ref
to ~/time_ref_fake
after changing the contents. The robot’s behavior may be changed in various ways based on what the downstream applications are that read from the ntpd. Because ROS is an OSS (open-source software) community, third-party nodes are widely used in ROS applications, usually without complete vetting of their behavior, which gives the opportunity to potentially malicious actors to inject malicious code (e.g, by submitting hypocrite commits like in other OSS systems [1]) to infiltrate the ROS applications that use it (or software supply chain attacks, one of the primary means for real-world attackers today [2]).
We understand that using parameters to set topic names brings flexibility. Still, for the purpose of security, we strongly suggest that you avoid such vulnerable programming patterns if possible. For example, to avoid the exposure of this specific vulnerability, you may consider alternatives like remapping, which is designed for configuring names when launching the nodes.
[1] Q. Wu and K. Lu, “On the feasibility of stealthily introducing vulnerabilities in open-source software via hypocrite commits,” 2021, https://linuxreviews.org/images/d/d9/OpenSourceInsecurity.pdf.
[2] Supply chain attacks are the hacker’s new favourite weapon. and the threat is getting bigger. https://www.zdnet.com/article/supply-chain-attacks-are-the-hackers-new-favourite-weapon-and-the-threat-is-getting-bigger/.
hello,thanks for your work, if i want to use this will i need to install some package before?
and can i change the server ip "127.127.28.2" ?
i want to know details
Hello,
I am running ROS Noetic and chrony.
I am running the ntpd_driver with rosrun _shm_driver:=0 _time_ref_topic:=/mini_2/mavros/time_reference _fixup_enabled:=true __ns:=mini2
. I do not seem to have any permissions issue.
My /etc/chrony/chrony.conf file includes refclock SHM 0 delay 0.5 refid ROS
Running sudo chronyc sources shows the ROS source as unreachable.
rosnode info /mini_2/ntpd_shm
shows the node is subscribed to my /mini_2/mavros/time_reference topic, which is being published on via a recorded bag as a TimeReference message.
I am unsure why the source is still shown as unreachable. I installed via apt. I have used the repo previously and installed with catkin in ROS Melodic and have had success with the same setup. Any help would be appreciated
Hi @vooon I'm attempting to set up ntpd_driver
OS : ubuntu 20.04 LTS
H/W : Raspberry Pi 4
ROS Version : Noetic
I've built the package from source(unable to locate it on apt)
Using Chrony and configured it as
### SHM driver refclock SHM 0 delay 0.5 refid ROS
I've configured /etc/sudoers with
%sudo ALL=NOPASSWD: /bin/date
On trying to run the example
rosrun ntpd_driver shm_driver _shm_unit:=0 _time_ref_topic:=/mavros/time_reference
I get the following error
[ INFO] [1618212098.567542010]: NTP time source: /mavros/time_reference [ INFO] [1618212098.569852429]: NTP date fixup: disabled [FATAL] [1618212098.569990891]: SHM shmget(0x4e545030, 96, 666) fail: Permission denied
Thanks.
When I run ntpd_driver with chrony, I got a permission error on shmget().
So, I add a permission setting for chrony.conf file and error was gone.
refclock SHM 0:perm=0666 delay 0.5 refid ROS
Is this coping correct?
Or, do I need another method?
My environment is as bellow.
OS : Ubuntu 16.04
ROS : Kinetic
chrony : 2.1.1 (installed by apt)
Hello
I set up the package and and I'm publishing the sensor_msgs/timereference topic 10 Hz. Also started the node and it says:
SHM(0) key 0x....,successfully opened.
bt when I check chronyc sources, it gives all zeros.
Any help would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.