Skip to content

grub-btrfs automount issue with chkrootkit (Kali default) #401

@uduntuntu

Description

@uduntuntu
┌──(utu㉿siem)-[~]
└─$ sensors                        
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +96.0°C  (high = +86.0°C, crit = +100.0°C)
Core 0:        +91.0°C  (high = +86.0°C, crit = +100.0°C)
Core 1:        +96.0°C  (high = +86.0°C, crit = +100.0°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +95.0°C  

thinkpad-isa-0000
Adapter: ISA adapter
fan1:        4394 RPM
pwm1:            128%

BAT0-acpi-0
Adapter: ACPI interface
in0:          12.35 V  
power1:        0.00 W  

                                                                                                 
┌──(utu㉿siem)-[~]
└─$ ps H -eo pid,user,cmd --sort=-%cpu | head -n 25
    PID USER     CMD
  23578 root     /usr/bin/dpkg-query --search -- /tmp/grub-btrfs.UWTpTukADN/@.snapshots/6/snapshot/usr/share/exploitdb/exploits/hardware/webapps/35751.pl
      1 root     /usr/lib/systemd/systemd --system --deserialize=66 splash
   9996 root     /usr/bin/find /tmp/ -executable -type f -print0
    643 root     /usr/lib/systemd/systemd-logind
    263 root     [kworker/u16:5-btrfs-endio]
     42 root     [kworker/u16:3-btrfs-endio-write]
     66 root     [kswapd0]
    336 root     [btrfs-transaction]
     12 root     [kworker/u16:0-btrfs-endio-write]
     41 root     [kworker/u16:2-btrfs-flush_delalloc]
    265 root     [kworker/u16:7-btrfs-endio]
   2866 utu      -zsh
    640 message+ /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
     52 root     [kcompactd0]
   6257 root     [kworker/u16:12-btrfs-flush_delalloc]
    196 root     [kworker/3:1H-kblockd]
    266 root     [kworker/u16:8-btrfs-endio-write]
     15 root     [rcu_preempt]
   9997 root     /usr/bin/xargs -0 -I@ ./check_if_debian @ /usr/bin/dpkg-query
   4611 root     [kworker/u16:10-btrfs-endio-write]
     36 root     [ksoftirqd/3]
   2775 utu      sshd-session: utu@pts/0
   2865 utu      sshd-session: utu@pts/2
     14 root     [ksoftirqd/0]
                                                                                                 
┌──(utu㉿siem)-[~]
└─$ sudo pkill -f chkrootkit       
                                                                                                 
┌──(utu㉿siem)-[~]
└─$ sudo umount /tmp/grub-btrfs.UWTpTukADN         

I have installed snapper, grub-btrfs and btrfs-progs. The platform is old laptop and I've noticed very high temperatures and laggy UI. When debugging issues, I noticed that there's always mountpoint under /tmp with name grub-btrfs. and that's issue because Kali have chkrootkit software installed by default which scans executables in /tmp. Because there's snapshot of root filesystem which is not tmp filesystem, it check all executables against vulnerability database and that's pretty costly for CPU.

AI (ChatGPT) suggested to add into /etc/default/grub-btrfs/config a line "GRUB_BTRFS_AUTO_MOUNT=false" which is doing nothing.

Is it possible to disable automounting entirely? I've tested snapper rollback which creates RW copy of RO snapshot and allows boot into that snapshot. I'm pretty sure that I'm nowadays running live filesystem without specific branching and snapper timeline snapshots are working well. Also this grub-btrfs. uuid-like string is different in every boot, so I think grub-btrfs is just mounting newest snapshot under /tmp for some reason I don't undestand.

Meanwhile after last copypaste I noticed that there's new grub-btrfs-mountpoint:

┌──(utu㉿siem)-[~]
└─$ mount           
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=5957376k,nr_inodes=1489344,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=600,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1212868k,mode=755,inode64)
/dev/sda4 on / type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=333,subvol=/@)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
none on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=41,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=8272)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda4 on /.snapshots type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@.snapshots)
/dev/sda4 on /root type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@root)
/dev/sda4 on /home type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@home)
/dev/sda4 on /srv type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=260,subvol=/@srv)
/dev/sda4 on /var/log type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=263,subvol=/@var@log)
/dev/sda4 on /usr/local type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=262,subvol=/@usr@local)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,inode64)
/dev/sda3 on /boot type ext4 (rw,relatime)
/dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/credentials/[email protected] type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1212864k,nr_inodes=303216,mode=700,uid=1000,gid=1000,inode64)
none on /run/credentials/systemd-journald.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap)
none on /run/credentials/systemd-resolved.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap)
/dev/sda4 on /tmp/grub-btrfs.aUsx8nshS5 type btrfs (ro,relatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions