Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--extensions_require=extension1,extension2 does not wait correctly for extensions after the first in the list #7256

Open
CShearan opened this issue Aug 13, 2021 · 0 comments · May be fixed by #8067
Labels
bug extensions Related to osquery extension SDK or to extensions themselves triage Issue needs to be verified, reproduced and prioritized

Comments

@CShearan
Copy link
Contributor

CShearan commented Aug 13, 2021

Bug report

What operating system and version are you using?

+----------+-------+----------+
| version  | build | platform |
+----------+-------+----------+
| 6.1.7601 | 7601  | windows  |
+----------+-------+----------+

What version of osquery are you using?

+---------+
| version |
+---------+
| 4.9.0   |
+---------+

What steps did you take to reproduce the issue?

ran osquery with two extensions using --extensions_require=extension1,extension2 --timeout=10

What did you expect to see?

Osquery wait a maximum of 10 seconds for all extensions to be loaded

What did you see instead?

Osquery failed to load all extensions with:

E An error occurred during extension manager startup: Required extension not found or not loaded: extension2

after less then 3 seconds.

It looks like in startExtensionManager in "osquery\osquery\extensions\extensions.cpp", after the first extension in the extensions_require list is loaded, all following extensions will be reported as failed to load after the first loop in applyExtensionDelay. This is because the waited bool is set to true after the first extension is checked, regardless of if it hit the FLAGS_extensions_timeout.

Also, rather than the FLAGS_extensions_timeout being the amount of time that all extensions are given to load, which seems to be what the waited bool is checking for, the applyExtensionDelay method resets the delay which is compared against the FLAGS_extensions_timeout for each extension. This could cause startExtensionManager to wait longer that the given timeout for all extensions to load.

@Smjert Smjert added bug extensions Related to osquery extension SDK or to extensions themselves triage Issue needs to be verified, reproduced and prioritized labels Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug extensions Related to osquery extension SDK or to extensions themselves triage Issue needs to be verified, reproduced and prioritized
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants