Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fapolicyd-cli -u with debdb backend triggers system lockup #259

Closed
stridge-cruxml opened this issue Aug 3, 2023 · 4 comments · Fixed by #260
Closed

fapolicyd-cli -u with debdb backend triggers system lockup #259

stridge-cruxml opened this issue Aug 3, 2023 · 4 comments · Fixed by #260

Comments

@stridge-cruxml
Copy link
Contributor

When fapolicyd-cli -u is called, and fapolicyd is already running a system lockup is triggered.

Still investigating but my theory is trying to open the .md5sum files is blocked, causing a crash/lockup.

@stevegrubb
Copy link
Member

fapolicyd approves any access request for itself. I wonder if this is a pid vs thread id issue? (Look around line 402 of notify.c) The only debugging advice I have is use printf alot. You cannot ptrace it or it locks up.

@stridge-cruxml
Copy link
Contributor Author

Thanks!

This is the output of the log every time I run it. It gets to the same package every time which I find strange. I thought it would be a race condition somewhere.

Package 1323 / 1327 : python3-blinkerLoading file backend
Creating trust database
Loading trust data from debdb backend
Loading trust data from file backend
added / mount point
added /dev/shm mount point
added /run/lock mount point
added /boot/efi mount point
added /run/snapd/ns mount point
added /run/user/1000 mount point
Starting to listen for events
It looks like there was an update of the system... Syncing DB.
backend debdb registered
backend file registered
Loading debdb backend
Computing hashes for 1327 packages.
Package 6 / 1327 : cryptsetup-bin

Ill keep looking :)

@stridge-cruxml
Copy link
Contributor Author

So it stalls inside dpkg library. Seems to be related to the hash table.

I have found a fix. Calling:

fsys_hash_reset();

Before asking dpkg to construct the package hash table seems to resolve the issue. I will make a PR

@darrinh
Copy link

darrinh commented Aug 29, 2023

Hi, thanks, works properly now for me in 22.04.

cheers
Darrin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants