Review: Needs Fixing
@@ -275,7 +280,18 @@
if (! state_check_json_type (json_processes, array))
goto error;
- for (i = 0; i < json_object_array_length (json_processes); i++) {
+ len = json_object_array_length (json_processes);
+
+ if (len > PROCESS_LAST) {
+ /* Detected a downgrade on re-exec scenario (where we
+ * are attempting to restore state from a newer init
+ * which contains additional processes
+ */
+ nih_warn ("%s", _("Detected unsupported downgrade on re-exec"));
+ goto error;
+ }
+
+ for (i = 0; i < len; i++) {
json_object *json_process;
nih_assert (i <= PROCESS_LAST);
The result of this is that, instead of deserializing those processes that are
known, on any downgrade to a version that tracked fewer processes, all
information will be discarded about all processes associated with jobs. This
is effectively equivalent to a stateless reexec, and is not a very graceful
handling of this case.
I don't feel very strongly in general about supporting downgrades; but in a
case such as this where you need to explicitly handle the difference in the
number of related processes, it seems to me that a graceful handling is as easy
to accomplish as the ungraceful alternative.
--
https://code.launchpad.net/~jamesodhunt/upstart/bug-530779/+merge/197080
Your team Upstart Reviewers is subscribed to branch lp:upstart.
--
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/upstart-devel