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
[BUG] rspamd 3.4 triggering unaligned memory access in hyperscan #4329
Comments
Could you please elaborate more on that? |
we ran disassemble on the code to see which params were used for the crashing move operation and one of them was only 16bit aligned. but i lost my backtraces and need to reproduce it again. upgraded the package again to get new coredumps. |
I mean which pointer is not properly aligned? Hypescan database? I see |
the variable you wanted to see:
disassemble off the crash area
|
Well, I see that the database itself is aligned on 4096 bytes boundary (as it should be apparently). What is the problematic address by the way? |
do you have any recommendations how to test that without dropping rspamd 3.4 into my production setup? then i could do some bisecting. |
Could you show what's in the registers (in %r9 in particular). |
|
And what version of hyperscan is used? |
hyperscan-5.4.0 |
I have created an issue in the Hyperscan repo, as it does not look like an Rspamd issue. But we will see... |
so the mmap part is new in 3.4? I downgraded my production setup to 3.3 again. |
Building a package with 068714f to test run this in production. |
still seeing crashes with that patch. downgrading to 3.3 again. |
You need to remove the existing |
cc @arkamar |
Which begs the question how should distro packages handle this? can we detect bad |
It is safe just to remove all In theory, I can also add some suffix to |
I think this is not possible, because |
I'm not with you here, could you please elaborate more? Assuming that we have 3.4-1 where there is an issue with the alignment, and 3.4-2 where there is no issue with the alignment, why cannot we also include cleanup of |
I was writing about situation when users are upgrading from older version, like 3.3. |
In this case, this post-install will be no-op and everything will work fine. |
Sorry, I don't get it. Those are steps which downstream users follow right now:
Is there a way to upgrade from 3.3 to 3.4 without segfaults? |
that is a pretty safe method |
Upgrade to 3.4 with the patch above applied? |
Ah, I see, I understand what 3.4-1 and 3.4-2 mean now. I was confused by
Thanks, I will try it. |
This revision applies patch taken from upstream [1] which fixes page-alignment issue of .unser files causing segfaults. The issue affects only those who already started rspamd-3.4. All .unser files will be automatically removed in postinstall phase for those who are updating from 3.4 to 3.4-r1. [1] rspamd/rspamd#4329 Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
when are those unser files created? are they written during shutdown or load? for rpm packages and i guess it is similar for other package managers. we just call the restart function of the init system.
so the obvious choice would be:
but if they get written again in the stop code path, then the find wouldnt solve the problem. we could work around it with expanding the macro manually to something like
@vstakhov could you comment if the simple code block above will work or if we will need the 2nd longer code block? |
|
cool. thank you for the confirmation. |
This revision applies patch taken from upstream [1] which fixes page-alignment issue of .unser files causing segfaults. The issue affects only those who already started rspamd-3.4. All .unser files will be automatically removed in postinstall phase for those who are updating from 3.4 to 3.4-r1. [1] rspamd/rspamd#4329 Signed-off-by: Petr Vaněk <arkamar@atlas.cz> Closes: #28263 Signed-off-by: Sam James <sam@gentoo.org>
https://build.opensuse.org/request/show/1036202 by user darix + dimstar_suse - Move cleanup code to %pre because otherwise it doesnt trigger early enough - Upgrade to 3.4 again - Fix metadata_exporter with many recipients by @yo000 in #4294 - [Fix] Fix favicon.ico Content-Type header by @moisseev in #4302 - [Minor] Fix copy-paste error by @moisseev in #4305 - Add basic auth to metadata_exporter http pusher by @yo000 in #4300 - [Enhancement] Add composite rule against AFF involving freemailers by @twesterhever in #4304 - Penalize bounce spam by @frederikbosch in #4308 - Added 068714f9f5a96fbd94560211cec75775ee023d02.patch: Official patch for the unaligned memory issue described in rspamd/rspamd#4329 - Add cleanup code to the %postun scriptlet to remove bad files, created by earlier/unpatched 3.4 versions, during
fix crash see rspamd/rspamd#4329
fix crash see rspamd/rspamd#4329
Steps to Reproduce
Expected behavior
do not crash.
Versions
OS: openSUSE Tumbleweed
Package Build description: https://build.opensuse.org/package/show/server:mail/rspamd
Additional Information
The text was updated successfully, but these errors were encountered: