Package: quassel-core
Version: 1:0.14.0-6
Severity: important
Tags: patch

Dear Maintainer,

When AppArmor is enabled (apparmor 4.1.8-3+b1, Linux 7.2.8+deb14-amd64),
starting /usr/bin/quasselcore fails immediately with a segmentation fault
before main() is even reached:

  $ /usr/bin/quasselcore -v
  Segmentation fault

Running under strace shows that execve() is denied by AppArmor:

  $ strace -f /usr/bin/quasselcore -v
  execve("/usr/bin/quasselcore", ["/usr/bin/quasselcore", "-v"], ...) = -1 
EACCES (Permission denied)
  +++ killed by SIGSEGV +++

Executing via the dynamic linker bypasses the profile and works as expected:

  $ /lib64/ld-linux-x86-64.so.2 /usr/bin/quasselcore -v
  quassel v0.14.0 (dist-da9c1c9)

Cause:
1. The shipped AppArmor profile /etc/apparmor.d/usr.bin.quasselcore is missing
   the rule allowing the binary to memory-map and read itself:

     /usr/bin/quasselcore mr,

   Adding this rule and reloading the profile immediately resolves the startup
   crash and allows quasselcore to run in enforce mode.

2. In addition, when using the PostgreSQL storage backend over the local Unix
   socket (/var/run/postgresql), AppArmor blocks the socket connection unless
   the profile allows:

     /{,var/}run/postgresql/.s.PGSQL.* rw,

A patch for debian/usr.bin.quasselcore adding both rules is attached.


-- System Information:
Debian Release: 13.7
  APT prefers stable-updates
  APT policy: (700, 'stable-updates'), (700, 'stable-security'), (700, 
'stable'), (500, 'testing'), (500, 'oldstable'), (200, 'unstable'), (100, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 7.2.8+deb14-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_CPU_OUT_OF_SPEC, 
TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
--- a/debian/usr.bin.quasselcore
+++ b/debian/usr.bin.quasselcore
@@ -14,11 +14,16 @@
   #include <abstractions/ssl_certs>
   #include <abstractions/ssl_keys>
 
+  /usr/bin/quasselcore mr,
+
   /var/lib/quassel/ rw,
   /var/lib/quassel/** rwkl,
 
   /var/log/quassel/* rw,
 
+  # PostgreSQL storage backend over local Unix socket
+  /{,var/}run/postgresql/.s.PGSQL.* rw,
+
   /etc/xdg/Trolltech.conf r,
   deny /etc/xdg/Trolltech.conf k,
 

Reply via email to