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

Invalid UTF-8 passed to g_io_channel_write_chars() error in 21- #733

Closed
wneessen opened this issue May 12, 2021 · 3 comments
Closed

Invalid UTF-8 passed to g_io_channel_write_chars() error in 21- #733

wneessen opened this issue May 12, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@wneessen
Copy link

I just updated OpenVAS to 21.4.0. Updated all components. GVMd starts fine and gvmd -m migrated the database successfully to version 242. When I now start ospd-openvas, the Python script fails with the error described in greenbone/ospd-openvas#341. So I upgraded gvm-libs to the latest git branch. I rebuilt gmvd and openvas-scaner (still the 21.4.0 versions) as well. Now when I start ospd-openvas, the openvas-scanner seems to core dump.

Expected behavior

osdp-openvas executes openvas-scanner as normally

Actual behavior

ospd-openvas fails with an openvas-scanner error:

$ /usr/bin/python3 /usr/pkg/openvas/bin/ospd-openvas -s /usr/pkg/openvas/.config/ospd.conf -f -L DEBUG
OSPD[15683] 2021-05-12 13:59:09,266: INFO: (ospd.main) Starting OSPd OpenVAS version 21.4.0.
OSPD[15683] 2021-05-12 13:59:09,338: DEBUG: (ospd_openvas.lock) Created lock file /usr/pkg/openvas/var/run/feed-update.lock.
OSPD[15683] 2021-05-12 13:59:15,613: DEBUG: (ospd.server) New request from /usr/pkg/openvas/var/run/ospd.sock
OSPD[15683] 2021-05-12 13:59:15,616: DEBUG: (ospd.ospd) Handling get_vts command request.
OSPD[15683] 2021-05-12 13:59:19,350: DEBUG: (ospd_openvas.openvas) Loading VTs into Redis DB...

(process:15694): GLib-WARNING (recursed) **: Invalid UTF-8 passed to g_io_channel_write_chars().OSPD[15683] 2021-05-12 13:59:19,455: ERROR: (ospd_openvas.openvas) OpenVAS Scanner failed to load VTs. Command '['openvas', '--update-vt-info']' died with <Signals.SIGABRT: 6>.
OSPD[15683] 2021-05-12 13:59:19,525: DEBUG: (ospd_openvas.lock) Removed lock from file /usr/pkg/openvas/var/run/feed-update.lock.
Traceback (most recent call last):
  File "/usr/pkg/openvas/bin/ospd-openvas", line 33, in <module>
    sys.exit(load_entry_point('ospd-openvas==21.4.0', 'console_scripts', 'ospd-openvas')())
  File "/usr/lib/python3.9/site-packages/ospd_openvas-21.4.0-py3.9.egg/ospd_openvas/daemon.py", line 1388, in main
  File "/usr/lib/python3.9/site-packages/ospd/main.py", line 161, in main
    daemon.init(server)
  File "/usr/lib/python3.9/site-packages/ospd_openvas-21.4.0-py3.9.egg/ospd_openvas/daemon.py", line 485, in init
  File "/usr/lib/python3.9/site-packages/ospd/ospd.py", line 253, in set_vts_version
    raise OspdCommandError(
ospd.errors.OspdCommandError: A vts_version parameter is required
OSPD[15683] 2021-05-12 13:59:19,534: DEBUG: (ospd.main) Performing exit clean up
OSPD[15683] 2021-05-12 13:59:19,534: DEBUG: (ospd.ospd) All scans stopped and daemon clean and ready to exit
OSPD[15683] 2021-05-12 13:59:19,534: INFO: (ospd.main) Shutting-down server ...
OSPD[15683] 2021-05-12 13:59:19,620: DEBUG: (ospd.main) Finishing daemon process

The error is actually reproducable by just running the openvas command:

$ openvas
(process:15711): GLib-WARNING (recursed) **: Invalid UTF-8 passed to g_io_channel_write_chars().Aborted (core dumped)
$ openvas
(process:15719): GLib-WARNING (recursed) **: Invalid UTF-8 passed to g_io_channel_write_chars().Aborted (core dumped)
$ openvas
(process:15726): GLib-WARNING (recursed) **: Invalid UTF-8 passed to g_io_channel_write_chars().Aborted (core dumped)

Every now and then, it also throws a different error:

$ openvas
double free or corruption (fasttop)
Aborted (core dumped)

Steps to reproduce

Used OS: Arch Linux (rolling)

  1. Download sources for 21.4.0
  2. Download the latest gvm-lib sources from git
  3. Build everything and install it
  4. Run gvmd -m to migrate the database to 242
  5. Execute ospd-openvas (or openvas directly)
  6. It will core dump with different errors

GVM versions

gsa: (gsad --version)

$ gsad --version
Greenbone Security Assistant 21.04.0

gvm: (gvmd --version)

$ gvmd --version
Greenbone Vulnerability Manager 21.4.0
Manager DB revision 242
Copyright (C) 2009-2021 Greenbone Networks GmbH
License: AGPL-3.0-or-later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

openvas: (openvas --version)

$ openvas --version
OpenVAS 21.4.0
gvm-libs 21.10.0~dev1
Most new code since 2005: (C) 2021 Greenbone Networks GmbH
Nessus origin: (C) 2004 Renaud Deraison <deraison@nessus.org>
License GPLv2: GNU GPL version 2
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law

gvm-libs:
Latest Git branch

openvas-smb:
Not installed

ospd-openvas: (ospd-openvas --version)

$ ospd-openvas --version
OSP Server for openvas: 21.4.0
OSP: 21.4.0
OSPd OpenVAS: 21.4.0

Copyright (C) 2014-2021 Greenbone Networks GmbH
License GPLv2+: GNU GPL version 2 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Environment

Operating system:

cat /etc/lsb-release
LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"

Installation method / source: (packages, source installation)
Sources

@wneessen wneessen added the bug Something isn't working label May 12, 2021
@jjnicola
Copy link
Member

jjnicola commented May 14, 2021

Hi @wneessen !
Thanks for reporting this issue. I was able to reproduce it. It seems you have something wrong in your redis-server setup, or there is no redis instance running at all.
To reproduce it, I have just changed the permission on the redis socket.

$ ls -la /tmp/redis.sock 
srwxrwx--- 1 juan juan 0 May 14 02:15 /tmp/redis.sock
$ chmod 700 /tmp/redis.sock 
$ sudo chown redis:redis /tmp/redis.sock 
$ openvas

(process:2358): GLib-WARNING (recursed) **: Invalid UTF-8 passed to g_io_channel_write_chars().Aborted

I will fix this soon. Thanks again!

Best Regards,
Juan

@jjnicola
Copy link
Member

Fixed with greenbone/gvm-libs#499

@wneessen
Copy link
Author

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants