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

Only send the signal if the pid is a positive value. #593

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Aug 28, 2020

What:
Only send the signal if the pid is a positive value.

Why:
Since kb_item_get_int() will return -1 if the key does
not exist. killing with -1 as pid will send the signal system wide.
Apparently the stop signal is received twice, being the second one
sent by a child process, but received after the kb was already cleaned up.
Therefore -1 is received and the kill SIGUSR1 signal reaches other process.

How:
You can test this starting 2 or 3 parallel scans with many hosts. This produces a big amount child process which during stops scans, spread the kill signal to other process. You should be able to stop the scans without problem if this patch is applied.

Checklist:

CHANGELOG.md Outdated Show resolved Hide resolved
src/openvas.c Outdated Show resolved Hide resolved
ArnoStiefvater
ArnoStiefvater previously approved these changes Aug 31, 2020
Since kb_item_get_int() will return -1 if the key does
not exist. killing with -1 pid will send the signal system wide.
Apparently the stop signal is received twice, being the second one
sent by a child process, but received after the kb was already cleaned up.
Therefore -1 is received and the kill SIGUSR1 signal reaches other process.
@jjnicola jjnicola requested a review from cfi-gb August 31, 2020 07:01
@jjnicola jjnicola merged commit 4de0751 into greenbone:openvas-20.08 Aug 31, 2020
@jjnicola jjnicola deleted the kill-pid-systemwide branch August 31, 2020 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants