1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-14 15:21:37 +03:00
Commit Graph

8 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
ae97089d49 journal: fix access to munmapped memory in sd_journal_enumerate_unique
sd_j_e_u needs to keep a reference to an object while comparing it
with possibly duplicate objects in other files. Because the size of
mmap cache is limited, with enough files and object to compare to,
at some point the object being compared would be munmapped, resulting
in a segmentation fault.

Fix this issue by turning keep_always into a reference count that can
be increased and decreased. Other callers which set keep_always=true
are unmodified: their references are never released but are ignored
when the whole file is closed, which happens at some point. keep_always
is increased in sd_j_e_u and later on released.
2014-01-11 10:07:22 -05:00
Lennart Poettering
bf807d4dbf journald: keep statistics on how of we hit/miss the mmap cache 2013-11-26 18:58:44 +01:00
Lennart Poettering
e2c8b07dcb journal: bring mmap cache prototype in sync 2012-09-22 00:16:13 +02:00
Lennart Poettering
f801968466 journal: completely rework the mmap cache as I too dumb to actually understand it
Instead of doing hand optimized fd bisect arrays just use plain old
hashmaps. Now I can understand my own code again. Yay!

As a side effect this should fix some bad memory accesses caused by
accesses after mmap(), introduced in 189.
2012-09-21 20:52:23 +02:00
Lennart Poettering
fcde238921 journal: be more careful when keeping around mmaps we still need 2012-08-21 15:39:34 +02:00
Lennart Poettering
84168d8068 mmap: resize arrays dynamically 2012-08-18 01:46:20 +02:00
Lennart Poettering
f65425cbc4 journal: add superficial structure verifier 2012-08-16 17:10:57 +02:00
Lennart Poettering
16e9f408fa journal: implement generic sharable mmap caching logic
instead of having one simple per-file cache implement an more
comprehensive one that works for multiple files and can actually
maintain multiple maps per file and per object type.
2012-08-16 17:10:56 +02:00