trusteddomainproject / OpenDMARC

This is the Trusted Domain Project's impementation of the DMARC protocol libary and mail filter, called OpenDMARC. A "milter" connects to unix-based mailers (originally, sendmail, but now many) and provides a standard filtering API.
Other
100 stars 53 forks source link

core dump #194

Open buxit opened 2 years ago

buxit commented 2 years ago

hi,

opendmarc (arch linux, opendmarc-1.4.1.1-1) seems to consistently segfault on a specific incoming message, this amounts to a denial of service on my mail host.

Nov 22 09:08:08 horus postfix/smtpd[4170852]: 95CC749970B6: client=letterbox.kde.org[46.43.1.242]
Nov 22 09:08:08 horus postfix/cleanup[4170877]: 95CC749970B6: message-id=<20211122090759.B2921291DFAD35B8@kockw.com>
Nov 22 09:08:08 horus opendmarc[418]: implicit authentication service: horus
Nov 22 09:08:08 horus audit[418]: ANOM_ABEND auid=4294967295 uid=991 gid=73 ses=4294967295 pid=418 comm="opendmarc" exe="/usr/bin/opendmarc" sig=11 res=1
Nov 22 09:08:08 horus kernel: opendmarc[422]: segfault at 0 ip 00007f7c6a770fb7 sp 00007f7c68a45178 error 4 in libc-2.33.so[7f7c6a63a000+14b000]
Nov 22 09:08:08 horus kernel: Code: 0f 1f 00 48 83 e6 f0 48 83 e7 f0 ba ff ff 00 00 45 31 c0 83 e1 0f 83 e0 0f c5 f9 ef c0 39 c1 74 32 77 07 41 89 d0 91 48 87 f7 <c5> f9 6f 17 c5 f9 6f 0e 4c 8d 48 0f 49 29 c9 4c 8d 15 d3 88 03 00
Nov 22 09:08:08 horus systemd[1]: Started Process Core Dump (PID 4170878/UID 0).

since saving of core files was disabled, this is all i currently get:

           PID: 4171583 (opendmarc)
           UID: 991 (opendmarc)
           GID: 73 (postfix)
        Signal: 11 (SEGV)
     Timestamp: Mon 2021-11-22 09:43:38 CET (1min 54s ago)
  Command Line: /usr/bin/opendmarc -c /etc/opendmarc/opendmarc.conf
    Executable: /usr/bin/opendmarc
 Control Group: /system.slice/opendmarc.service
          Unit: opendmarc.service
         Slice: system.slice
       Boot ID: *****************
    Machine ID: ****************
      Hostname: horus
       Storage: none
       Message: Process 4171583 (opendmarc) of user 991 dumped core.

                Found module linux-vdso.so.1 with build-id: 68f6e36e0fd83223b553b19c82de3c4a799f606e
                Found module libnss_files.so.2 with build-id: 1a36dfc01d3a1010b2ee79766a24a8090a3266d5
                Found module libkeyutils.so.1 with build-id: ac405ddd17be10ce538da3211415ee50c8f8df79
                Found module libkrb5support.so.0 with build-id: c4ee4ad1dc2da57487bc2419b88f1b6873184582
                Found module libcom_err.so.2 with build-id: eb61ef71c8b97846db759fb89a115405cff6dd30
                Found module libk5crypto.so.3 with build-id: 632a59ed7c35704d84645e6d1e9873348d1eb802
                Found module libkrb5.so.3 with build-id: c61cb4da63b8a839ee7df99eaf9dbd3d0968534c
                Found module libgssapi_krb5.so.2 with build-id: 9be9d3348399b72b76161a64e6d9fd760b77163a
                Found module libtirpc.so.3 with build-id: 5bef2adfdee3df283f593b3e2d37b6dac405256a
                Found module libnsl.so.2 with build-id: 483b18a0f5dea898b7a147c1662214049d1e5786
                Found module libmd.so.0 with build-id: 904612daabb619ff53b5daeef45c79d28cc3f29d
                Found module libdl.so.2 with build-id: 5abc547e7b0949f89f3c0e21ab0c8331a7440a8a
                Found module ld-linux-x86-64.so.2 with build-id: 040cc3dd10461562f177df39e3be2f3704258c3c
                Found module libidn.so.12 with build-id: a03952cbdf12d9d512b58a73b3b9e9bd418da682
                Found module librt.so.1 with build-id: 75484da2d6f1515189eefa076e0a40328834cd16
                Found module libspf2.so.2 with build-id: e684c29b162675e6ad65862b0a74dba5f03eb945
                Found module libm.so.6 with build-id: 2b8fd1f869ecab4e0b55e92f2f151897f6818acf
                Found module libc.so.6 with build-id: 4b406737057708c0e4c642345a703c47a61c73dc
                Found module libbsd.so.0 with build-id: a1e665d4441263b636ef82647e2b16c05be14fd4
                Found module libresolv.so.2 with build-id: c915c72668282861a813f7ea3c0780f37b681dc0
                Found module libpthread.so.0 with build-id: 07c8f95b4f3251d08550217ad8a1f31066229996
                Found module libopendmarc.so.2 with build-id: 6de096e031a403e9e58185d067b571abf71adc60
                Found module opendmarc with build-id: 1cd9da2eb4e7cb4d39164a8059f4028c51a46573
                Stack trace of thread 4171590:
                #0  0x00007f2cdd8d8fb7 __strcasecmp_l_avx (libc.so.6 + 0x15cfb7)
                #1  0x000055663592775e n/a (opendmarc + 0x875e)
                #2  0x0000556635934c6c n/a (opendmarc + 0x15c6c)
                #3  0x0000556635931cb0 n/a (opendmarc + 0x12cb0)
                #4  0x00007f2cdd982259 start_thread (libpthread.so.0 + 0x9259)
                #5  0x00007f2cdd87a5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 4171586:
                #0  0x00007f2cdd86fb2f __poll (libc.so.6 + 0xf3b2f)
                #1  0x00005566359316b3 n/a (opendmarc + 0x126b3)
                #2  0x00007f2cdd982259 start_thread (libpthread.so.0 + 0x9259)
                #3  0x00007f2cdd87a5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 4171583:
                #0  0x00007f2cdd86fb2f __poll (libc.so.6 + 0xf3b2f)
                #1  0x0000556635930e0b n/a (opendmarc + 0x11e0b)
                #2  0x00005566359300c4 n/a (opendmarc + 0x110c4)
                #3  0x0000556635923c6e n/a (opendmarc + 0x4c6e)
                #4  0x00007f2cdd7a3b25 __libc_start_main (libc.so.6 + 0x27b25)
                #5  0x0000556635924e1e n/a (opendmarc + 0x5e1e)

                Stack trace of thread 4171588:
                #0  0x00007f2cdd98e8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                #1  0x00007f2cdd988574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                #2  0x0000556635931e52 n/a (opendmarc + 0x12e52)
                #3  0x00007f2cdd982259 start_thread (libpthread.so.0 + 0x9259)
                #4  0x00007f2cdd87a5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 4171585:
                #0  0x00007f2cdd7b9ae2 __sigtimedwait (libc.so.6 + 0x3dae2)
                #1  0x00007f2cdd98c3ac sigwait (libpthread.so.0 + 0x133ac)
                #2  0x0000556635933580 n/a (opendmarc + 0x14580)
                #3  0x00007f2cdd982259 start_thread (libpthread.so.0 + 0x9259)
                #4  0x00007f2cdd87a5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 4171584:
                #0  0x00007f2cdd7b9ae2 __sigtimedwait (libc.so.6 + 0x3dae2)
                #1  0x00007f2cdd98c3ac sigwait (libpthread.so.0 + 0x133ac)
                #2  0x0000556635925b0c n/a (opendmarc + 0x6b0c)
                #3  0x00007f2cdd982259 start_thread (libpthread.so.0 + 0x9259)
                #4  0x00007f2cdd87a5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 4171589:
                #0  0x00007f2cdd98e8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                #1  0x00007f2cdd988574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                #2  0x0000556635931e52 n/a (opendmarc + 0x12e52)
                #3  0x00007f2cdd982259 start_thread (libpthread.so.0 + 0x9259)
                #4  0x00007f2cdd87a5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 4171587:
                #0  0x00007f2cdd98e8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                #1  0x00007f2cdd988574 pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf574)
                #2  0x0000556635931e52 n/a (opendmarc + 0x12e52)
                #3  0x00007f2cdd982259 start_thread (libpthread.so.0 + 0x9259)
                #4  0x00007f2cdd87a5e3 __clone (libc.so.6 + 0xfe5e3)

i'll try to attach a full core if possible.

buxit commented 2 years ago

i now have a core file, but there's way too much private information in there to post publicly. if interested please get back to me!

glts commented 2 years ago

The strcasecmp in the stack trace could point to #178. 1.4.1.1 needs this patch to work.