Skip to content

ProtectClock=yes blocks mount() system call for block device nodes #18142

Closed

Description

@cgwalters

systemd version the issue has been seen with

systemd-246.7-1.fc33.x86_64 and libseccomp-2.5.0-3.fc33.x86_64

Used distribution

Fedora CoreOS

Linux kernel version used (uname -a)

Linux cosa-devsh 5.9.16-200.fc33.x86_64 #1 SMP Mon Dec 21 14:08:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

CPU architecture issue was seen on

x86_64

Having ProtectClock=yes seems to strangely deny use of mount():

$ systemd-run -Pq -p ProtectClock=yes -p MountFlags=slave mount /dev/disk/by-label/EFI-SYSTEM /boot/efi/
mount: /boot/efi: permission denied.
$

Yet this works:

$ systemd-run -Pq -p MountFlags=slave mount /dev/disk/by-label/EFI-SYSTEM /boot/efi/
$

This came up in coreos/bootupd#127

I skimmed the relevant code and didn't see why this would be the case.

Activity

  1. poettering commented on Jan 6, 2021

    @poettering
    Member

    selinux?

  2. added
    needs-reporter-feedback ❓
    on Jan 6, 2021
  3. jengelh commented on Aug 27, 2021

    @jengelh
    Contributor

    Had a similar issue.
    ProtectClock=yes implies DeviceAllow=char-rtc r per the documentation. Unfortunately, any DeviceAllow line (implied or spelled out in a unit file) also implies that other devices are forbidden. This makes ProtectClock= quite a bit sneaky.

  4. changed the title [-]ProtectClock=yes blocks mount() system call[/-] [+]ProtectClock=yes blocks mount() system call for block device nodes[/+] on Sep 29, 2021
  5. added this to the v252 milestone on Mar 10, 2022
  6. removed
    needs-reporter-feedback ❓
    on Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions