Software Update Destroys $286M Japanese Satellite
hackaday.com
hackaday.com
Geostationary telecom (and weather, and SIGINT, etc) satellites: In the entire history of manned spaceflight no human has ever visited geostationary orbit. Once placed in a geostationary transfer orbit (about 450 x 36,000 km) and then onwards to final geostationary orbit, nobody will ever see a satellite again. The largest ones weigh 6000 kilograms and are the size of greyhound buses. They're out there right now operating with multiply-redundant everything and cost $150 million to build and launch. It is highly unlikely that any time in the next 25 years any human will ever visit one in person or touch one. When a satellite is encapsulated in its fairing/shroud for launch that is the last time anyone will ever see it until its ultimate end of life in hopefully 15 years. Every one of its control systems needs to be so thoroughly debugged and multiply redundant that it can operate out there with absolutely zero chance of repair or parts replacement.
There have been proposals for ion engined orbital tugs to grab onto old, out-of-stationkeeping-propellant satellites that still have good electronics, for the purpose of extending their life, or moving them to a new orbital position. But nothing has actually flown.
But to get to geostationary orbit and stop there, you need rocket power. To get back, you would also need power.
Thanks, here's $5k for your hard work as part of our bounty program."
I'm not in a position to discuss bug bounty ethics or judge what the right thing to do is given the market circumstances, I'm only in a position to make an opportune joke.
But you gotta admit...it is amusing seeing very critical vulnerabilities like ubiquitous user login being reported by researchers whom get 5k or 10k for doing the right thing. These holes could instantly cripple the trust of a company's userbase and yet the people reporting them get pennies.
What other option do these researchers have? Try to sell the vuln on the black market (illegal) or to a state actor (unethical and likely illegal)? Keep quiet about what they found and not get any money/recognition?
Companies are under no obligation to pay and researchers are under no obligation (except ethics, I guess) to turn over their findings. By having some non-trivial payment the companies are encouraging people to provide cheap sec audits for them.
That's probably what GP is alluding to. They do have this option and I can imagine they could get much more money this way, with little or no way to trace the source of a 0day back to them.
> Companies are under no obligation to pay and researchers are under no obligation (except ethics, I guess) to turn over their findings. By having some non-trivial payment the companies are encouraging people to provide cheap sec audits for them.
Well, of course. The question is, whether the amount companies chose to pay is enough to get most people to report vulnerabilities instead of selling them elsewhere, or if those companies are just putting a lot of trust in the strong morals of security researchers?
Well, after talking to their CISO, it sounds like no such thing will happen. Her reason was, "It's not actually a 'bug', so it's not going to be included in a bug bounty program". So there goes that idea.
I really don't get it. I could have just as easily sold everything in there for big monies, or could have personally done havoc of my own. There's a certain point where "thanks" just doesn't feel enough, especially after the bug bounty comment.
But being able to say "$GOODTHING happened because of me" felt so much better. It just means in the end that 50% of my meals are lentil based :P.
What makes you think I'm actually messing with big corps? I'm not. I disclosed the issue properly and safely. I have a good lawyer who would step in to help if something bad happened. But hell, if something bad did happen, where I can't get out of a sentence like that, then fine. It is what it is.
But letting that fear of 30 years of prison prevent me from disclosing something that could have long term effects for millions? Fuck. That.
I wasn't even doing any of this for money. I found it, I wanted to correct it. That's it. But for their CISO to drop a giant deuce on me like that without as much as a "Thank you" from her? Heh. It's a little annoying.
I'd rather not fall into this trap: https://theintercept.com/2016/04/28/new-study-shows-mass-sur...
I really think this part:
> > I really don't get it. I could have just as easily sold everything in there for big monies, or could have personally done havoc of my own.
would have earned you a prison sentence (if caught). The most obvious ways to 'profit' from security bugs for corps with no bug bounties are illegal.
Also every technological advancement we are reducing fatality. We are not bringing it to complete zero but we are definitely reducing it.
Some mitigating factors:
- they can do slow releases. So if a serious anomaly does occur it is unlikely to be with your car.
- the conditons of space make errors much more catosptrophic. Although I can imagine similarly catosptrophic scenarios with a car, there are also more opportunities to safely rectify the situation (like the car pulling over and refusing to drive if things are not ok). In space, the satellite cannot just stop and wait for a tow truck to arrive.
- there is only one satellite to test the update on. If they screw it up, it's gone. With cars, there are many to test on, so errors will turn up and be fixed faster.
But back to the issue of risk:
Just like with drunk driving, you are at risk of somebody else's car going haywire as well, so it's a risk regardless of whether you yourself updated or not. At that point, the difference between your existing risk and the risk you take on from the update is probably not that great, so might as well just do the update.
I think it's a tradeoff. If self-driving cars can save tens of thousands of lives in the US every year, how many should we be willing to risk to enable this?
Eventually your insurance company may force this on you due to higher premiums, or government may make injuring someone in a manual car accident a crime like assault.
Tesla is the only offender I know about when it comes to real cars that actually exist and have obnoxious over-the-air update systems, because normal car companies are constrained by their contracts with dealer networks, so any software updates they might want to push on us would have to be done through the normal vehicle service program. This can easily be avoided by choosing a different mechanic. One can't very well choose a different mechanic if you are stuck a Tesla-like system that pushes diffs at you via radio, and that's what concerns me.
> High energy particles may have disrupted the onboard electronics.
If this is a problem Humanity has a bigger problem.
Humor aside I agree defects in devices that can rapidly become two ton death machines must be taken seriously. There must be safe guards at every level.
Backtrack, backtrack ... "the NOAA N-PRIME Mishap Investigation Board (MIB)" ... ah, OK.
(Men in Black movie, if that was before your time. Where the checkout line tabloid rags - clickbait before its time - were the research reports. ;-)
That's just what they want you to think.
Unfortunately, the checklist of checklists to automate is still manual :p
https://psemc.com/products/cartridge-actuated-devices-cads/e...
Why is it that good software quality is generally an afterthought in so many systems?
Here's an analogy: A weather forecaster can predict "no hurricane" every single day and have a near-perfect success rate. Needless to say, that's next to useless. (False positives and false negatives have wildly different costs in this context.)
What is your definition of "pretty much"? In my experience none of those things you mentioned have ever worked pretty much flawlessly.
A couple decades of work on compilers, dev tools, drivers, firmware, and other sorts of system software may have warped my perceptions somewhat.
(Edit: I don't say that to pretend some kind of superiority; my code is just as buggy as everyone else's. I've just had many occasions to dig around in other people's code and figure out why it stopped working, after we tried to change something that shouldn't have affected it. Hardware, too, you can't trust that either.)
Edit:
Someone alse pointed this out but it's worth reiterating - hardware systems are simulated extensively and analyzed in various ways for performance, cost, reliability and other factors. Software less so, and test cases, if they exist, might not necessarily capture all the power loss/inconsistent state problems that can occur in the real world. Maybe in the future embedded applications could be analysed with a fuzzer or something to help weed out that kind of once-in-the-field-never-in-the-lab bug.
With complex software, it's pretty dang hard to layout an entire program in specifications without going down the provably correct approach, which likely will run into limitations when the real world is involved. Waterfall dev for operating systems of the past come to mind.... Probably the best you can do is be very stringent with your coding standards, something space agencies are the masters of.
For quite a bit of software these days, the correct program and the description of the correct program are pretty similar artifacts.
My brain was going mental mobius strip when I was originally responding and thinking of something along these lines. Maybe what I was getting at is that the an idea like the Halting problem doesn't apply as viciously to hardware?
Then you get the stuff that lurks in the middle that could be a software, electrical or mechanical problem (or all 3), and that is where the bugs like this occur. I think its more a result of splitting up work into domain silos, so they do not think about problems that arise in the other domains that can be fixed easily in another. This can lead to one or more domains getting no time at all to implement their part of the system as they spent most of the time budget waiting on another domain to finish. Watchdogs and other "things are going crazy" sort of belt&braces protection are the first parts of a design to get dropped when in a time crunch.
There's so much that can go wrong in a satellite that expecting software to function well is very naive.
Besides, it's not like testing a satellite is easy as running unit testing on a Python module - there are countless operational and environmental variables that are very difficult to synthesize.
Though in truth that's mostly unrelated to this instance. Real-time control systems for satellites have always been a tough problem, and there have traditionally been growing pains for organizations tackling new designs. Even NASA has had its fair share of stumbles in that regard, for example the loss of the Mars Polar Lander and even the Mars Climate Orbiter (the famous metric/english units fuckup) were substantially due to problems with the software and operational management of the spacecraft.
If anything, it tried to do what it was supposed to: stop the satellite from spinning.
From the report:
> Feb 28, JAXA sent the commands to update the RCS control parameter based on the center of mass changes by deployment of the EOB. Through the post-incident investigation, it is confirmed the RCS control parameter on Feb 28th was not appropriate.
So the software worked as designed, but was fed crappy data.
The whole system has to be considered for success.
In software on the other hand, we're spoilt by how easy to is to fix bugs (compiling your code to generate a binary takes minutes/hours, not months, and it doesn't cost you millions of dollars), and also how easy it is to deploy fixes to customers (just release a patch and when someone complains, tell them to download it). Hence why if you're working at Google/Amazon/Apple/99%-of-software-teams, the rational thing to do is to treat reliability/testing as a 2nd class priority, not a 1st class priority.
Except that there's a small number of software applications where this doesn't hold. Where testing really does need to be treated as a 1st class priority. Problem is, the engineers and managers working in these teams belong to an industry that has a completely different mindset. A mindset that translates itself into all parts of the software stack, which these engineers are then forced to rely on. A mindset that will creep into everyone's minds, by osmosis, no matter how much they try to fight it. A mindset that works fine 99% of the time, but every now and then, leads to events exactly like this.
The famous Worse is Better, aka. 80% solution that isn't even correct (it's fine as long as it doesn't segfault in that 80% of cases) today is better than a proper solution next week.
> In satellites, the STT typically gets a good fix and sends the data to the IRU. The IRU uses the data to set its current reading and to measure how far it drifted since the last update. After calculating the drift it uses drift adjustments to compensate for the future drift. Clearly if the compensation calculation is wrong the future readings are going to be wrong. This appears to have played a role since the ACS attempted to correct a rotation that didn’t exist. The erroneous configuration information led the ACS to aggravate, not correct, the rotation.
Does this mean that error will compound if either the attitude or compensation are calculated or performed incorrectly? If so, is there a way to reduce that compounding, perhaps by making them more independent systems? Or am I reading too much into a summary? (And, you know, space is hard.)
Satellites are designed to go into "safe mode" if certain fault protection events happen, or the multiply redundant control systems/onboard computers don't agree with each other. Safe mode usually means shutting down all nonessential electrical loads and trying to orient themselves so that solar panels receive the greatest amount of charge, while listening for command and control data on their omni (L and S band) TT&C antennas.
With this event it sounds like something REALLY went wrong since not only did the satellite try to correct a nonexistant wrong orientation via its reaction wheels (reaction wheels are not nearly as powerful in real life as they are in kerbal space program), it then decided to start expending propellant and spun itself up to such a RPM of revolutions that it tore off its own solar panels, and anything else that would be vulnerable to high centrifugal G forces. Automated code that expends propellant is usually checked much more carefully than this, since the amount of propellant is fixed and non renewable, usually the primary constraint on the total service life of the satellite. Most satellites run out of stationkeeping/orientation propellant (or propellant for ion engine delta-V changes) long before their multiply redundant solar/charge controller/battery/computer control systems fail.
There are three components, one is a Controller which goes out into the world and calculates how we're oriented, the second is basically just a Model in the MVC sense (the IRU). The first Controller has a responsibility to update the Model with whatever it finds out.
The third component is a separate part of the IRU which is essentially both a view on the model (where am I pointed, where am I supposed to be pointed?) combined with a controller which fires some thrusters to try to point you in the right direction.
The problem was that the first component wasn't updating the model. Therefore the second component set "fireThruster1: true," but then never got any information that it was approaching the right direction -- therefore kept that variable set.
The thruster continuously fired, spinning the satellite around and around until it was ripped apart by centrifugal forces.
It's more the opposite. (well, not quite exactly the opposite, but I'll try to explain. It's a simplified explanation, I hope I didn't make any obvious error in the simplification)
IRU is mainly composed of gyroscope, measuring the spacecraft angular rate over three axis. They don't give you the absolute orientation. Of course, if you know the initial orientation, you could integrate angular rotation and have the current one. Except that in reality, you have several problems. The first one is that even if you have a perfect unbiased gyro, you need a continuous time integration, and not use sample every 0.X seconds. But the main problem of gyro are the instantaneous bias, and the slow change in bias over time. And when you integrate bias over a long time, the result diverge (all the type of gyroscope have these, but the level are different. There is also added noise on top and quantisation of the output. You get value over 8, 12 or 16 bits, not a real number. But integrating this should average to 0, so that's ok)
So you can't use only an IRU.
Could you use only a star tracker? Again, in an ideal world, yes. The star tracker gives you the absolute orientation and if you want the angular rate, you can get it by derivation (by differentiating, in discrete time) But the star tracker has its own problem. It cannot gives you an orientation when you turn it on, it has an acquisition phase first. It does not work when you have the sun in the field of view, or the earth, and sometimes also the moon. (it's basically a camera trying to take picture of the stars.Plus a lot of complicated software) As it includes a lot of complicated software, you don't necessarily want to use it in safe mode (software has bug. Also it uses electrical power) Sometime STT don't work when the rotation speed is too high also. And complexity also means more failure modes.
So STT only for all phases, including safe mode, if often not accepted by the system engineer/the satellite final client/the quality assurance department/... (sometimes its just not possible)
So what is usually done on satellite including both an IRU and a STT is to blend their data together. That gives you an accurate position (coming from the STT when it is ok, or by integrating the IRU data for "short" period when you get the sun in the field of view, for example), an estimation of the (current) gyro bias, and an accurate rotation rate (by using the IRU data minus the estimated bias)(this is usually based on a (extended) Kalman filter, but there are probably other methods)
With all this, you actually get a better attitude and rotation rate than IRU or STT alone. (when going in safe mode, you will probably switch to an attitude estimation based on IRU and some inaccurate but really simple sun sensor. Safe mode usually only wants to point some satellite axis to the sun with a bad accuracy, up to a few degree)
When everything works fine, it's nice.
But according to what they say, it seems that they have got an error in the algorithm (or some specific bug triggered by some strange sequence). There was the Earth in the field of view of the STT (so it was unavailable), then it has been to acquisition mode (no usable data), the tracking mode (data is good). At this point, there is a huge gap in the bias estimation (this kind of stuff happens when you re initiate a filter, or when conditions change), it's supposed to converge relatively fast to the good value (with "fast" being dependent on your algorithm). But during this convergence phase, they think that the STT did go back to acquisition mode. (for some reason, not completely clear). The estimated bias had a relatively high value (21 deg/h. Big for a bias), not corresponding to the real bias. But the satellite has keep using this value, until it finally reached safe mode.
It's not clear if it continued to use this bias value in safe mode, but it does not really matter (21 deg/h bias is not that big when you start using thrusters. It may use more fuel than needed but that's 0.3 deg/s. Relatively small). An error in other data uploaded in the software had basically transformed the safe mode to a kill mode (from what I understand, any transition to safe would have been extremely bad)
https://www.frontier.phys.nagoya-u.ac.jp/en/chubusat/chubusa...
- other systems I know of that care deeply about their attitude have multiple redundant sensors in place to "vote" on a consensus output in case one or more of them fails. Was that the case in this hardware design? If not, why not? If yes, how did the collective answer end up a constant error?
- did they have other sensors (such as a strain gauge) that could have been integrated into the model to spot-check this kind of failure mode? A rule like "If the satellite 'feels' like it's tearing itself apart, stop accelerating" could perhaps have been useful (on the other hand, it'd leave the craft vulnerable to other known failure modes, such as "thruster stuck in the on position and must be countered by another thruster to keep the craft stable," which almost killed one of the U.S. manned missions).
> but its data apparently was wrong, reporting a rotation rate of 20 degrees per hour, which was not occurring. The satellite attempted to stop this erroneous rotation using reaction wheels. The satellite configuration information uploaded earlier was wrong and the reaction wheels made the spin worse.
So both the data and configuration were both wrong, or is this one in the same?
From what I understood, the failure (the final one, in safe mode, which is not the initial error but the one which killed the satellite) seems to be an error in thrust parameters. Somewhere in the software satellite, you evaluate your rotation speed. In safe mode, you probably want to nullify this speed. Let's say that you have measured 1 deg/s around the X axis. The controller will say "give me a torque of - 10 Nms around X (10 is a made up values, and I don't take the inertia tensor into account)
The next stage of the software will convert this "-10 Nms around X" to valve opening of one or more thruster. To do this conversion, it must know how much torque is generated by each thruster. This information must be on board, but to compute it, you need: each thruster position, each thruster direction, each thruster force intensity, the satellite center of mass position.
It's not a problem, this information is available somewhere, in a database. The propulsion engineer, together with people doing the CAD model, the people computing the mass parameters, they have got these values. Someone has checked them also.
Now imagine a scenario where this has been tested but the error has not been found. I don't say it happen like this , but I've encountered this kind of situations. Fortunately, always before launches ;-)
Let's look at the simulator side. What does it need to simulate the actuation of this thruster? Basically, the same information. If the valve is open for t secondes, the torque is t*(F x r). Where does it get this value? Same database, it's the same spacecraft, the same thruster, the same position, the same direction, ...
It absolutely makes sense to not duplicate this value.
But what happens if the value is wrong? For example, if the database says that you should have the thrust vector direction, but you put the direction of the mass flow? You just get -T instead of T for this thruster, both on the simulator and the software. Not a problem, your simulation can still works. (if you do it only for one thruster, it may not work, as you may not have control around one axis. But if you do it for all, or maybe for just two opposite thruster, it still works. It may be or may not be noticed that it does not makes sense)
The verification of this database is an extremely difficult (and boring, IMHO) job. You have trap everywhere. You have this kind of sign error, you need to know if the rotation matrix is from reference frame A to B, or B to A, does a 1 in a bit field means actuating your RW CCW or CW, is the tachometer of the wheel in the same direction, how are the thruster numbered from 1 to X, bonus if you have multiple different ordering method because the software guy, the electrical guy and the mechanical guy use a different one...) And this base is huge. (people managing this merit respect, but we prefer to yell at them because they are always late. Due to our own input, of course)
They had updated parameter in the software describing the torque generated by each thruster (or the center of mass position, or the tensor of inertia, or parameters based on all this) These parameter are software parameters, but updating them is not updating the software. It's software data, not software code.
Of course this does not change the fact that it is a critical error, but it's not exactly software update (IHMO). It's a configuration error. It's strange that they didn't see that in a simulator before updating them, but it's possible that they may have used the same value in the part simulating the software and the part simulating the thrusters themselves.
(note: I'm working in the satellite on-board software/attitude control domain, but not for JAXA, in Europe. Anyway at my current position, I must both test this kind of code, and the parameter used in the code. And checking the parameters is much more difficult, because you must be sure that everyone agree on everything. This includes a lot of basic stuff, but it's a pain in the ass ;-) )
This pdf from JAXA is probably the initial source of all articles. http://global.jaxa.jp/press/2016/04/files/20160428_hitomi.pd... I found it interesting to read, if you know how it works. I would of course prefer to have more detains. I always want more details. But it's for the press...
The STT and IRU disagreed on the attitude of the satellite.
In this case the IRU takes priority, but its data
apparently was wrong, reporting a rotation rate of 20
degrees per hour, which was not occurring.
Starting from there it would have no way of knowing about the true value of 'X', so the feedback loop was fed with wrong data and just kept taking decisions† that made things worse, especially given that: The satellite configuration information uploaded earlier
was wrong and the reaction wheels made the spin worse.
[...]
the ACS attempted to correct a rotation that didn’t exist.
The erroneous configuration information led the ACS to
aggravate, not correct, the rotation.
† Even without misconfiguration, stopping an object from spinning in a vacuum isn't as direct and linear as accelerating/braking in a car, requiring precise coordination of multiple fixed thrusters and/or reaction wheels.I didn't write or are aware of much of the code I'm part of.
Or remember some of the code I did write.
Or even understand the ramifications of what the change log means.
All assuming it's a well written change log.
You need external process to ensure upgrades don't break things.
Not a 'read the change log' policy so someone can blame you post breakage cause then it'll be easy to find issues in the change log.
Yes...
boom...
I hope you lighten up. Peace.
If you want to solve a math problem, then a computer plus a proper algorithm will suffice. If you want to design a system that interacts with its environment and can achieve goals while maintaining homoeostasis, the name for that is Cybernetics.
"Introduction to Cybernetics" by Ashby has been made freely available in PDF form by his estate. A great and noble service for which I commend them. http://pespmc1.vub.ac.be/ASHBBOOK.html