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

Write to console error message when trying to rename a whitelisted file #2874

Open
crass opened this issue Jul 27, 2019 · 2 comments
Open

Write to console error message when trying to rename a whitelisted file #2874

crass opened this issue Jul 27, 2019 · 2 comments
Labels
enhancement New feature request

Comments

@crass
Copy link
Collaborator

crass commented Jul 27, 2019

Since the issue where rename fails on whitelisted files is somewhat common. I suggest that we try to actively notify the user when this issue is triggered. I think we can actively enable this notification only for selected profiles by adding a config option (eg. notify-rename-whitelist).

For such profiles, we could hook rename with LD_PRELOAD library. When a rename fails with EBUSY, check that the file is a mountpoint, and then write to the console a glaring message saying something to the effect that this is a known issue and to go to a url in our wiki explaining the issue and potential work arounds.

For extra points, we could detect that a program is a graphical one and also popup the message in a popup box (using our own custom program or something like xmessage, but prettier, on the host system).

Using LD_PRELOAD won't work for programs that bypass glibc for syscalls, but I'd expect that to be a rare situation.

For reference, see:

@Vincent43
Copy link
Collaborator

Why not add this into whitelist option?

@netblue30
Copy link
Owner

I would say let's try it out. We are already doing something similar to LD_PRELOAD for --trace and --tracelog. Also seccomp ends up there in some cases.

It's not a pure LD_PRELOAD, more like a global one based on /etc/ld.preload file. So we generate a new /etc/ld.preload file and we place in it some of our libraries (src/libtrace, src/libtracelog, src/libpostexec). When the sandboxed program starts, it will load the .so libraries. The code to build the new /etc/ld.preload is in fs_trace,c.

@netblue30 netblue30 added the enhancement New feature request label Jul 31, 2019
@kmk3 kmk3 changed the title Write to console error message when trying to rename a whitelisted file. Write to console error message when trying to rename a whitelisted file Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request
Projects
None yet
Development

No branches or pull requests

3 participants