Bug 1309108

Summary: chrond reports a NULL security context for user, but SELinux in permissive mode, continuing ()
Product: [Fedora] Fedora Reporter: David <dwoody5654>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED EOL QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 23CC: benl, dwalsh, dwoody5654, jpyeron, mmalik
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 18:46:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David 2016-02-16 21:36:34 UTC
Description of problem: seemed to be bug #1298192 and I applied the fix from comment #19.
The content fo mycron.cil is:

(allow unconfined_t user_cron_spool_t( file ( entrypoint)))

SELinux does not report any errors. However crond log file reports:

NULL security context for user, but SELinux in permissive mode, continuing ()

Version-Release number of selected component (if applicable):

selinux-policy-targeted-3.13.1-158.4.fc23.noarch


How reproducible:
I have only done this on one computer

Steps to Reproduce:
1. changed SELinux from disabled to permissive; set ./autorelabel and rebooted
2. applied fix as above


Actual results:
No SELinux errors, however,
crond reports the error:
NULL security context for user, but SELinux in permissive mode, continuing ()

Expected results:
No error report.

Additional info:
The following is the post I made to bug#1298192:

> I am new to SELinux but have been using Fedora since 16.
> Currently using in permissive mode and SELinux gave errors for
> /var/spool/cron/username as follows:
> 
> SELinux:  Context system_u:object_r::s0 is not valid (left unmapped).
> 
> After implementing the fix in comment 19 SELinux does not have errors but I
> get messages from crond as:
> 
> NULL security context for user, but SELinux in permissive mode, continuing ()
> 
> Is this as it should be or do I need to do something in addition to the fix
> in comment 19?

pmoore responded with:

I would suggest filing a new BZ for your problem as it appears to be unrelated to this issue discussed here.

Comment 1 Miroslav Grepl 2016-02-18 11:31:44 UTC
Just to be sure, what does 

rpm -q kernel selinux-policy-targetd

and

sesearch -A -s unconfined_t -t user_cron_spool_t -c file -C


Thank you.

Comment 2 David 2016-02-18 14:16:13 UTC
(In reply to Miroslav Grepl from comment #1)
> Just to be sure, what does 
> 
> rpm -q kernel selinux-policy-targetd

rpm -qa| grep kernel

kernel-PAE-modules-4.3.4-300.fc23.i686
kernel-PAE-core-4.3.5-300.fc23.i686
kernel-headers-4.3.5-300.fc23.i686
kernel-PAE-modules-4.3.3-303.fc23.i686
kernel-PAE-core-4.3.3-303.fc23.i686
kernel-PAE-4.3.5-300.fc23.i686
kernel-PAE-core-4.3.4-300.fc23.i686
kernel-PAE-modules-4.3.5-300.fc23.i686

rpm -q  selinux-policy-targeted

selinux-policy-targeted-3.13.1-158.4.fc23.noarch

> 
> and
> 
> sesearch -A -s unconfined_t -t user_cron_spool_t -c file -C
> 
sesearch -A -s unconfined_t -t user_cron_spool_t -c file -C

Found 5 semantic av rules:
   allow files_unconfined_type file_type : file { ioctl read write create getattr setattr lock relabelfrom relabelto append unlink link rename execute swapon quotaon mounton execute_no_trans open audit_access } ;
   allow unconfined_t user_cron_spool_t : file { ioctl read write getattr entrypoint } ;
   allow application_domain_type user_cron_spool_t : file { ioctl read write getattr lock append } ;
ET allow files_unconfined_type file_type : file execmod ; [ selinuxuser_execmod ]
ET allow unconfined_t user_cron_spool_t : file entrypoint ; [ cron_userdomain_transition ]

David

> 
> Thank you.

Comment 3 Fedora End Of Life 2016-11-24 15:36:08 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2016-12-20 18:46:20 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Jason Pyeron 2019-01-31 16:43:42 UTC
On RHEL 7 we got the below in logwatch today, can this bug be reopened and pointed at RHEL 7?


 ################### Logwatch 7.4.0 (03/01/11) #################### 
        Processing Initiated: Thu Jan 31 03:07:04 2019
        Date Range Processed: yesterday
                              ( 2019-Jan-30 )
                              Period is day.
        Detail Level of Output: 0
        Type of Output/Format: mail / text
        Logfiles for Host: xxxxxxxxxxxxxxxxxxxxxx.mil
 ################################################################## 
 
 --------------------- Cron Begin ------------------------ 

 **Unmatched Entries**
 NULL security context for user, but SELinux in permissive mode, continuing ()
 NULL security context for user, but SELinux in permissive mode, continuing ()
 NULL security context for user, but SELinux in permissive mode, continuing ()
 NULL security context for user, but SELinux in permissive mode, continuing ()
 NULL security context for user, but SELinux in permissive mode, continuing ()
 
 ---------------------- Cron End ------------------------- 

 
 --------------------- Connections (secure-log) Begin ------------------------ 

 
 REMOVED
 
 ---------------------- Connections (secure-log) End ------------------------- 

 
 --------------------- SSHD Begin ------------------------ 

 
 REMOVED
 
 ---------------------- SSHD End ------------------------- 

 
 --------------------- Disk Space Begin ------------------------ 

 REMOVED
 
 
 ---------------------- Disk Space End ------------------------- 

 
 ###################### Logwatch End #########################

Comment 6 Milos Malik 2020-04-03 08:09:02 UTC
Do you still see the following messages in system journal or in /var/log/cron?

NULL security context for user, but SELinux in permissive mode, continuing ()

Which RHEL-7.x version do you use?

# rpm -qa selinux\* cron\*

Comment 7 Red Hat Bugzilla 2023-09-14 03:17:56 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days