NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.64k stars 13.8k forks source link

dovecot-pigeonhole: crash in sieve plugin when trying to execute a program #22004

Open tg-x opened 7 years ago

tg-x commented 7 years ago

Issue description

The dovecot sieve plugin crashes when trying to execute a program via the execute command in a sieve script. This is after upgrading dovecot 2.2.27 from 2.2.25 and dovecot-pigeonhole from 0.4.3 to 0.4.10

dovecot.log:

lda(mail): Error: program `/home/mail/bin/notify.sh' terminated abnormally, signal 11

dmesg:

dovecot-lda[7814] general protection ip:7f72b8c99286 sp:7ffdeccca478 error:0 in libc-2.24.so[7f72b8c19000+195000]

Steps to reproduce

notify.sh:

#!/bin/sh

echo "$1"

.dovecot.sieve:

execute "notify.sh" [ "hello" ];

make it crash:

$ cat mail | dovecot-lda

Core dump

Core was generated by `/nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/bin/../libexec/dovecot/dovecot-lda'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
106     ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb) bt
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
#1  0x00007ff0ac692233 in _IO_vfprintf_internal (s=s@entry=0x7fff5768b640, format=<optimized out>, format@entry=0x2236918 "chroot(%s) failed: Bad address", 
    ap=ap@entry=0x7fff5768b8a0) at vfprintf.c:1637
#2  0x00007ff0ac73f0c6 in ___vsnprintf_chk (s=0x2236832 "chroot(", maxlen=<optimized out>, flags=1, slen=<optimized out>, 
    format=0x2236918 "chroot(%s) failed: Bad address", args=0x7fff5768b8a0) at vsnprintf_chk.c:63
#3  0x00007ff0acaa650c in str_vprintfa () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot.so.0
#4  0x00007ff0aca7c937 in default_handler () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot.so.0
#5  0x00007ff0aca7ccad in default_fatal_handler () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot.so.0
#6  0x00007ff0aca13666 in i_fatal () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot.so.0
#7  0x00007ff0acaa2152 in restrict_access () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot.so.0
#8  0x00007ff0aca746ed in program_client_local_connect () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot.so.0
#9  0x00007ff0aca739f2 in program_client_run_async () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot.so.0
#10 0x00007ff0aca73b71 in program_client_run () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot.so.0
#11 0x00007ff0abb79093 in cmd_execute_operation_execute ()
   from /nix/store/xs5v1m9abs519cvbjl6wh5rj861lyh4d-dovecot-pigeonhole-0.4.10/lib/dovecot/sieve/lib90_sieve_extprograms_plugin.so
#12 0x00007ff0abdb94cc in sieve_interpreter_continue ()
   from /nix/store/xs5v1m9abs519cvbjl6wh5rj861lyh4d-dovecot-pigeonhole-0.4.10/lib/dovecot-2.2-pigeonhole/libdovecot-sieve.so.0
#13 0x00007ff0abdb96eb in sieve_interpreter_run ()
   from /nix/store/xs5v1m9abs519cvbjl6wh5rj861lyh4d-dovecot-pigeonhole-0.4.10/lib/dovecot-2.2-pigeonhole/libdovecot-sieve.so.0
#14 0x00007ff0abdcc950 in sieve_run ()
   from /nix/store/xs5v1m9abs519cvbjl6wh5rj861lyh4d-dovecot-pigeonhole-0.4.10/lib/dovecot-2.2-pigeonhole/libdovecot-sieve.so.0
#15 0x00007ff0abdcd4b7 in sieve_execute ()
   from /nix/store/xs5v1m9abs519cvbjl6wh5rj861lyh4d-dovecot-pigeonhole-0.4.10/lib/dovecot-2.2-pigeonhole/libdovecot-sieve.so.0
#16 0x00007ff0ac02fca8 in lda_sieve_deliver_mail () from /run/current-system/sw/lib/dovecot/lib90_sieve_plugin.so
#17 0x00007ff0ad049b59 in mail_deliver () from /nix/store/wd2aqi3hf5s1pghsw9p3kk2yk602j468-dovecot-2.2.27/lib/dovecot/libdovecot-lda.so.0
#18 0x00000000004028e6 in main ()

Technical details

mmahut commented 5 years ago

Are there any updates to this issue, please?

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.