The legacy implementation is out of the direct attack surface but now there is a Linux kernel involved that consists of millions of lines of source codes. As the number of software bugs grows with the size of the software, so does the number of vulnerabilities.
In case the legacy project requires real-time behaviour, the determinism of the system is compromised as Linux cannot guarantee worst case execution times (WCET). That even becomes more of a problem if there are Safety requirements.
If the system must be certified for Safety, e.g. for an airborne object, the costs for the certification of the Linux kernel would exceed any budget in terms of time and money.
Similar problems would arise for a Security certification, e.g. according to Common Criteria.
For the Automotive market there is already a reference solution available that has a focus on the protection of the internal network and field bus infrastructures. On the other hand, it allows the vehicle to securely communicate with other vehicles (V2V) and provides methods for on the air (OTG) software updates.
For more information, see the SACoP Product Page