[MDEV-10214] Segfault possible when using groups in PAM user mapping plugin Created: 2016-06-12  Updated: 2016-06-24  Resolved: 2016-06-24

Status: Closed
Project: MariaDB Server
Component/s: Plugin - pam
Affects Version/s: 10.1.14
Fix Version/s: 10.1.16

Type: Bug Priority: Major
Reporter: Mario Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: contribution, foundation, patch
Environment:

Ubuntu 14.04.3 LTS


Sprint: 10.1.15

 Description   

I’ve been experiencing segfaults while testing group mapping with the PAM user mapping module. I’ve
been using https://mariadb.com/blog/configuring-pam-group-mapping-mariadb as a guide and most of
the configuration is similar to what is outlined there except that I have two groups “dba” and “dba_ro”.

cat /etc/pam.d/mariadb
auth           required        pam_unix.so        audit
account        required        pam_unix.so        audit
auth           required        pam_user_map.so

cat /etc/security/user_map.conf
@dba: dba
@dba_ro: dba_ro

With this configuration when attempting to authenticate with a user that is not in the “dba” group a
segfault will occur as the loop at line 82 of pam_user_map.c never terminates. Even if the user is a member of the “dba_ro” group the crash will occur while matching
line 1 of /etc/security/user_map.conf.



 Comments   
Comment by Mario [ 2016-06-12 ]

PR - https://github.com/MariaDB/server/pull/183

Comment by Elena Stepanova [ 2016-06-12 ]

Thanks for the report and the patch. Assigning to serg for the review and merge.

Generated at Thu Feb 08 07:40:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.