Bug 2319823

Summary: Waydroid can't mount the Android image
Product: [Fedora] Fedora Reporter: Andrea Daloia <andreadaloia>
Component: waydroidAssignee: Alessandro Astone <ales.astone>
Status: CLOSED NOTABUG QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 41CC: ales.astone
Target Milestone: ---Keywords: Desktop, Regression, Upgrades
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-11-03 18:04:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/var/lib/waydroid/waydroid.log
none
Screenshot of sudo dmesg and systemctl status none

Description Andrea Daloia 2024-10-18 18:04:38 UTC
When I start waydroid from the menu nothing happens. If I try to start it with the terminal there is a bug that concerns an error in mounting the image. The strange thing that until a few days ago everything worked perfectly. From dmesg I think that the problem is related to selinux but I am not sure.

Reproducible: Always

Steps to Reproduce:
1.sudo dnf install waydroid
2.follow the steps on the official website of waydroid to initialize it
3.start waydroid from the menu or from the terminal
Actual Results:  
waydroid can't mount the image

Expected Results:  
waydroid starts succesfully

From terminal:
$ waydroid show-full-ui
[19:42:40] Starting waydroid session
[19:42:41] RuntimeError: Command failed: % mount -o context="system_u:object_r:waydroid_rootfs_t:s0",ro /var/lib/waydroid/images/system.img /var/lib/waydroid/rootfs

From sudo dmesg:
[ 1255.701195] loop0: detected capacity change from 0 to 3491328
[ 1255.708006] SELinux: security_context_str_to_sid (system_u:object_r:waydroid_rootfs_t:s0) failed with errno=-22

From sudo systemctl status waydroid-container.service:
[19:42:41] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log

Comment 1 Andrea Daloia 2024-10-18 18:06:24 UTC
Created attachment 2052705 [details]
/var/lib/waydroid/waydroid.log

Waydroid log

Comment 2 Andrea Daloia 2024-10-18 18:08:19 UTC
Created attachment 2052706 [details]
Screenshot of sudo dmesg and systemctl status

Comment 3 Alessandro Astone 2024-10-18 22:59:16 UTC
I cannot reproduce.

> until a few days ago everything worked perfectly

Presumably a selinux update broke the waydroid module.
Indeed there is a selinux-policy update in testing: https://bodhi.fedoraproject.org/updates/FEDORA-2024-8707c24571

I don't remember off the top of my head how to debug a module...
Does `sudo semodule list` include `waydroid`?
Does `sudo semodule --build` work? Does waydroid work after the command?
You can also try reinstalling the `waydroid-selinux` package.

Comment 4 Andrea Daloia 2024-10-19 08:56:08 UTC
When upgrading to Fedora 41 the test repositories are enabled by default so I tried with the stable version of selinux-policy(41.20), disabling the test repositories, and waydroid starts normall but with a lot of messages from selinux. With 41.21 it doesn't even starts. Sorry maybe I should have specified this detail.

"sudo semodule -l" lists also waydroid

$ sudo semodule -B
Failed to resolve typeattributeset statement at /var/lib/selinux/targeted/tmp/modules/200/snappy/cil:223
Failed to resolve AST
semodule:  Failed!

These are the output of the commands and are the same with both versions, maybe they can help.

Thanks for the support.