Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to log-in ubuntu with pam using pkcs#11 module #18

Closed
srujansrs opened this issue Jan 26, 2016 · 5 comments
Closed

Not able to log-in ubuntu with pam using pkcs#11 module #18

srujansrs opened this issue Jan 26, 2016 · 5 comments

Comments

@srujansrs
Copy link

When trying to log-in using pkcs#11 shared library by editing pam configuration file, facing error like-

ubuntu kernel: [13342.185619] lightdm[15882]: segfault at b662b48e ip b71ddd2f sp bfb35dec error 4 in libc-2.19.so[b7163000+1a8000]

Getting this error after exit from C_Finalize (Traced using syslog)..

At log-in Screen messages getting like- Smartcard authentication starts,
Smart card found,
verifying certificate,
Failed to authenticate

when tried through terminal to log-in other user from default user- able to get authentication succeeded at the end(before Segmentation fault in terminal) and getting error(as per syslog) -

ubuntu kernel: [11694.542754] su[13543]: segfault at b676048e ip b7586d2f sp bfd0f0bc error 4 in libc-2.19.so[b750c000+1a8000]

Can any one help us by giving solution to debug this...

@LudovicRousseau
Copy link
Member

What PKCS#11 library do you use?

Can you run the "su" command inside gdb and generate a backtrace?

@srujansrs
Copy link
Author

we have created pkcs#11 library in order to perform operations like signing.
And it is working perfectly in thunderbird application..
Now are are using same pkcs#11 library for login to ubuntu os with smart card.

command that we are using log-in through terminal-
"su - username"
then we are facing error - segmentation fault
at syslog - "ubuntu kernel: [11694.542754] su[13543]: segfault at b676048e ip b7586d2f sp bfd0f0bc error 4 in libc-2.19.so[b750c000+1a8000]"

using gdb command result -

Program received signal SIGSEGV, Segmentation fault.
__strlen_ia32 () at ../sysdeps/i386/i686/multiarch/../../i586/strlen.S:51
51 ../sysdeps/i386/i686/multiarch/../../i586/strlen.S: No such file or directory.
(gdb) backtrace
#0 __strlen_ia32 () at ../sysdeps/i386/i686/multiarch/../../i586/strlen.S:51
#1 0xb7597732 in __GI_fputs_unlocked (
str=0xb678248e <error: Cannot access memory at address 0xb678248e>,
fp=fp@entry=0x8fd4d20) at iofputs_u.c:36
#2 0xb7614789 in __GI___vsyslog_chk (pri=, pri@entry=85,
flag=flag@entry=1, fmt=fmt@entry=0xb76ebb7e "%s %s",
ap=ap@entry=0xbfe56b4c "\270K\375\b\030/\375\b\264\252n\267")
at ../misc/syslog.c:205
#3 0xb7614c27 in __syslog_chk (pri=85, flag=1, fmt=0xb76ebb7e "%s %s")
at ../misc/syslog.c:129
#4 0xb76e8a4c in pam_vsyslog () from /lib/i386-linux-gnu/libpam.so.0
#5 0xb76e8b93 in pam_syslog () from /lib/i386-linux-gnu/libpam.so.0
#6 0xb6884e38 in ?? () from /lib/i386-linux-gnu/security/pam_unix.so
#7 0xb68823d4 in pam_sm_authenticate ()
from /lib/i386-linux-gnu/security/pam_unix.so
#8 0xb76e35af in ?? () from /lib/i386-linux-gnu/libpam.so.0
#9 0xb76e2c7a in pam_authenticate () from /lib/i386-linux-gnu/libpam.so.0
#10 0x0804b3ba in ?? ()
#11 0x08049e66 in ?? ()
#12 0xb7547a83 in __libc_start_main (main=0x8049a50, argc=1, argv=0xbfe56e54,
init=0x804db50, fini=0x804dbc0, rtld_fini=0xb771a180 <_dl_fini>,
stack_end=0xbfe56e4c) at libc-start.c:287
#13 0x0804ab6c in ?? ()
(gdb) frame 10
#10 0x0804b3ba in ?? ()
(gdb) frame 12
#12 0xb7547a83 in __libc_start_main (main=0x8049a50, argc=1, argv=0xbfe56e54,
init=0x804db50, fini=0x804dbc0, rtld_fini=0xb771a180 <_dl_fini>,
stack_end=0xbfe56e4c) at libc-start.c:287
287 libc-start.c: No such file or directory.
(gdb) frame 12
#12 0xb7547a83 in __libc_start_main (main=0x8049a50, argc=1, argv=0xbfe56e54,
init=0x804db50, fini=0x804dbc0, rtld_fini=0xb771a180 <_dl_fini>,
stack_end=0xbfe56e4c) at libc-start.c:287
287 in libc-start.c
(gdb) q

@srujansrs
Copy link
Author

If we run -
cmd- 'su - usename'
result- 'authentication succeeded' but then 'Segmentation fault (core dumped)'

If we run -
cmd- 'gdb --args su - usename'
result- 'Program received signal SIGSEGV, Segmentation fault.
__strlen_ia32 () at ../sysdeps/i386/i686/multiarch/../../i586/strlen.S:51
51 ../sysdeps/i386/i686/multiarch/../../i586/strlen.S: No such file or directory'

above comment will be the backtrace result...

@LudovicRousseau
Copy link
Member

I can't find pam_pkcs11 in the backtrace. It looks like the bug is in your own code.

Feel free to submit a patch to pam_pkcs11 if you find the bug in this component.

@srujansrs
Copy link
Author

yes there is no bug in pam_pkcs11. Cause we have tested that with other token. Its working.
Can you suggest me the process of debugging for this kind of error. Because in this backtrace no file is related to my code...!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants