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

Wrong mmjsonparse cookie causing segfault #1983

Closed
jvymazal opened this issue Nov 7, 2017 · 7 comments
Closed

Wrong mmjsonparse cookie causing segfault #1983

jvymazal opened this issue Nov 7, 2017 · 7 comments

Comments

@jvymazal
Copy link
Contributor

jvymazal commented Nov 7, 2017

using custom cookie (instead of default "@cee") and enclosing it in single quotes instead of double ones causes whole rsyslog to segfault (possibly in loop, depending on further configuration).

@rgerhards
Copy link
Member

Can you please post a concrete sample of the failing config? Seeing the PR I am unsure if I understand correctly.

@jvymazal
Copy link
Contributor Author

jvymazal commented Nov 8, 2017

if you use something like action(type="mmjsonparse" cookie='') which is invalid and should be action(type="mmjsonparse" cookie="") then mmjsonparse accepts this as cookie and dumps rsyslog upon first processed JSON message. Combined with constant source of JSON messages abd e.g. systemd this leads to restart loop which is not very nice and IMHO config error should be more clearly handled. (took quite some time to figure out reason for the segfaults with current state)

@rgerhards
Copy link
Member

ah, ok, this is what I initially understood. That means the proposed fix in #1985 is not correct as the problem is not in mmjsonparse but instead in the core engine's parameter processing. We need to create a testbench test first to ensure that the problem will actually be fixed.

@jvymazal
Copy link
Contributor Author

jvymazal commented Nov 8, 2017

Well, IIRC rsyslog itself has no problem with either single or double quotes so how (generically) would you like to fix this? I proposed the fix in the mmjsonparse because this is like the only place where type of quotes matter. The core engine just hands the cookie value to the module, or am I wrong?

@rgerhards
Copy link
Member

These quotes, if they would work, would not make it into the place where you checked it. The core has to strip them. I also do not think that you can use single quotes for parameters (but I need to check).

@jvymazal
Copy link
Contributor Author

Ok, done more thorough debugging and it turns out there was yet another cause for the original problem, closing this. Thanks for quick reply by the way.

@lock
Copy link

lock bot commented Dec 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants