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
The Recursive call of "lyxml_parse_elem" leads to crash #1453
Comments
|
Could you provide the data to reproduce? We cannot fix anything without them. |
<?xml version="1.0" encoding="UTF-8"?>
<module name="all-imp"
xmlns="urn:ietf:params:xml:ns:yang:yin:1"
xmlns:all_imp="urn:all-imp">
<yang-version value="1.1"/>
<namespace uri="urn:all-imp"/>
<prefix value="all_imp"/>
<identity name="ident4"/>
<identity name="ident5">
<base name="ident4">
<base name="1">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
<base name="2">
.....repeat
<base name="2"/>
</base>
</base>
</identity>
</module> |
|
That was not very helpful, please provide the exact module to reproduce the crash. You can attach it if it is too big. |
It's the file to be parsed with the code below: with the repeat of "<base name="2">", recursive calls of function |
|
I need the module exactly, without any |
|
repeat 135728 times of |
|
Um, yes, that definitely sounds like a stack overflow, what exactly are you trying to achieve? You can increase the stack size on your system if you really need to load such a module but I doubt that. |
|
No matter how big I increase the stack size, I can also increase the repeat times of |
|
Fair enough, now it should be limited. |
|
CVE-2021-28903 was assigned to this issue. |
|
@michalvasko Hi, this hard limit does not solve very small stack sizes since if you (for any reason) limit your stacksize to some very small value, you can still easily hit the segfault:
Not sure about a better solution though(sigh) :( |
|
The only solution I can think of is removing the recursion from this (and other) function calls. I seriously doubt it is worth it and will certainly not be implemented for the old libyang v1. |
|
Ok, good to know. I just thought it was good to mention this. Thanks ;) |
No description provided.
The text was updated successfully, but these errors were encountered: