[MDEV-24535] pam v2: Authentication fails randomly Created: 2021-01-06 Updated: 2023-10-31 Resolved: 2022-06-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Plugin - pam |
| Affects Version/s: | 10.4.17, 10.4.19, 10.5.15 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Florian Bezdeka | Assignee: | Alexey Botchkov |
| Resolution: | Incomplete | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
I'm running several webapps (PHP) on a CentOS 8 webserver. All webapps are reporting randomly that the connection to the database has been denied. The "authentication chain" looks like this: Switching to the "old" pam v1 plugin fixes this issue. I'm sorry, I can't provide much information, let me know if you have further ideas where to look at. So far I only noticed the following lines in the sssd_pam.log on affected systems:
Mariadb:
|
| Comments |
| Comment by Alexey Botchkov [ 2021-01-19 ] | ||||||||||||||||||||
|
Hello, Florian! Regards. | ||||||||||||||||||||
| Comment by Florian Bezdeka [ 2021-02-07 ] | ||||||||||||||||||||
|
Sorry for the delay, too many things to solve...
That was expected on my side
Is there an debug package available somewhere? Otherwise detailed information on how to build the debug version would be required. | ||||||||||||||||||||
| Comment by Volker Klasen [ 2021-03-10 ] | ||||||||||||||||||||
|
We have the same issue with PAM authentication. We're using PAM with SSSD and LDAP to authenticate (non-application) users. Only on some databases this is an issue that we can more or less consistently reproduce. A Restart of the database fixes the issue for a while. There are no hints in the log files, neither MariaDB's nor SSSD's. It looks as if MariaDB just would not use PAM at some point anymore. We don't have debug logs, but with more detailed information, I guess, we could provide them. Cheers, | ||||||||||||||||||||
| Comment by Volker Klasen [ 2021-04-15 ] | ||||||||||||||||||||
|
I was able to build a debug version of the auth_pam Plugin and could reproduce the issue. Working authentication (mysql-error.log):
After some time it does not anymore:
I hope that helps in finding the cause. Cheers, | ||||||||||||||||||||
| Comment by Volker Klasen [ 2021-04-26 ] | ||||||||||||||||||||
|
fork() fails with ENOMEM:
Memory should be enough available (though mysqld has a VIRT memory usage of 26.7g):
It looks like the same issue as in https://bugs.launchpad.net/percona-server/+bug/1520267 (https://jira.percona.com/browse/PS-3332). Cheers, | ||||||||||||||||||||
| Comment by Volker Klasen [ 2022-01-14 ] | ||||||||||||||||||||
|
I attached a patch that replaces fork() + exec() by posix_spawn() with which I could no longer reproduce the bug and could login via PAM even when the server process used more than 50% of available RAM. I obviously forgot about this ticket and created Cheers | ||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-05-25 ] | ||||||||||||||||||||
we don't build centos8 debug packages, but we have centos7 debug packages: http://hasky.askmonty.org/archive/10.4/build-48235/kvm-rpm-centos74-amd64-debug/rpms/ otherwise you can build it yourself as described here: https://mariadb.com/kb/en/generic-build-instructions/ | ||||||||||||||||||||
| Comment by Florian Bezdeka [ 2022-05-30 ] | ||||||||||||||||||||
|
My systems are no longer running CentOS 8. They have been migrated to Debian but the problem remained. I will now update some systems to 10.5.16 as this version has a fix for |