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

Segmentation fault for large rules #238

Open
xkr4fn4x opened this issue Feb 27, 2023 · 1 comment
Open

Segmentation fault for large rules #238

xkr4fn4x opened this issue Feb 27, 2023 · 1 comment

Comments

@xkr4fn4x
Copy link

I'm using Python version of Yaramod library to parse Yara rulesets.
I have a really large rule (1.4MB file). Parsing this file goes ok, but, when I try to access YaraFile object, I get segmentation fault.
This is log from journal when crash occurs:

kernel: python3.9[21615]: segfault at 7f4166ffef88 ip 00007f4152ebb182 sp 00007f4166ffef90 error 6 in yaramod.cpython-39-x86_64-linux-gnu.so[7f4152c6b000+3d1000]
kernel: Code: 3c 06 0f 85 b8 05 00 00 48 8b 76 08 0f b6 d2 e8 44 ff ff ff eb c2 66 90 48 8d 47 10 48 89 07 48 8b 76 08 48 8b 55 10 48 01 f2 f9 ed ff ff eb a7 0f 1f 80 00 00 00 00 48 8b 45 08 4c 8d 64 24
systemd[1]: Started Process Core Dump (PID 21670/UID 0).
systemd-coredump[21671]: Resource limits disable core dumping for process 21585 (python3.9).
systemd-coredump[21671]: Process 21585 (python3.9) of user 1000 dumped core.
systemd[1]: [email protected]: Succeeded.

@metthal
Copy link
Member

metthal commented Feb 27, 2023

Hi. Is your ruleset available publicly? In case you are able to share it, please do so here. In case you are able to share but don't want to post it publicly, please send it to me via mail at [email protected]. In case you can't share it, could you maybe describe what your ruleset looks like when it comes to amount of rules, max. length of strings, complexity of conditions? Some sample ruleset would be nice, where you just take your rule and obfuscate the strings and logic it in for example.

The size of your ruleset shouldn't be an issue since we are parsing 15MB rulesets with it without any issues so it might just be something specific to your ruleset. Also, what's your system? What distribution of linux do you use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants