Bug 11824 - samba crashes if configured to use kerberos but keytab file is missing
Summary: samba crashes if configured to use kerberos but keytab file is missing
Status: NEEDINFO
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.1.17
Hardware: All Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-07 14:29 UTC by cwseys
Modified: 2017-08-20 15:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cwseys 2016-04-07 14:29:37 UTC
Hello,
   I recently set up samba to use kerberos authentication, but did not yet have a keytab in the filesystem.  Samba would panic and shutdown uncleanly when it tried to access the missing keytab.
   Placing the keytab on the filesystem cleared up the problem.
   Output of backtrace and testparm below:

Thanks!

# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[dfs]"
Loaded services file OK.
Server role: ROLE_DOMAIN_MEMBER
Press enter to see a dump of your service definitions

[global]
        workgroup = PHYSICS
        realm = PHYSICS.WISC.EDU
        server string = %h server
        security = ADS
        map to guest = Bad User
        kerberos method = secrets and keytab
        syslog = 0
        max log size = 100000
        client ldap sasl wrapping = sign
        dns proxy = No
        panic action = /usr/share/samba/panic-action %d
        idmap config * : backend = tdb

[dfs]
        path = /srv/smb
        msdfs root = Yes


[2016/04/06 16:42:59.330472,  1, pid=14365, effective(0, 0), real(0, 0)] ../source3/librpc/crypto/gse_krb5.c:416(fill_mem_keytab_from_system_keytab)
  ../source3/librpc/crypto/gse_krb5.c:416: krb5_kt_start_seq_get failed (No such file or directory)
[2016/04/06 16:42:59.330597,  0, pid=14365, effective(0, 0), real(0, 0)] ../lib/util/fault.c:72(fault_report)
  ===============================================================
[2016/04/06 16:42:59.330656,  0, pid=14365, effective(0, 0), real(0, 0)] ../lib/util/fault.c:73(fault_report)
  INTERNAL ERROR: Signal 11 in pid 14365 (4.1.17-Debian)
  Please read the Trouble-Shooting section of the Samba HOWTO
[2016/04/06 16:42:59.330737,  0, pid=14365, effective(0, 0), real(0, 0)] ../lib/util/fault.c:75(fault_report)
  ===============================================================
[2016/04/06 16:42:59.330795,  0, pid=14365, effective(0, 0), real(0, 0)] ../source3/lib/util.c:785(smb_panic_s3)
  PANIC (pid 14365): internal error
[2016/04/06 16:42:59.332309,  0, pid=14365, effective(0, 0), real(0, 0)] ../source3/lib/util.c:896(log_stack_trace)
  BACKTRACE: 33 stack frames:
   #0 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(log_stack_trace+0x1a) [0x7f2dd0a9d2ca]
   #1 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(smb_panic_s3+0x20) [0x7f2dd0a9d3b0]
   #2 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(smb_panic+0x2f) [0x7f2dd224ecaf]
   #3 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(+0x1cecf) [0x7f2dd224eecf]
   #4 /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0) [0x7f2dd24788d0]
   #5 /usr/lib/x86_64-linux-gnu/libkrb5.so.26(krb5_storage_free+0x1) [0x7f2dc6c432a1]
   #6 /usr/lib/x86_64-linux-gnu/libkrb5.so.26(+0x47665) [0x7f2dc6c28665]
   #7 /usr/lib/x86_64-linux-gnu/samba/libgse.so.0(+0x8e06) [0x7f2dcbf35e06]
   #8 /usr/lib/x86_64-linux-gnu/samba/libgse.so.0(gse_krb5_get_server_keytab+0xeb) [0x7f2dcbf3632b]
   #9 /usr/lib/x86_64-linux-gnu/samba/libgse.so.0(+0xb03a) [0x7f2dcbf3803a]
   #10 /usr/lib/x86_64-linux-gnu/libgensec.so.0(gensec_start_mech+0x72) [0x7f2dcbd15ab2]
   #11 /usr/lib/x86_64-linux-gnu/libgensec.so.0(gensec_start_mech_by_ops+0xc) [0x7f2dcbd15bdc]
   #12 /usr/lib/x86_64-linux-gnu/libgensec.so.0(+0x8d62) [0x7f2dcbd12d62]
   #13 /usr/lib/x86_64-linux-gnu/libgensec.so.0(+0x9586) [0x7f2dcbd13586]
   #14 /usr/lib/x86_64-linux-gnu/libgensec.so.0(+0xa1f1) [0x7f2dcbd141f1]
   #15 /usr/lib/x86_64-linux-gnu/libgensec.so.0(gensec_update+0xa) [0x7f2dcbd1498a]
   #16 /usr/lib/x86_64-linux-gnu/samba/libsmbd_base.so.0(negprot_spnego+0x92) [0x7f2dd1dda492]
   #17 /usr/lib/x86_64-linux-gnu/samba/libsmbd_base.so.0(+0xcd9dc) [0x7f2dd1dda9dc]
   #18 /usr/lib/x86_64-linux-gnu/samba/libsmbd_base.so.0(reply_negprot+0x4aa) [0x7f2dd1ddb18a]
   #19 /usr/lib/x86_64-linux-gnu/samba/libsmbd_base.so.0(+0x123264) [0x7f2dd1e30264]
   #20 /usr/lib/x86_64-linux-gnu/samba/libsmbd_base.so.0(+0x12443f) [0x7f2dd1e3143f]
   #21 /usr/lib/x86_64-linux-gnu/samba/libsmbd_base.so.0(+0x124a29) [0x7f2dd1e31a29]
   #22 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(run_events_poll+0x171) [0x7f2dd0abbda1]
   #23 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(+0x44017) [0x7f2dd0abc017]
   #24 /usr/lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x8d) [0x7f2dcf465f9d]
   #25 /usr/lib/x86_64-linux-gnu/samba/libsmbd_base.so.0(smbd_process+0xdb4) [0x7f2dd1e32fe4]
   #26 /usr/sbin/smbd(+0xa1d0) [0x7f2dd28b31d0]
   #27 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(run_events_poll+0x171) [0x7f2dd0abbda1]
   #28 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(+0x44017) [0x7f2dd0abc017]
   #29 /usr/lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x8d) [0x7f2dcf465f9d]
  #30 /usr/sbin/smbd(main+0x1589) [0x7f2dd28aff19]
   #31 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f2dcf0d8b45]
   #32 /usr/sbin/smbd(+0x713b) [0x7f2dd28b013b]
[2016/04/06 16:42:59.333471,  0, pid=14365, effective(0, 0), real(0, 0)] ../source3/lib/util.c:797(smb_panic_s3)
  smb_panic(): calling panic action [/usr/share/samba/panic-action 14365]
[2016/04/06 16:42:59.448266,  0, pid=14365, effective(0, 0), real(0, 0)] ../source3/lib/util.c:805(smb_panic_s3)
  smb_panic(): action returned status 0
[2016/04/06 16:42:59.448542,  0, pid=14365, effective(0, 0), real(0, 0)] ../source3/lib/dumpcore.c:317(dump_core)
  dumping core in /var/log/samba/cores/smbd
[2016/04/06 16:42:59.464587,  3, pid=14357, effective(0, 0), real(0, 0)] ../source3/smbd/server.c:429(remove_child_pid)
  ../source3/smbd/server.c:429 Unclean shutdown of pid 14365
Comment 1 Jeremy Allison 2016-05-27 23:10:14 UTC
Can you ensure you have symbols loaded on your system (Samba compiled with -g) and reproduce the crash. Then use gdb to give us a good backtrace (that will help find where the problem lies).

Thanks !

Jeremy.
Comment 2 Paul Wise 2017-08-20 15:19:58 UTC
I note that bug #12505 seems like a similar error.