Created attachment 1642191 [details] Journald logs Description of problem: After upgrading to selinux-policy-3.14.3-53.fc30 lot of AVC appeared. Version-Release number of selected component (if applicable): selinux-policy-3.14.3-53.fc30 How reproducible: Update to selinux-policy-3.14.3-53.fc30 Steps to Reproduce: 1. 2. 3. Actual results: Lot of AVC Expected results: No more AVC Additional info: See log attachment
Hi Nicolas, Do you also have container-selinux installed? If yes, which version it is? rpm -q container-selinux ls -l /var/lib/selinux/targeted/active/modules/200/container/
Yes, container-selinux is installed. # rpm -qa \*selinux\* python3-libselinux-2.9-3.1.fc30.x86_64 libselinux-2.9-3.1.fc30.x86_64 mysql-selinux-1.0.0-8.fc30.noarch rpm-plugin-selinux-4.14.2.1-5.fc30.x86_64 tpm2-abrmd-selinux-2.0.0-4.fc30.noarch selinux-policy-3.14.3-52.fc30.noarch python2-libselinux-2.9-3.1.fc30.x86_64 container-selinux-2.117.0-1.gitbfde70a.fc30.noarch mod_selinux-2.4.4-13.fc30.x86_64 selinux-policy-targeted-3.14.3-52.fc30.noarch libselinux-utils-2.9-3.1.fc30.x86_64 And # ls -l /var/lib/selinux/targeted/active/modules/200/container/ total 44 -rw-------. 1 root root 12359 4 déc. 22:24 cil -rw-r--r--. 1 root root 23083 4 déc. 22:24 hll -rw-r--r--. 1 root root 2 4 déc. 22:24 lang_ext After first update and reboot I found lot of new AVC. I ran "dnf history undo last" but if I remember there was still other problems and I decided to run an autorelabel (touch /.autorelabel). However I found errors in logs like: # journalctl -t setroubleshoot --since=today déc. 05 06:25:03 icaricio setroubleshoot[1302]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 05 06:25:03 icaricio setroubleshoot[1302]: audit event node=icaricio type=AVC msg=audit(1575523468.204:103): avc: denied { transition } for pid=1239 comm="(systemd)" path="/usr/lib/systemd/systemd" dev="md125" ino=265090 scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process permissive=1 déc. 05 06:28:29 icaricio setroubleshoot[2293]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 05 06:28:29 icaricio setroubleshoot[2293]: audit event node=icaricio type=AVC msg=audit(1575523705.27:199): avc: denied { dyntransition } for pid=2290 comm="sshd" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:sshd_net_t:s0 tclass=process permissive=1 déc. 05 06:28:31 icaricio setroubleshoot[2320]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 05 06:28:31 icaricio setroubleshoot[2320]: audit event node=icaricio type=AVC msg=audit(1575523708.53:214): avc: denied { dyntransition } for pid=2294 comm="sshd" scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process permissive=1 déc. 05 12:49:04 icaricio setroubleshoot[18029]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 05 12:49:04 icaricio setroubleshoot[18029]: audit event node=icaricio type=AVC msg=audit(1575546540.205:258): avc: denied { dyntransition } for pid=18028 comm="sshd" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:sshd_net_t:s0 tclass=process permissive=1 déc. 05 12:49:06 icaricio setroubleshoot[18057]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 05 12:49:06 icaricio setroubleshoot[18057]: audit event node=icaricio type=AVC msg=audit(1575546543.606:273): avc: denied { dyntransition } for pid=18032 comm="sshd" scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process permissive=1 I tried to install again selinux-policy-3.14.3-53.fc30 but logs are the same than before but not like the first update. # journalctl -t setroubleshoot --since=today déc. 05 17:59:42 icaricio setroubleshoot[1338]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 05 17:59:42 icaricio setroubleshoot[1338]: audit event node=icaricio type=AVC msg=audit(1575565147.443:161): avc: denied { transition } for pid=1280 comm="(systemd)" path="/usr/lib/systemd/systemd" dev="md126" ino=265090 scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process permissive=1 déc. 05 17:59:44 icaricio setroubleshoot[1962]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 05 17:59:44 icaricio setroubleshoot[1962]: audit event node=icaricio type=AVC msg=audit(1575565173.167:191): avc: denied { dyntransition } for pid=1904 comm="sshd" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:sshd_net_t:s0 tclass=process permissive=1 déc. 05 17:59:46 icaricio setroubleshoot[2024]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 05 17:59:46 icaricio setroubleshoot[2024]: audit event node=icaricio type=AVC msg=audit(1575565176.616:207): avc: denied { dyntransition } for pid=1917 comm="sshd" scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process permissive=1 So I don't know what to think.
Nicolas, There is an issue with container-selinux. We are getting in touch with the maintainer to create the update together. The same problem is in F31. At the moment, the recommended way how to approach it is to downgrade the selinux-policy package to the latest version available in updates repo. Uninstalling container-selinux would also help, but the module needs to be removed manually then.
Before downgrade I checked AVCs with selinux-policy-3.14.3-53.fc30 --- déc. 06 04:00:06 icaricio setroubleshoot[20982]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 06 04:00:06 icaricio setroubleshoot[20982]: audit event node=icaricio type=AVC msg=audit(1575601201.281:334): avc: denied { transition } for pid=20966 comm="(systemd)" path="/usr/lib/systemd/systemd" dev="md126" ino=265090 scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process permissive=1 déc. 06 04:00:08 icaricio setroubleshoot[20984]: SELinux interdit à (systemd) d'utiliser l'accès entrypoint sur le fichier /usr/lib/systemd/systemd.Pour des messages SELinux exhaustifs, lancez sealert -l 87f0dc46-3b9e-4185-a4a0-dca85384a390 --- I found an explanation this time --- # sealert -l 87f0dc46-3b9e-4185-a4a0-dca85384a390 SELinux interdit à (systemd) d'utiliser l'accès entrypoint sur le fichier /usr/lib/systemd/systemd. ***** Le greffon restorecon (99.5 de confiance) suggère ******************* Si vous souhaitez corriger l'étiquette. L'étiquette par défaut de /usr/lib/systemd/systemd devrait être init_exec_t. Alors vous pouvez lancer restorecon. La tentative d’accès pourrait avoir été stoppée due à des permissions insuffisantes d’accès au dossier parent, auquel cas essayez de changer la commande suivante en conséquence. Faire # /sbin/restorecon -v /usr/lib/systemd/systemd ***** Le greffon catchall (1.49 de confiance) suggère ********************* Si vous pensez que (systemd) devrait être autorisé à accéder entrypoint sur systemd file par défaut. Alors vous devriez rapporter ceci en tant qu'anomalie. Vous pouvez générer un module de stratégie local pour autoriser cet accès. Faire autoriser cet accès pour le moment en exécutant : # ausearch -c "(systemd)" --raw | audit2allow -M my-systemd # semodule -X 300 -i my-systemd.pp Informations complémentaires : Contexte source unconfined_u:unconfined_r:unconfined_t:s0 Contexte cible system_u:object_r:lib_t:s0 Objets du contexte /usr/lib/systemd/systemd [ file ] Source (systemd) Chemin de la source (systemd) Port <Unknown> Hôte icaricio Paquets RPM source Paquets RPM cible systemd-241-12.git323cdf4.fc30.x86_64 RPM de la statégie selinux-policy-3.14.3-53.fc30.noarch Selinux activé True Type de stratégie targeted Mode strict Permissive Nom de l'hôte icaricio Plateforme Linux icaricio 5.3.13-200.fc30.x86_64 #1 SMP Mon Nov 25 23:02:12 UTC 2019 x86_64 x86_64 Compteur d'alertes 6 Première alerte 2019-12-04 23:30:02 CET Dernière alerte 2019-12-06 04:00:01 CET ID local 87f0dc46-3b9e-4185-a4a0-dca85384a390 Messages d'audit bruts type=AVC msg=audit(1575601201.281:335): avc: denied { entrypoint } for pid=20966 comm="(systemd)" path="/usr/lib/systemd/systemd" dev="md126" ino=265090 scontext=unconfined_u:unconfined_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0 tclass=file permissive=1 Hash: (systemd),unconfined_t,lib_t,file,entrypoint --- I decided to downgrade selinux-policy package like you recommend (selinux-policy-3.14.3-52.fc30) and to be sure I ran an autorelabel. Same AVC are presents in logs but I don't know why because they wasn't present before: --- déc. 06 18:27:25 icaricio setroubleshoot[1358]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 06 18:27:25 icaricio setroubleshoot[1358]: audit event node=icaricio type=AVC msg=audit(1575653208.318:161): avc: denied { transition } for pid=1239 comm="(systemd)" path="/usr/lib/systemd/systemd" dev="md125" ino=265090 scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process permissive=1 déc. 06 18:28:17 icaricio setroubleshoot[2201]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 06 18:28:17 icaricio setroubleshoot[2201]: audit event node=icaricio type=AVC msg=audit(1575653292.619:199): avc: denied { dyntransition } for pid=2199 comm="sshd" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:sshd_net_t:s0 tclass=process permissive=1 déc. 06 18:28:19 icaricio setroubleshoot[2230]: setroubleshoot generated AVC, exiting to avoid recursion, context=system_u:system_r:kernel_t:s0, AVC scontext=system_u:system_r:kernel_t:s0 déc. 06 18:28:19 icaricio setroubleshoot[2230]: audit event node=icaricio type=AVC msg=audit(1575653295.641:214): avc: denied { dyntransition } for pid=2203 comm="sshd" scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process permissive=1 --- Thanks for your work.
I've got an error during update --- # dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2019-e9d8868185 --refresh Fedora Modular 30 - x86_64 18 kB/s | 23 kB 00:01 Fedora Modular 30 - x86_64 - Updates 27 kB/s | 20 kB 00:00 Fedora 30 - x86_64 - Test Updates 27 kB/s | 21 kB 00:00 Fedora 30 - x86_64 - Test Updates 126 kB/s | 1.7 MB 00:14 Fedora 30 - x86_64 - Updates 47 kB/s | 22 kB 00:00 Fedora 30 - x86_64 45 kB/s | 23 kB 00:00 RPM Fusion for Fedora 30 - Free - Updates 20 kB/s | 9.6 kB 00:00 RPM Fusion for Fedora 30 - Free 25 kB/s | 10 kB 00:00 RPM Fusion for Fedora 30 - Nonfree - Updates 20 kB/s | 9.8 kB 00:00 RPM Fusion for Fedora 30 - Nonfree 27 kB/s | 11 kB 00:00 Dépendances résolues. ================================================================================================================================================================================================================================================================================================================================================================================================================ Paquet Architecture Version Dépôt Taille ================================================================================================================================================================================================================================================================================================================================================================================================================ Mise à jour: container-selinux noarch 2:2.123.0-2.fc30 updates-testing 47 k selinux-policy noarch 3.14.3-53.fc30 updates-testing 116 k selinux-policy-targeted noarch 3.14.3-53.fc30 updates-testing 15 M Résumé de la transaction ================================================================================================================================================================================================================================================================================================================================================================================================================ Mettre à niveau 3 Paquets Taille totale des téléchargements : 15 M Voulez-vous continuer ? [o/N] : o Téléchargement des paquets : (1/3): container-selinux-2.123.0-2.fc30.noarch.rpm 27 kB/s | 47 kB 00:01 (2/3): selinux-policy-3.14.3-53.fc30.noarch.rpm 59 kB/s | 116 kB 00:01 (3/3): selinux-policy-targeted-3.14.3-53.fc30.noarch.rpm 136 kB/s | 15 MB 01:49 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 137 kB/s | 15 MB 01:49 Test de la transaction La vérification de la transaction a réussi. Lancement de la transaction de test Transaction de test réussie. Exécution de la transaction Préparation : 1/1 Mise à jour de : selinux-policy-3.14.3-53.fc30.noarch 1/6 Exécution du scriptlet: selinux-policy-3.14.3-53.fc30.noarch 1/6 Exécution du scriptlet: selinux-policy-targeted-3.14.3-53.fc30.noarch 2/6 Mise à jour de : selinux-policy-targeted-3.14.3-53.fc30.noarch 2/6 Exécution du scriptlet: selinux-policy-targeted-3.14.3-53.fc30.noarch 2/6 Conflicting name type transition rules Binary policy creation failed at /var/lib/selinux/targeted/tmp/modules/200/container/cil:1784 Failed to generate binary /usr/sbin/semodule: Failed! Mise à jour de : container-selinux-2:2.123.0-2.fc30.noarch 3/6 Exécution du scriptlet: container-selinux-2:2.123.0-2.fc30.noarch 3/6 Nettoyage de : container-selinux-2:2.117.0-1.gitbfde70a.fc30.noarch 4/6 Exécution du scriptlet: container-selinux-2:2.117.0-1.gitbfde70a.fc30.noarch 4/6 Nettoyage de : selinux-policy-targeted-3.14.3-52.fc30.noarch 5/6 Exécution du scriptlet: selinux-policy-targeted-3.14.3-52.fc30.noarch 5/6 Nettoyage de : selinux-policy-3.14.3-52.fc30.noarch 6/6 Exécution du scriptlet: selinux-policy-3.14.3-52.fc30.noarch 6/6 Vérification de : container-selinux-2:2.123.0-2.fc30.noarch 1/6 Vérification de : container-selinux-2:2.117.0-1.gitbfde70a.fc30.noarch 2/6 Vérification de : selinux-policy-3.14.3-53.fc30.noarch 3/6 Vérification de : selinux-policy-3.14.3-52.fc30.noarch 4/6 Vérification de : selinux-policy-targeted-3.14.3-53.fc30.noarch 5/6 Vérification de : selinux-policy-targeted-3.14.3-52.fc30.noarch 6/6 Mis à niveau: container-selinux-2:2.123.0-2.fc30.noarch selinux-policy-3.14.3-53.fc30.noarch selinux-policy-targeted-3.14.3-53.fc30.noarch Terminé ! --- I reinstall container-selinux with no error this time --- # dnf reinstall https://kojipkgs.fedoraproject.org//packages/container-selinux/2.123.0/2.fc30/noarch/container-selinux-2.123.0-2.fc30.noarch.rpm Dernière vérification de l’expiration des métadonnées effectuée il y a 0:16:09 le sam. 07 déc. 2019 06:38:47 CET. container-selinux-2.123.0-2.fc30.noarch.rpm 19 kB/s | 47 kB 00:02 Dépendances résolues. ================================================================================================================================================================================================================================================================================================================================================================================================================ Paquet Architecture Version Dépôt Taille ================================================================================================================================================================================================================================================================================================================================================================================================================ Réinstallation: container-selinux noarch 2:2.123.0-2.fc30 @commandline 47 k Résumé de la transaction ================================================================================================================================================================================================================================================================================================================================================================================================================ Taille totale : 47 k Taille des paquets installés : 44 k Voulez-vous continuer ? [o/N] : o Téléchargement des paquets : Test de la transaction La vérification de la transaction a réussi. Lancement de la transaction de test Transaction de test réussie. Exécution de la transaction Préparation : 1/1 Réinstallation : container-selinux-2:2.123.0-2.fc30.noarch 1/2 Exécution du scriptlet: container-selinux-2:2.123.0-2.fc30.noarch 1/2 Nettoyage de : container-selinux-2:2.123.0-2.fc30.noarch 2/2 Exécution du scriptlet: container-selinux-2:2.123.0-2.fc30.noarch 2/2 Vérification de : container-selinux-2:2.123.0-2.fc30.noarch 1/2 Vérification de : container-selinux-2:2.123.0-2.fc30.noarch 2/2 Réinstallé: container-selinux-2:2.123.0-2.fc30.noarch Terminé ! ---
I just found 2 others AVC --- déc. 07 07:03:57 icaricio setroubleshoot[1914]: SELinux interdit à php-fpm d'utiliser l'accès execmem sur un processus.Pour des messages SELinux exhaustifs, lancez sealert -l 54ed1456-e900-4a74-be69-c8db1a79cec6 déc. 07 07:04:08 icaricio setroubleshoot[2205]: SELinux interdit à zabbix_server d'utiliser l'accès write sur le sock_file zabbix_server_alerter.sock.Pour des messages SELinux exhaustifs, lancez sealert -l dc11e8aa-34e3-4c84-b2f2-2054ae6a3bde déc. 07 11:37:04 icaricio setroubleshoot[13196]: SELinux interdit à zabbix_server d'utiliser l'accès write sur le sock_file zabbix_server_preprocessing.sock.Pour des messages SELinux exhaustifs, lancez sealert -l dc11e8aa-34e3-4c84-b2f2-2054ae6a3bde --- See Logs_20191207.txt for details.
Created attachment 1642828 [details] Sealert details
Hi Nicolas, I believe that the problem with clashing packages is gone. Please use selinux-policy-3.14.3-53.fc30.noarch and container-selinux-2.124.0-3.fc30.noarch packages or newer. Checking the attachment, I found 2 issues: 1. httpd execmem The execmem permission is required for mapping a memory region as executable which is not common and is possibly insecure so it is disabled by default. It can be turned on using the httpd_execmem boolean: # semanage boolean -l | grep httpd_execmem httpd_execmem (off , off) Allow httpd scripts and modules execmem/execstack However, before doing that you should look for documentation of the php modules used or check with the scripts vendor as this permission should not be required so it could have been done by design as well as a result of a bug in the code. 2. zabbix tmp file More information is required to assess this issue. Do you have a reproducing scenario? Was it a result of a configuration change? Is zabbix communicating with other processes? I prefer creating another bugzilla for this particular issue and include all information there. Additionally I'd suggest: # to delete the implicit rule for not auditing auditctl -d never,task # to enable full auditing auditctl -w /etc/shadow -p w -k shadow-write Then reproduce the issue and collect the audit logs: LC_ALL=C ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts recent
Hi Nicolas, Are some of the issues reported still in place? If yes, please answer the questions in the previous update.
Sorry about the delay. My server has been migrated from F30 to F31 and I still have the same alerts. Now I use selinux-policy-3.14.4-49.fc31.noarch and container-selinux-2.124.0-3.fc31.noarch. 1. For now, I’ll look into that problem later and the link with php-fpm. 2. The bug was already present https://bugzilla.redhat.com/show_bug.cgi?id=1683820 . I’ll give the answers in this bug report. I think my bug can be closed regarding regressions. Thanks for your interest.
Nicolas, Thank you for the confirmation. For unrelated issues please use separate bugs.