Commit graph

491 commits

Author SHA1 Message Date
Vitaly Chikunov
b56b8758af CI: mkosi: Restore loading LKRG module from initrd
For (non-grub) BLS boot - install generated by Dracut initrd into
systemd-boot loader entry.

Man pages for curious details: systemd-boot(7), bootctl(1),
kernel-install(8).

Link: https://github.com/lkrg-org/lkrg/pull/228#issuecomment-1235403740
Fixes: db42541 ("CI: mkosi: Do not assume grub is installed")
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2022-09-04 13:41:59 +02:00
Vitaly Chikunov
db42541477 CI: mkosi: Do not assume grub is installed
mkosi' "--boot-protocols is deprecated and has no effect anymore", thus
do not assume we will be booting using grub/bios.

Fixes: https://github.com/lkrg-org/lkrg/issues/227
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2022-09-02 13:41:33 +02:00
Solar Designer
ff18ec6856 LKRG 0.9.5 2022-08-01 13:28:28 +02:00
Solar Designer
333ae0774e Revert "Logging: Use KERN_EMERG in place of KERN_CRIT"
This reverts commit dfb60a6eb2.
2022-08-01 13:13:25 +02:00
Solar Designer
c58cb52145 Simplify the new logic supporting OverlayFS 2022-07-29 10:35:23 -07:00
Solar Designer
9dd2a8d3f7 CI: Enable CodeQL for all branches (not just main) 2022-07-29 10:35:23 -07:00
Adam_pi3
6f3627e32c Rework the logic supporting OverlayFS/docker
The original logic was hooking 'ovl_create_or_link' function but it could be
inlined. This commit changes it by hooking 'ovl_dentry_is_whiteout' when
possible.

Fixes #215
2022-07-29 13:50:45 +02:00
Solar Designer
dfb60a6eb2 Logging: Use KERN_EMERG in place of KERN_CRIT
Fixes #222
2022-07-28 16:30:23 -07:00
Solar Designer
e773798649 kINT: Support variable length jump labels also for 5.10.133+
Extends b8ff7abcd0
Extends fb9e272f7d
Fixes #221
2022-07-28 16:30:23 -07:00
Vitaly Chikunov
09a156a53e CI: Remove EOL'ed Ubuntu releases
Impish is started to fail, because it's EOL'ed at July 14, 2022.
Hirsute is EOL'ed at January 20, 2022, but it started to fail only
recently.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2022-07-27 19:43:16 +02:00
Solar Designer
7bb9cf154e LKRG 0.9.4 2022-07-22 20:34:32 +02:00
Solar Designer
d8b0e8387e README: Add DKMS uninstall instructions 2022-07-22 20:33:58 +02:00
Solar Designer
cfc320a167 LICENSE: Update copyright years 2022-07-22 16:56:11 +02:00
Solar Designer
ce3016b49a pCFI: Increase severity of "Frame pointer is not on the stack" 2022-07-21 21:47:37 +02:00
Solar Designer
f5286727b4 pCFI: Avoid skipping of stack frame checks when CONFIG_UNWINDER_ORC
Fixes #210
2022-07-21 21:47:37 +02:00
Solar Designer
a14d81e81f Logging: Make logging of sysctl value changes more consistent
Skip logging on no change and include old values for interval and
log_level, like we do for others.

Fixes #211
2022-07-21 21:47:37 +02:00
Solar Designer
93eda28b8b Logging: kINT: Don't skip any checks regardless of log level
The checks we tried to skip updated "p_mod_bad_nr", which affected how we
treat further violations.

Amends 8b7d68a4c7
Fixes #212
2022-07-21 21:47:37 +02:00
Solar Designer
05369422f1 CHANGES: Update with major changes since 0.9.3 2022-07-20 17:57:37 +02:00
Solar Designer
49a3117542 Rename the module from p_lkrg to lkrg 2022-07-20 17:57:37 +02:00
Solar Designer
e4c46d7d6b copy-builtin.sh: Simplify the Makefile parsing command 2022-07-20 17:57:37 +02:00
yeggor
cbd4198943 Enable code scanning with CodeQL 2022-07-19 15:36:43 +00:00
RageLtMan
f267c369e8 Adapt copy-builtin.sh script for LKRG debug option
Changes to the Makefile enabling debug builds of LKRG resulted in
the copy-builtin script producing an errant Makefile inside the
target kernel tree.

Address this by creating a SECURITY_LKRG_DEBUG Kconfig option in
the Kconfig file and copy/update the relevant Makefile stanza into
the in-tree Makefile manually (vs extracting it from the source
Makefile and modifying in-flight).

Testing:
  Built in Arch chroot, verified prompt for new option and module
build in-tree.
2022-07-18 20:40:05 +02:00
Solar Designer
237ece7ef3 CI: Detect keywords ALERT, FAULT, FATAL in kernel messages 2022-07-17 20:39:31 +00:00
Solar Designer
0f0f74fbcb Logging: Wrap panic() in a macro, log an alert before panic 2022-07-17 20:39:31 +00:00
Solar Designer
4e7dd0951f Logging: Expose the STATE, DYING, FATAL categories 2022-07-17 20:39:31 +00:00
Solar Designer
8b7d68a4c7 Logging: kINT: Change extra module messages from ALERT to WATCH
It was inconsistent to produce "alerts" that did not invoke any response
action, whereas downgrading them to informational messages lets us skip
a lengthy block of checks at default log level.
2022-07-17 20:39:31 +00:00
Solar Designer
e3badfaf73 Logging: Revise, unify, and reduce duplication of logging and responses
Use macros, move logging and enforcement responses from callers into
called functions, remove where it was duplicate.

Unify our log and kernel panic messages.
2022-07-17 20:39:31 +00:00
Solar Designer
f4dc1e31a9 Unify kernel symbol lookups through introduction of a macro 2022-07-17 20:39:31 +00:00
Solar Designer
4b9a74ad51 Logging: Revise messages from sysctl handlers 2022-07-17 20:39:31 +00:00
Solar Designer
68f649bb0c Logging: Replace '\n' within log messages with ' ' (space character)
sed -i 's/\\n/ /g' src/modules/database/p_database.c src/modules/integrity_timer/p_integrity_timer.c
2022-07-17 20:39:31 +00:00
Solar Designer
33dfb1474f Logging: Move trailing '\n' to inside of p_print_log()
sed -i 's/\\n"/"/g' `fgrep -rl '\n"' src`

Followed by manual re-alignment of trailing backslashes in a few places,
and indeed the edit of p_print_log().
2022-07-17 20:39:31 +00:00
Solar Designer
7956c28836 Drop trailing '\n' from panic() messages
panic() removes and re-adds them anyway:

	if (len && buf[len - 1] == '\n')
		buf[len - 1] = '\0';

	pr_emerg("Kernel panic - not syncing: %s\n", buf);
2022-07-17 20:39:31 +00:00
Solar Designer
08ff518bf9 Logging: Have P_TRY_OFFLOAD_NOTIFIER() construct messages 2022-07-17 20:39:31 +00:00
Solar Designer
db46f714ed Logging: Consistently use p_debug_log() for P_LOG_DEBUG messages 2022-07-17 20:39:31 +00:00
Solar Designer
24f7029ac3 Logging: Rename log severity macros
sed -i 's/P_LOG_LEVEL_MIN/P_LOG_MIN/g' `fgrep -rl P_LOG_LEVEL_MIN src`
sed -i 's/P_LOG_LEVEL_MAX/P_LOG_MAX/g' `fgrep -rl P_LOG_LEVEL_MAX src`
sed -i 's/P_LKRG_CRIT/P_LOG_ALERT/g' `fgrep -rl P_LKRG_CRIT src`
sed -i 's/P_LKRG_ALIVE/P_LOG_ALIVE/g' `fgrep -rl P_LKRG_ALIVE src`
sed -i 's/P_LKRG_ERR/P_LOG_FAULT/g' `fgrep -rl P_LKRG_ERR src`
sed -i 's/P_LKRG_WARN/P_LOG_ISSUE/g' `fgrep -rl P_LKRG_WARN src`
sed -i 's/P_LKRG_INFO/P_LOG_WATCH/g' `fgrep -rl P_LKRG_INFO src`
sed -i 's/P_LKRG_DBG/P_LOG_DEBUG/g' `fgrep -rl P_LKRG_DBG src`
sed -i 's/P_LKRG_STRONG_DBG/P_LOG_FLOOD/g' `fgrep -rl P_LKRG_STRONG_DBG src`

Followed by manual re-alignment of trailing backslashes in a few places.
2022-07-17 20:39:31 +00:00
Solar Designer
849e7e5dd9 Logging: Drop hard-coded "ERROR: " from more messages 2022-07-17 20:39:31 +00:00
Solar Designer
9f9ae6ff52 Logging: Drop hard-coded "ERROR: " from beginnings of messages
sed -i 's/"ERROR: /"/' `fgrep -lr '"ERROR: ' src`
2022-07-17 20:39:31 +00:00
Solar Designer
5ca9648009 Logging: Change LKRG message prefix, include severity in messages 2022-07-17 20:39:31 +00:00
Solar Designer
57a61129a7 Logging: Simplify the API, change kernel message severities 2022-07-17 20:39:31 +00:00
Solar Designer
d6cd9fa74e Logging: Minor fixes to log level name reporting in p_sysctl_log_level() 2022-07-17 20:39:31 +00:00
Solar Designer
a3c32c2da5 kINT: Further simplify integrity violation counting 2022-07-17 20:39:31 +00:00
Solar Designer
7b6dfbccfd kINT: Fix and simplify integrity violation counting 2022-07-17 20:39:31 +00:00
Solar Designer
873d32e5bc Fix comments on module_mutex for p_kmod_hash() 2022-07-17 20:39:31 +00:00
Solar Designer
37e21ce0d4 pCFI: Fix the stack alignment check 2022-07-17 20:39:31 +00:00
Solar Designer
2a02939779 Consistently use "static const char * const" for local string arrays 2022-07-17 20:39:31 +00:00
Solar Designer
6e30ac23b9 Fix build without P_LKRG_DEBUG 2022-07-17 20:39:31 +00:00
Solar Designer
a500f1d0d6 README: Minor corrections of recent commits 2022-07-09 22:34:28 +02:00
Krish-sysadmin
9b103902d6 README: Add instructions on installing using DKMS 2022-07-09 22:17:54 +02:00
mrl5
1b80c7bbbf feat(scripts): support OpenRC init system
introduce OpenRC bootup scripts
2022-07-09 01:05:41 +02:00
Solar Designer
91ccc5cf50 UMH: Allow "/usr/sbin/modprobe"
Fixes #198
2022-07-06 12:02:00 +02:00