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

Access Issue with Linux dmesg #226

Open
rbrisita opened this issue Apr 7, 2024 · 1 comment
Open

Access Issue with Linux dmesg #226

rbrisita opened this issue Apr 7, 2024 · 1 comment

Comments

@rbrisita
Copy link
Contributor

rbrisita commented Apr 7, 2024

Describe the bug
The software\source\server\utils\kernel.py function get_kernel_messages is trying to access a file that doesn't exist on some Linux distros (all?) like Arch, Debian, and Fedora. Unfortunately, similar logs like /var/log/syslog and /var/log/kern.log have access restrictions. This is a security concern.

To Reproduce
Run poetry run 01 on any Linux distro based on Arch, Debian, Fedora.

Expected behavior
A clean boot into 01OS.

Desktop (please complete the following information):

  • OS: Armbian 24.2.1 (Debian) aarch64
  • Python Version 3.10.14

Additional context

Task exception was never retrieved
future: <Task finished name='Task-6' coro=<put_kernel_messages_into_queue() done, defined at /home/rb/projects/Open>
Traceback (most recent call last):
 File "/home/rb/projects/OpenInterpreter/01/software/source/server/utils/kernel.py", line 65, in put_kernel_messag>
   text = check_filtered_kernel()
 File "/home/rb/projects/OpenInterpreter/01/software/source/server/utils/kernel.py", line 47, in check_filtered_ke>
   messages = get_kernel_messages()
 File "/home/rb/projects/OpenInterpreter/01/software/source/server/utils/kernel.py", line 23, in get_kernel_messag>
   with open('/var/log/dmesg', 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/dmesg'
@rbrisita
Copy link
Contributor Author

rbrisita commented Apr 7, 2024

To resolve quickly simply touch /var/log/dmesg, you might need elevated privileges.

The user has access to the dmesg command and can run without elevated privileges and there is also a readable /dev/kmsg file that is kernel messages but I don't know exactly why 01OS needs access or what messages it will act on.

Proposed PR solution:

  1. Test for the existence of binary dmesg
  2. Pipe dmesg to /tmp/dmesg
  3. Return the path /tmp/dmesg to be used in get_kernel_messages function or None

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

No branches or pull requests

1 participant