summaryrefslogtreecommitdiffstats
path: root/discover/pxe-parser.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-02-09 15:14:22 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-02-27 11:43:36 +1100
commitdc85de97c79c2172a87fc95cca16e6c6055dc1f4 (patch)
tree77d66129e6d07fdae0894ad8e5b823736c57c103 /discover/pxe-parser.c
parentaa23987dd043f7c8bea5a48bd9476a4ca1620069 (diff)
downloadtalos-petitboot-dc85de97c79c2172a87fc95cca16e6c6055dc1f4.tar.gz
talos-petitboot-dc85de97c79c2172a87fc95cca16e6c6055dc1f4.zip
discover: Allow load_async_url() to call callback for local paths
Several pxe-parser tests fail because the test harness's version of load_async_url() will call the callback directly, but in pxe-parser the caller checks if the path was local and calls the callback immediately. Being called twice, a use-after-free occurs in the callback. For consistency change the load_async_url() semantics such that it is possible for load_async_url() to call the callback before it returns in the case of local paths. Callers need to know this is possible, but now won't need to check to call it manually. This requires a slight reorganisation of the boot_process() code, since it checks the result of several asynchronous load operations in the same callback, and with this change not all of those results will necessarily be initialised at callback time. Add a list of 'boot_resources' which carry the required information for the resource and allow the boot handler to treat different resources generically. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/pxe-parser.c')
-rw-r--r--discover/pxe-parser.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c
index 2f099e3..5c80b13 100644
--- a/discover/pxe-parser.c
+++ b/discover/pxe-parser.c
@@ -421,9 +421,6 @@ static int pxe_parse(struct discover_context *dc)
pb_log("load_url_async fails for %s\n",
dc->conf_url->path);
goto out_conf;
- } else if (result->status == LOAD_OK) {
- /* Local load - call pxe_conf_parse_cb() now */
- pxe_conf_parse_cb(result, conf);
}
} else {
pxe_conf_files = user_event_parse_conf_filenames(dc, dc->event);
OpenPOWER on IntegriCloud