-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
yr_scanner_scan_file Using mmap is a dangerous operation #119
Comments
YARA itself tries to catch that signal unless explicitly instructed otherwise, so you should just see a failed scan. See the |
@pandaWall ping? |
1 similar comment
@pandaWall ping? |
Sorry to see your reply just now, I saw that the source code supports the YR_TRYCATCH macro definition, which only captures the signal when SIGBUS is triggered to ensure that the program will not crash. However, I hope that the library can change the calling method of mmap and add an interface to read a certain length of buffer for detection by means of read. |
@hillu Looking forward to your reply |
@pandaWall The I'm afraid that we can't call mmap in specific ways to avoid SIGBUS being raised. |
@hillu Thank you for your reply, my friend。So it looks like that, but what I'm doing is I'm reading a piece of content and I'm using scan_mem to detect it. |
At this point, a minimal reproducer would be useful, I think. |
This issue is related to #137 That PR addresses the issue of YARA's signal handler interfering with Golang's runtime, at least for the For the |
When yara maps a file of size using mmap, SIGBUS is triggered when the file size is cleared to zero before yr_scanner_scan_mem is called.
So is there any solution other than to read files into memory in advance。
The text was updated successfully, but these errors were encountered: