Dovecot-imapd, PAM auth., krb auth with non-krb user causes crash

Bug #414359 reported by A. Karl Kornel
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
heimdal (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

The two servers showing this behavior were previously running an up-to-date Ubuntu 6.06, which was then upgraded to an up-to-date Ubuntu 8.04 install.

The IMAP client I'm using (Opera) reports "Temporary authentication failure". The following entries appear in syslog, when I have 'auth_verbose' and 'auth_debug' set to "yes":

Aug 16 00:41:56 npbnagb dovecot: auth(default): new auth connection: pid=31751
Aug 16 00:41:56 npbnagb dovecot: auth(default): client in: AUTH^I1^IPLAIN^Iservi
ce=IMAP^Isecured^Ilip=10.1.16.85^Irip=192.168.235.121
Aug 16 00:41:56 npbnagb dovecot: auth(default): client out: CONT^I1^I
Aug 16 00:41:56 npbnagb dovecot: auth(default): client in: CONT<hidden>
Aug 16 00:41:56 npbnagb dovecot: auth(default): pam(nagios,192.168.235.121): lookup service=dovecot
Aug 16 00:41:57 npbnagb kernel: [12214.451803] dovecot-auth[31752] general protection rip:7ffa8c7b57f6 rsp:7fff956f9b98 error:0
Aug 16 00:41:57 npbnagb dovecot: auth(default): pam(nagios,192.168.235.121): Child process died
Aug 16 00:41:57 npbnagb dovecot: auth(default): PAM: Child 31752 died with signal 11
Aug 16 00:41:57 npbnagb dovecot: auth(default): client out: FAIL^I1^Iuser=nagios^Itemp
Aug 16 00:41:57 npbnagb dovecot: imap-login: Disconnected: user=<nagios>, method=PLAIN, rip=192.168.235.121, lip=10.1.16.85, TLS

The nagios account is a local account.

I also have another account on each server, for which I also have Opera checking mail. For this other account, I log in using my Kerberos username and password, and things work fine.

Revision history for this message
A. Karl Kornel (akkornel) wrote :
Revision history for this message
A. Karl Kornel (akkornel) wrote :
Revision history for this message
A. Karl Kornel (akkornel) wrote :
Revision history for this message
A. Karl Kornel (akkornel) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please try to obtain a backtrace following the instructions at http://wiki.ubuntu.com/DebuggingProgramCrash and upload the backtrace (as an attachment) to the bug report. This will greatly help us in tracking down your problem.

Changed in dovecot (Ubuntu):
status: New → Incomplete
Revision history for this message
A. Karl Kornel (akkornel) wrote :

Hi Chuck,

I have done backtraces before, but this one was a little more unusual for me. The last time I needed a backtrace, I was able to capture the daemon's full command line, then run it through GDB. In this case, I'm thinking the offending program is located at /usr/lib/dovecot/dovecot-auth, it is run by the dovecot daemon as needed, and then exits with a result (or, in this case, a crash) shortly after starting.

In this case, I stopped dovecot, sudo-ed into root, ran `ulimit -c unlimited`, ran dovecot manually, and had my IMAP client try a login. That caused dovecot-auth to die again (as expected), and dropped a core file in /var/run/dovecot. I installed both dovecot-common-dbgsym and libpam0g-dbgsym packages, ran `gdb /usr/lib/dovecot/dovecot-auth core`, and then ran the 5 GDB commands requested in https://wiki.ubuntu.com/Backtrace. Attached are the results!

Revision history for this message
A. Karl Kornel (akkornel) wrote :

Hmmmm, looks like I needed a couple more debug packages. Here's the GDB file again after installing libcomerr2-dbgsym, libpam-heimdal-dbgsym, and libkrb5-22-heimdal-dbgsym.

Changed in dovecot (Ubuntu):
status: Incomplete → New
Revision history for this message
Chuck Short (zulcss) wrote :

Thanks for the info.

Regards
chuck

Changed in dovecot (Ubuntu):
status: New → Triaged
Chuck Short (zulcss)
Changed in dovecot (Ubuntu):
milestone: none → ubuntu-9.10
Revision history for this message
Chuck Short (zulcss) wrote :

Hi,

You went me from a 6.06 -> 8.04 directly?

Regards
chuck

Revision history for this message
A. Karl Kornel (akkornel) wrote :

Hello!

When I got the machine, I installed Ubuntu 6.06.1 LTS. From time to time, I installed additional packages, including Dovecot. Also from time to time, I'd do `apt-get update` followed by `apt-get upgrade`. Then, on 6 August, I ran:

apt-get update
apt-get install update-manager-core
do-release-upgrade

(I already had the dapper-updates repository in my APT sources.list when I did this)

I ran those commands based on the instructions at <https://help.ubuntu.com/community/HardyUpgrades#Network%20Upgrade%20from%206.06%20for%20Ubuntu%20Servers%20(Recommended)>.

Revision history for this message
Chuck Short (zulcss) wrote :

I think this might be more of a pam problem.

Thanks
chuck

Changed in dovecot (Ubuntu):
milestone: ubuntu-9.10 → none
affects: dovecot (Ubuntu) → pam (Ubuntu)
Revision history for this message
Steve Langasek (vorlon) wrote :

No, this segfault is happening in a specific PAM module, nothing to do with PAM itself. Reassigning to heimdal.

affects: pam (Ubuntu) → heimdal (Ubuntu)
Revision history for this message
A. Karl Kornel (akkornel) wrote :

Hello again!

I've got another twist on this bug! Last night, I tried logging into a machine that is showing this problem. I was logging in using SSH, using the PuTTY Windows SSH client. At the time I made the connection, I entered the wrong username by mistake, but I did not catch my mistake until I had finished entering my password. After entering the password, PuTTY just sat for a while, waiting, and then reported that the remote side had closed the connection.

Once I got back into work, I did a test with this on my workstation (also running Ubuntu Hardy, fully up-to-date), and I discovered the following: If you have PAM configured to use Heimdal's pam_krb5.so module, and you try to log in with an invalid username, openssh-server's sshd will crash in the same place as dovecot-imapd.

Since I did the verification on my Linux workstation, I had apport running, and it grabbed a crash report. I processed the crash report with `appport-cli -c` and saved the report, so it has the core dump AND all of the information that is derived from the core dump. I really hope this extra info helps!

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I wonder if this is a symbols clash - dovecot and sshd are both linked against MIT libkrb5. Your pam_krb5.so is linked against Heimdal's krb5 library, which has some overlapping symbols.

The version of Heimdal in hardy didn't yet use symbol versioning. It'd be interesting to hear if you can reproduce this with natty or later.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.