tomm / cryptkeeper

A system tray (gnome, xfce, kde) applet that manages EncFS encrypted folders.
http://tom.noflag.org.uk/cryptkeeper.html
GNU General Public License v3.0
54 stars 17 forks source link

Cryptkeeper segfaults when accessing mounted shares #29

Open ghost opened 5 years ago

ghost commented 5 years ago

Cryptkeeper is segfaulting, but only when the shares are mounted.

  1. First segfault was creating the new encrypted mount. cryptkeeper successfully created the share and mounted it, then segfaulted. The share was left mounted.
  2. Launching cryptkeeper again (with the share already mounted), it put an icon in the bar. Left-clicking on the bar causes cryptkeeper to segfalt.
  3. Launched cryptkeeper again, right-clicked on icon, no issues. I'm able to access preferences, about, etc. Left-clicking crashes.
  4. Unmounted the share, launched cryptkeeper. No crashes, and left-click shows the share. Selecting the mount point.... and cryptkeeper segfaults after successfully mounting the directory.

There are no related messages in the system logs.

At about step 3, I started stracing cryptkeeper. It always ends with the same message; pasting just after the debug message that prints the password in cleartext:

# This line was the write echo of the password
write(18, "\n", 1)                      = 1
close(18)                               = 0
poll([{fd=19, events=POLLIN}], 1, 1000) = 0 (Timeout)
wait4(3804, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3804
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3804, si_uid=1001, si_status=0, si_utime=302, si_stime=0} ---
wait4(-1, NULL, 0, NULL)                = -1 ECHILD (No child processes)
rt_sigreturn({mask=[]})                 = 3804
openat(AT_FDCWD, "/etc/mtab", O_RDONLY|O_CLOEXEC) = 17
lstat("/media", {st_mode=S_IFDIR|0755, st_size=10, ...}) = 0
lstat("/media/extra", {st_mode=S_IFDIR|0755, st_size=114, ...}) = 0
lstat("/media/extra/News", {st_mode=S_IFDIR|0700, st_size=22, ...}) = 0
futex(0x7f1d8e7c5fc8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
fstat(17, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(17, "proc /proc proc rw,nosuid,nodev,"..., 1024) = 1024
lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/dev", {st_mode=S_IFDIR|0755, st_size=3500, ...}) = 0
lstat("/run", {st_mode=S_IFDIR|0755, st_size=700, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/firmware", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/firmware/efi", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/firmware/efi/efivars", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/kernel", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/kernel/security", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/dev", {st_mode=S_IFDIR|0755, st_size=3500, ...}) = 0
lstat("/dev/shm", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=60, ...}) = 0
lstat("/dev", {st_mode=S_IFDIR|0755, st_size=3500, ...}) = 0
lstat("/dev/pts", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/unified", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/systemd", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/pstore", {st_mode=S_IFDIR|0750, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/bpf", {st_mode=S_IFDIR|S_ISVTX|0700, st_size=0, ...}) = 0
read(17, "ev,noexec,relatime,pids 0 0\ncgro"..., 1024) = 1024
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/pids", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/freezer", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/cpu,cpuacct", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/net_cls,net_prio", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/memory", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/hugetlb", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/rdma", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/blkio", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/perf_event", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/devices", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=380, ...}) = 0
lstat("/sys/fs/cgroup/cpuset", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/dev", {st_mode=S_IFDIR|0755, st_size=3500, ...}) = 0
lstat("/dev/hugepages", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/dev", {st_mode=S_IFDIR|0755, st_size=3500, ...}) = 0
lstat("/dev/mqueue", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=40, ...}) = 0
read(17, "p=1,timeout=0,minproto=5,maxprot"..., 1024) = 967
lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/proc/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/proc/sys/fs", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/proc/sys/fs/binfmt_misc", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
brk(0x55969d46a000)                     = 0x55969d46a000
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/kernel", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/kernel/debug", {st_mode=S_IFDIR|0700, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/kernel", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/kernel/config", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=600, ...}) = 0
lstat("/home", {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0
lstat("/boot", {st_mode=S_IFDIR|0755, st_size=260, ...}) = 0
lstat("/boot/efi", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/fuse", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/fs/fuse/connections", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/run", {st_mode=S_IFDIR|0755, st_size=700, ...}) = 0
lstat("/run/user", {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
lstat("/run/user/1001", {st_mode=S_IFDIR|0700, st_size=280, ...}) = 0
lstat("/run", {st_mode=S_IFDIR|0755, st_size=700, ...}) = 0
lstat("/run/user", {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
lstat("/run/user/1001", {st_mode=S_IFDIR|0700, st_size=280, ...}) = 0
lstat("/run/user/1001/gvfs", {st_mode=S_IFDIR|0500, st_size=0, ...}) = 0
lstat("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat("/sys/kernel", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/sys/kernel/debug", {st_mode=S_IFDIR|0700, st_size=0, ...}) = 0
lstat("/sys/kernel/debug/tracing", 0x7ffe4aff70e0) = -1 EACCES (Permission denied)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
+++ killed by SIGSEGV (core dumped) +++
[1]    3428 segmentation fault (core dumped)  strace cryptkeeper
➜

The last message is always that Permission denied trying to look into debug/tracing.

Cryptkeeper: 0.9.5-6 encfs: 1.9.5-2 Distro: Linux glamdring 4.19.34-1-MANJARO #1 SMP PREEMPT Sat Apr 6 08:28:55 UTC 2019 x86_64 GNU/Linux

The share is being created on an SSD with btrfs as the parent filesystem.

a32r commented 4 years ago

The same thing here. My share is on an HDD with ntfs filsystem.