-
Notifications
You must be signed in to change notification settings - Fork 57
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
Infinite loop for new mount after deleting mount #253
Comments
The attached patch will resolve the problem. |
I failed to reproduce the issue. Are the steps complete? Wasn't the |
If it makes a difference I'm running fapolicyd 1.3.1 on RHEL 8, but I haven't seen any changes between 1.3.1 and 1.3.2 that would resolve the problems I'm seeing. The rules/trustdb do not come into play, so I'm not sure why |
I was trying it on rhel9. I'll try rhel8 as well. |
Output from the terminals I used to recreate: |
Also . . . the problem only manifests when there are no mount points to watch when fapolicyd starts. |
The patch changes the fanotify_update function to properly handle deleting nodes when updating mount points. This should take care of issue #253.
Hello, I just pushed commit d9029f8 which should take care of the problem. It fixes the code where it sits rather than making a new function. Please give it a try and let me know if it fixes your problem. |
If there are no mounted watch types initially, then a second mount point to watch is detected, after the first mount point is deleted, the daemon will enter an infinite loop. To re-create, from a fresh install:
# systemctl stop fapolicyd
watch_fs = ramfs
# /usr/sbin/fapolicyd --debug
# mkdir /tmp/test
# mount -t ramfs /dev/ram0 /tmp/test
# umount /tmp/test
# mount -t ramfs /dev/ram0 /tmp/test
.
.
.
Trust database checks OK
Starting to listen for events
Mount change detected
Added /test mount point
Mount change detected
Deleted /test mount point
Mount change detected
Added /test mount point
Added /test mount point
Added /test mount point
Added /test mount point
Added /test mount point
.
.
.
The text was updated successfully, but these errors were encountered: