1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00
The systemd System and Service Manager
Go to file
Tommi Rantala 24754f3694 journal: add object sanity check to journal_file_move_to_object()
Introduce journal_file_check_object(), which does lightweight object
sanity checks, and use it in journal_file_move_to_object(), so that we
will catch certain corrupted objects in the journal file.

This fixes #6447, where we had only partially written out OBJECT_ENTRY
(ObjectHeader written, but rest of object zero bytes), causing
"journalctl --list-boots" to fail.

  $ builddir.vanilla/journalctl --list-boots -D bug6447/
  Failed to determine boots: No data available

  $ builddir.patched/journalctl --list-boots -D bug6447/
  -52 22633da1c5374a728d6c215e2c301dc2 Mon 2017-07-10 05:29:21 EEST—Mon 2017-07-10 05:31:51 EEST
  -51 2253aab9ea7e4a2598f2abda82939eff Mon 2017-07-10 05:32:22 EEST—Mon 2017-07-10 05:36:49 EEST
  -50 ef0d85d35c74486fa4104f9d6391b6ba Mon 2017-07-10 05:40:33 EEST—Mon 2017-07-10 05:40:40 EEST
  [...]

Note that journal_file_check_object() is similar to
journal_file_object_verify(). The most expensive checks are omitted, as
they would slow down every journal_file_move_to_object() call too much.

With this implementation, the added overhead is small, for example when
dumping some journal content to /dev/null
(built with -Dbuildtype=debugoptimized -Db_ndebug=true):

 Performance counter stats for 'builddir.vanilla/journalctl -D 76f4d4c3406945f9a60d3ca8763aa754/':

      12542,311634      task-clock:u (msec)       #    1,000 CPUs utilized
                 0      context-switches:u        #    0,000 K/sec
                 0      cpu-migrations:u          #    0,000 K/sec
            80 100      page-faults:u             #    0,006 M/sec
    41 786 963 456      cycles:u                  #    3,332 GHz
   105 453 864 770      instructions:u            #    2,52  insn per cycle
    24 342 227 334      branches:u                # 1940,809 M/sec
       105 709 217      branch-misses:u           #    0,43% of all branches

      12,545199291 seconds time elapsed

 Performance counter stats for 'builddir.patched/journalctl -D 76f4d4c3406945f9a60d3ca8763aa754/':

      12734,723233      task-clock:u (msec)       #    1,000 CPUs utilized
                 0      context-switches:u        #    0,000 K/sec
                 0      cpu-migrations:u          #    0,000 K/sec
            80 693      page-faults:u             #    0,006 M/sec
    42 661 017 429      cycles:u                  #    3,350 GHz
   107 696 985 865      instructions:u            #    2,52  insn per cycle
    24 950 526 745      branches:u                # 1959,252 M/sec
       101 762 806      branch-misses:u           #    0,41% of all branches

      12,737527327 seconds time elapsed

Fixes #6447.
2017-09-22 10:32:20 +03:00
.github CONTRIBUTING: stop mentioning "make check" 2017-08-21 09:47:07 +02:00
.mkosi mkosi.arch: fix comment (#6470) 2017-07-28 09:24:12 +02:00
catalog build-sys: drop gitignore patterns for in-tree builds 2017-07-18 10:05:06 -04:00
coccinelle tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
docs build-sys: drop gitignore patterns for in-tree builds 2017-07-18 10:05:06 -04:00
factory/etc factory: remove broken pam_limits 2014-07-30 15:21:54 +02:00
hwdb hwdb: add Lenovo Yoga 510-14IKB sensor mount quirk (#6799) 2017-09-12 18:39:25 +02:00
man Merge pull request #6847 from keszybz/disable-enable-generators 2017-09-20 19:51:44 +02:00
modprobe.d modprobe.d: ship drop-in to set bonding max_bonds to 0 (#6448) 2017-08-02 08:41:18 -04:00
network build-sys: drop automake support 2017-07-18 10:04:44 -04:00
po Added Romanian Translation (#6674) 2017-08-28 18:24:09 +02:00
rules fix path in btrfs rule (#6844) 2017-09-15 21:28:24 +02:00
shell-completion analyze: add get-log-level, get-log-target verbs 2017-09-07 23:55:59 +02:00
src journal: add object sanity check to journal_file_move_to_object() 2017-09-22 10:32:20 +03:00
sysctl.d build-sys: drop gitignore patterns for in-tree builds 2017-07-18 10:05:06 -04:00
system-preset build-sys: drop automake support 2017-07-18 10:04:44 -04:00
sysusers.d units,sysusers: use DynamicUser= for journal-gatewayd and drop user systemd-journal-gateway from sysusers 2017-07-28 13:37:10 +09:00
test test: add test case for UnsetEnvironment= 2017-09-14 15:17:40 +02:00
tmpfiles.d tmpfiles.d/journal-nocow: fix typo (#6804) 2017-09-12 13:28:21 -03:00
tools meson: install the git hook (#6425) 2017-07-24 10:41:45 +02:00
units units: don't kill the emergency shell when sysinit.target is triggered (#6765) 2017-09-14 21:43:43 +02:00
xorg login: support user-bus on dbus1 2015-08-31 18:12:37 +02:00
.dir-locals.el meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
.editorconfig editorconfig: add rule for meson.build files (#6671) 2017-08-28 16:37:23 +02:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore build-sys: drop gitignore patterns for in-tree builds 2017-07-18 10:05:06 -04:00
.mailmap mailmap: add entry to fix encoding issues 2017-09-15 17:18:29 +02:00
.travis.yml remove gudev and gtk-doc 2015-06-03 00:22:53 +02:00
.vimrc vimrc: fix indentation logic for our docbook xml files 2016-04-29 12:23:34 +02:00
.ycm_extra_conf.py ycm: update flag blacklist 2014-06-04 15:41:10 -04:00
CODING_STYLE tree-wide: set SA_RESTART for signal handlers we install 2016-12-01 12:41:17 +01:00
configure build-sys: add basic support for ./configure && make && make install 2017-07-18 10:05:06 -04:00
DISTRO_PORTING DISTRO_PORTING: document that distros may/should change fallback DNS as well as fallback NTP if they wish 2017-07-24 11:49:16 +02:00
ENVIRONMENT.md Rename $TEST_DIR to $SYSTEMD_TEST_DATA, document it 2017-02-16 21:36:31 +01:00
HACKING HACKING: update for meson 2017-07-18 10:05:06 -04:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile build-sys: Fix Makefile wrapper for install target (#6548) 2017-08-07 11:29:20 +02:00
meson_options.txt Merge pull request #6420 from keszybz/gateway-name 2017-08-01 09:43:41 +02:00
meson.build build-sys: require libmount >= 2.30 (#6795) 2017-09-15 14:47:57 +02:00
mkosi.build mkosi: use '[' rather than 'test' everywhere 2017-07-20 14:37:05 +02:00
mkosi.default mkosi: create .mkosi directory 2016-10-06 11:53:58 -04:00
NEWS networkd: change UseMTU default to true. (#6837) 2017-09-19 10:26:17 +02:00
README build-sys: require libmount >= 2.30 (#6795) 2017-09-15 14:47:57 +02:00
README.md README: include small graphs of open issues and pull requests (#5576) 2017-03-13 08:10:04 +01:00
TODO units: set LockPersonality= for all our long-running services (#6819) 2017-09-14 19:45:40 +02:00

systemd - System and Service Manager

Count of open issues over time Count of open pull requests over time Build Status
Coverity Scan Status

Details

General information about systemd can be found in the systemd Wiki.

Information about build requirements are provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the HACKING file for information how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.