And the only solution, it is to enforce company to offer updates and support a product for at least half a century, and enforce that any code of that product must become available and modifiable in case the company is unable to provide with such support.
If that means that company produce less products, so it is. I am tired as a consumer of having to throw away completely good products just for this reason, from ASUS routers, to car. Hopefully whatever legislation that happens to solve this situation with the industry will also affect consumer products (or at least, we could adquire industrial products instead).