Home » Technical Topics » Data Security

Ensuring Data Security in Realtime Operating System (RTOS) Devices

  • Evan Morris 
data sec

Just a few days ago, January 28, we celebrated Data Protection Day, an international event aimed at promoting data privacy and security. In line with the goal of raising awareness about data protection, it would be a good time to discuss data security with Realtime Operating System. This unconventional operating system is widely used, so it is important to be familiar with it, especially when it comes to securing data storage and transmission through this operating system.

What is RTOS?

Realtime Operating System (RTOS) is an operating system intended for real-time applications. Unlike Unix, it does not employ schedulers, data buffers, and fixed task priorities as it manages system resource sharing. Instead, it implements rigorous time constraints to make sure that tasks or processes are completed within the expected time.

The processing in RTOS systems is characterized as preemptive and event-driven. Tasks are processed based on their priority, not on clock interrupts and other factors. If faced with multiple competing tasks, realtime operating systems can determine relative priority to ascertain that the priority tasks are the ones completed first. Task urgency is configured by the user of the system.

RTOS OSes are often used in embedded systems, industrial automation systems, and other applications that necessitate deterministic operation and the assurance of prompt response to events in a given time frame. They usually have minuscule footprints and low overhead, which make them highly suitable for embedded systems or very small devices with limited memory and processing capabilities.

Data handling in RTOS

The way data is handled in an RTOS system varies depending on the variant of RTOS. There are many of these operating systems in use at present, including FreeRTOS, BeRTOS, CapROS, DNIX, eCos, embOS, EROS, FunkOS, and LynxOS. They have different ways of dealing with data. However, generally, RTOS OSes are designed to handle data in a deterministic and predictable manner.

RTOS operating systems emphasize the need for real-time performance and the least possible latency. To achieve these, specialized data structures may be utilized. Priority queues and circular buffers, for example, may be used to ensure first-in-first-out, or FIFO processing. Real-time scheduling algorithms may also be employed to make sure that data processing proceeds in a timely manner. Also, some RTOS operating systems may feature inter-process communication (IPC) mechanisms as well as memory management tools to efficiently manage and coordinate access to data for various tasks and processes.

RTOS may have a soft or hard architecture. A soft RTOS architecture runs in hundreds of milliseconds and usually transmits relatively large file sizes. It is suitable for applications where time-based execution is not critical like in cameras and smart speakers. Meanwhile, a hard architecture entails considerably faster processing (in tens of milliseconds) and involves small file sizes. It is used in aircraft sensors, medical devices such as pacemakers, autopilot systems, and other applications where time-based execution is a critical factor.

In either architecture, predictability and the deterministic nature of outputs are vital. RTOS is used in embedded devices, which are a component of a larger system with a full-featured operating system such as Linux because it prevents response variability, which can result in quality issues, dysfunction, and even the possibility of hardware damage.

RTOS data security

Securing the data stored and processed in RTOS devices is mostly similar to how data is secured in systems that use other OSes. Encryption can be implemented to prevent unauthorized access while data is at rest or in transit. Authentication mechanisms such as password protection, digital certificates, and biometric verification can also be put in place to make sure that only authorized users and devices get access to data-sensitive data. Additionally, it helps to have granular access controls based on permissions, roles, and access lists to prevent unwanted data access without hampering the sensible use of data.

Moreover, it is possible to integrate secure boot with an RTOS system to ensure that only authorized firmware and software are executed in the system. Firewalls can also be installed to prevent unauthorized access from external networks. Virtualization is also another RTOS data security option, with the system running on virtualized environments to isolate apps from each other along with the data they store and process.

When it comes to shared memory protection, it is advisable not to rely on conventional mutex implementation. It is advisable not to use a mutex that is separate from the protected data because it does not make it clear that the shared resource is supposed to be protected. There is no guarantee that everyone will be using a mutex to access data. The better way to do it is to integrate the mutex in the data structure and treat shared memory as objects.

Another useful strategy to protect data in RTOS systems is to visualize the system. Doing this makes it easy to understand where data generation happens and the process by which data is transmitted. Having a data flow diagram untangles the complex data handling process, as it maps out important components such as the data storage points, transfer mechanisms, data producers and consumers, and task coordinators.

Addressing the black box effect

The black box effect refers to the tendency of devices to provide useful information without divulging the details as to how the information was generated. RTOS devices can exhibit this issue, as they have limited or completely absent remote monitoring functions. Being a black box does not aid security management, because it does not help in figuring out how devices or systems are compromised. It does not provide inputs on how to improve product design and secure data.

The good news is that security firms have developed solutions to address this challenge. One of the most notable solutions available is a security and observability platform that uses an embedded integrity verification (EIV) system designed to automatically profile code and memory in runtime to establish benchmarks of normal activity and block actions that are regarded as memory and code manipulation attempts.

Again, RTOS devices have very limited resources, hence they are not capable of running full-fledged security solutions on their own. To address this constraint, a separate platform for security and visibility can be integrated not only to ensure secure data storage and movements but also to provide protection from other cyber threats similar to what can be achieved with extended detection and response (XDR) systems.

Encryption, access controls, authorization, firewalls, secure boot, and virtualization are useful in securing the data that go through RTOS devices. However, it is also important to resolve the lack of observability in low-resource RTOS devices to bolster data security and overall security posture management.