Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 792723 - Failed to install sec-policy/selinux-base-policy (2.20210203-r1) - !!! [Errno 61] No data available
Summary: Failed to install sec-policy/selinux-base-policy (2.20210203-r1) - !!! [Errno...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-29 01:47 UTC by fuuon
Modified: 2022-03-09 06:41 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info, sec-policy/selinux-base-policy log and strace last lines result (errno61.txt,15.00 KB, text/plain)
2021-05-29 01:47 UTC, fuuon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fuuon 2021-05-29 01:47:07 UTC
Created attachment 712098 [details]
emerge --info, sec-policy/selinux-base-policy log and strace last lines result

>>> Completed installing sec-policy/selinux-base-policy-2.20210203-r1 into /var/tmp/portage/sec-policy/selinux-base-policy-2.20210203-r1/image

 ^[[32;01m*^[[0m Final size of build directory: 56044 KiB (54.7 MiB)
 ^[[32;01m*^[[0m Final size of installed tree:  13948 KiB (13.6 MiB)

 ^[[32;01m*^[[39;49;00m checking 40 files for package collisions
>>> Merging sec-policy/selinux-base-policy-2.20210203-r1 to /
--- /usr/
--- /usr/share/
--- /usr/share/selinux/
--- /usr/share/selinux/strict/
!!! Failed to move /var/tmp/portage/sec-policy/selinux-base-policy-2.20210203-r1/image/usr/share/selinux/strict/application.pp to /usr/share/selinux/strict/application.pp
!!! [Errno 61] No data available

Emerging sec-policy/selinux-base-policy according to https://wiki.gentoo.org/wiki/SELinux/Installation#Installing_policies_and_utilities.2C_part_two results in "!!! [Errno 61] No data available". Tried to install SELinux 4 times, in two different computers, but always received the same Errno 61 every time.
Comment 1 Lorenzo Iannuzzi 2021-08-11 03:40:18 UTC
I had the same exact thing happen to me. perhaps its related to sys-apps/systemd-tmpfiles being masked?

I've installed SELinux on Gentoo before and I've never had any of these problems.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-11 03:41:59 UTC
I believe this is a documentation error from rebooting into the SELinux enabled kernel too early.
Comment 3 Lorenzo Iannuzzi 2021-08-11 03:46:10 UTC
(In reply to Sam James from comment #2)
> I believe this is a documentation error from rebooting into the SELinux
> enabled kernel too early.

I didn't reboot into the SELinux-enabled kernel though.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-11 03:48:40 UTC
(In reply to Lorenzo Iannuzzi from comment #3)
> (In reply to Sam James from comment #2)
> > I believe this is a documentation error from rebooting into the SELinux
> > enabled kernel too early.
> 
> I didn't reboot into the SELinux-enabled kernel though.

I mention it because https://wiki.gentoo.org/wiki/SELinux/Installation#Installing_a_SELinux_kernel comes too early, and basically all of the configuration should be done first. But that definitely makes things more confusing if you haven't.
Comment 5 Lorenzo Iannuzzi 2021-08-11 03:50:13 UTC
(In reply to Lorenzo Iannuzzi from comment #3)
> (In reply to Sam James from comment #2)
> > I believe this is a documentation error from rebooting into the SELinux
> > enabled kernel too early.
> 
> I didn't reboot into the SELinux-enabled kernel though.

Rather, what I mean is that my Kernel already was configured for SELinux so I didn't need to reboot.

I don't know why this would be an issue as I've always done installed SELinux like this.
Comment 6 Jonathan Davies 2021-08-11 20:37:06 UTC
Lorenzo, please check:

$ cat /proc/cmdline
$ sestatus

And also:

$ getfattr -m . -d /var/tmp/portage/sec-policy/selinux-base-policy-2.20210203-r1/image/usr/share/selinux/strict/application.pp

...but on the file which it says is getting no data for you, this error indicates  that there's no SELinux label for the file in question.
Comment 7 Lorenzo Iannuzzi 2021-08-12 02:54:31 UTC
(In reply to Jonathan Davies from comment #6)
> Lorenzo, please check:
> 
> $ cat /proc/cmdline
> $ sestatus
> 
> And also:
> 
> $ getfattr -m . -d
> /var/tmp/portage/sec-policy/selinux-base-policy-2.20210203-r1/image/usr/
> share/selinux/strict/application.pp
> 
> ...but on the file which it says is getting no data for you, this error
> indicates  that there's no SELinux label for the file in question.

I'm not sure I follow?
Comment 8 Jonathan Davies 2021-08-12 10:38:35 UTC
(In reply to Lorenzo Iannuzzi from comment #7)
> I'm not sure I follow?

You said that you have the same problem, but you haven't provided an error message/log - and we also have to make sure you haven't enabled SELinux while booting as this error is usually cause by portage over-eagerly enabling its SELinux features.
Comment 9 Lorenzo Iannuzzi 2021-08-12 11:01:50 UTC
(In reply to Jonathan Davies from comment #8)
> (In reply to Lorenzo Iannuzzi from comment #7)
> > I'm not sure I follow?
> 
> You said that you have the same problem, but you haven't provided an error
> message/log - and we also have to make sure you haven't enabled SELinux
> while booting as this error is usually cause by portage over-eagerly
> enabling its SELinux features.

Ah sure thing.

``cat /proc/cmdline`` resulted in
``BOOT_IMAGE=/vmlinuz-5.10.52-gentoo-i2n2z root=UUID=a24b7a58-bda9-4f45-9351-5e8691de1400 ro``

``sestatus`

``SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             strict
Current mode:                   permissive
Mode from config file:          disabled
Policy MLS status:              disabled
Policy deny_unknown status:     denied
Memory protection checking:     actual (secure)
Max kernel policy version:      33``

and ``getfattr -m . -d  ``getfattr -m . -d /var/tmp/portage/sec-policy/selinux-base-policy-2.20200818-r2/image/usr/share/selinux/strict/application.pp``

didn't return anything
Comment 10 Lorenzo Iannuzzi 2021-08-12 11:02:34 UTC
(In reply to Lorenzo Iannuzzi from comment #9)

sorry seems like i might have formatted things incorrectly
Comment 11 Jonathan Davies 2021-08-12 12:14:09 UTC
(In reply to Lorenzo Iannuzzi from comment #9)
> SELinux status:                 enabled

As Sam said, you have SELinux enabled, and in permissive mode, whereas you need to completely disable it during the initial setup (via selinux=0 as a temporary option in your bootloader).

Otherwise, Portage prematurely enables some selinux features, and this error occurs.
Comment 12 John Tate 2022-03-09 06:41:06 UTC
I have had issues related to this in the past, there are a couple of things that can go wrong.

One is mentioned which is booting with the selinux=0 parameter.

It is also mentioned that it can start enforcing prematurely and an issue here a kernel option which appears unneeded but for some reason it isn't. This is the "SELinux development support" which is actually required for the kernel to start in permissive mode.

Both of these issues will have the issue installing selinux-base-policy where one will get error mentioned in this bug.

Why not have the selinux-base ebuild throw a warning if both things are an issue on someone's system?