Bug 967878 - datetimectl set-local-rtc does not persists due to a selinux avc
datetimectl set-local-rtc does not persists due to a selinux avc
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
19
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-28 09:12 EDT by Reartes Guillermo
Modified: 2013-05-29 23:34 EDT (History)
10 users (show)

See Also:
Fixed In Version: selinux-policy-3.12.1-47.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-29 23:34:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Reartes Guillermo 2013-05-28 09:12:16 EDT
Description of problem:

Due to a selinux AVC, when one uses datetimectl to set set-local-rtc, the
changes do not persist after a reboot.


Version-Release number of selected component (if applicable):
F19b RC4 (19.30-1)
systemd.x86_64  204-2.fc19

How reproducible:
always


Steps to Reproduce:

1- Install F19b RC4 and boot it.

2- Login to the installed system and:

# timedatectl 
      Local time: Tue 2013-05-28 09:54:37 ART
  Universal time: Tue 2013-05-28 12:54:37 UTC
        RTC time: Tue 2013-05-28 09:54:37
        Timezone: America/Argentina/Buenos_Aires (ART, -0300)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

# timedatectl set-local-rtc true

SELINUX audit.log:

type=AVC msg=audit(1369745710.616:414): avc:  denied  { create } for  pid=732 comm="systemd-timedat" name=".adjtimeJdpsqN" scontext=system_u:system_r:systemd_timedated_t:s0 tcontext=system_u:object_r:adjtime_t:s0 tclass=file
type=SYSCALL msg=audit(1369745710.616:414): arch=c000003e syscall=2 success=no exit=-13 a0=7f4c4aefd7a0 a1=800c2 a2=180 a3=0 items=0 ppid=1 pid=732 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="systemd-timedat" exe="/usr/lib/systemd/systemd-timedated" subj=system_u:system_r:systemd_timedated_t:s0 key=(null)

# timedatectl 
      Local time: Tue 2013-05-28 09:56:46 ART
  Universal time: Tue 2013-05-28 12:56:46 UTC
        RTC time: Tue 2013-05-28 09:56:46
        Timezone: America/Argentina/Buenos_Aires (ART, -0300)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: yes
      DST active: n/a

Warning: The RTC is configured to maintain time in the local time zone. This
         mode is not fully supported and will create various problems with time
         zone changes and daylight saving adjustments. If at all possible use
         RTC in UTC, by calling 'timedatectl set-local-rtc 0'.

# int 6

# timedatectl 
      Local time: Tue 2013-05-28 09:58:23 ART
  Universal time: Tue 2013-05-28 12:58:23 UTC
        RTC time: Tue 2013-05-28 09:58:23
        Timezone: America/Argentina/Buenos_Aires (ART, -0300)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a


Actual results:
selinux must be put in permissive in order to execute 'timedatectl set-local-rtc true'.

Expected results:
no selinux avc
Comment 1 Harald Hoyer 2013-05-29 06:13:01 EDT
Doesn't that say, that the selinux policy has to be updated to allow
/usr/lib/systemd/systemd-timedated to create a file with
tcontext=system_u:object_r:adjtime_t:s0 in /etc ?
Comment 2 Miroslav Grepl 2013-05-29 08:40:57 EDT
commit db8a7d6ffa425b5ba2db7321a50c3181dc2d5ac3
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Wed May 29 14:40:42 2013 +0200

    Allow systemd-timedated to create adjtime
Comment 3 Fedora Update System 2013-05-29 10:20:44 EDT
selinux-policy-3.12.1-47.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-47.fc19
Comment 4 Fedora Update System 2013-05-29 13:47:35 EDT
Package selinux-policy-3.12.1-47.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.12.1-47.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-9565/selinux-policy-3.12.1-47.fc19
then log in and leave karma (feedback).
Comment 5 Fedora Update System 2013-05-29 23:34:40 EDT
selinux-policy-3.12.1-47.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.