GithubHelp home page GithubHelp logo

vooon / ntpd_driver Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 6.0 70 KB

This node convert ROS TimeReference message to ntpd-shm format.

License: BSD 3-Clause "New" or "Revised" License

CMake 14.91% C++ 43.87% Python 41.22%
ros ros-node ntpd ntpd-driver shm

ntpd_driver's People

Contributors

decabyte avatar vooon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ntpd_driver's Issues

Needs Melodic Release

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!

Potential vulnerability: topic name from ROS parameter

Hi,

We notice that you are using topic name from ROS parameter at the following locations:

time_ref_sub = nh.subscribe(time_ref_topic, 10, time_ref_cb,

For security reasons detailed below, we strongly suggest avoiding the usage of strings from parameters as topic name.

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/.

ROS Noetic chrony no time sync

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.

Screenshot from 2022-07-22 11-48-37

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.

Screenshot from 2022-07-22 11-51-57

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.
Screenshot from 2022-07-22 11-54-17

Screenshot from 2022-07-22 11-57-26

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

SHM permission error

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.

chrony SHM permission setting

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)

Can't get system to sync with the topic

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.

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.