After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796349 - Do not listen all if invalid interface is provided
Do not listen all if invalid interface is provided
Status: RESOLVED FIXED
Product: vino
Classification: Applications
Component: Server
unspecified
Other All
: Normal normal
: ---
Assigned To: Vino Maintainer(s)
Vino Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2018-05-23 07:08 UTC by Ondrej Holy
Modified: 2018-09-12 07:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not listen all if invalid interface is provided (2.45 KB, patch)
2018-05-23 07:09 UTC, Ondrej Holy
committed Details | Review
Prevent monitoring all interfaces after change of other props (1.48 KB, patch)
2018-08-24 14:21 UTC, Ondrej Holy
none Details | Review
Properly remove watches when changing server props (2.76 KB, patch)
2018-08-24 14:21 UTC, Ondrej Holy
committed Details | Review
Return empty string instead of NULL to prevent criticals (1.11 KB, patch)
2018-08-24 14:21 UTC, Ondrej Holy
committed Details | Review
Prevent monitoring all interfaces after change of other props (1.48 KB, patch)
2018-09-12 07:03 UTC, Ondrej Holy
committed Details | Review

Description Ondrej Holy 2018-05-23 07:08:58 UTC
It is not a good idea from security point of view to listen all interfaces
in case of invalid interface is provided. We should rather listen to nothing
and print error in journal.
Comment 1 Ondrej Holy 2018-05-23 07:09:02 UTC
Created attachment 372354 [details] [review]
Do not listen all if invalid interface is provided
Comment 2 David King 2018-05-23 07:12:10 UTC
Review of attachment 372354 [details] [review]:

Seems fine.
Comment 3 Ondrej Holy 2018-05-23 07:14:17 UTC
Originally, this has been reported downstream:
https://bugzilla.redhat.com/show_bug.cgi?id=1580577
Comment 4 Ondrej Holy 2018-05-23 07:18:21 UTC
Thanks!

Attachment 372354 [details] pushed as bfa1432 - Do not listen all if invalid interface is provided
Comment 5 Ondrej Holy 2018-08-24 14:20:54 UTC
There is obviously an issue with that patch as per the downstream report. I am going to propose additional fixes here...
Comment 6 Ondrej Holy 2018-08-24 14:21:28 UTC
Created attachment 373453 [details] [review]
Prevent monitoring all interfaces after change of other props

Commit bfa1432 prevents monitoring all interfaces if invalid interface
is provided, but it works only in some cases, because the invalid
interface is not remebered and for example consequent change of port
will cause that all interfaces are monitored again. Remember the invalid
interface to prevent monitoring all interfaces even after change of
other properties...
Comment 7 Ondrej Holy 2018-08-24 14:21:33 UTC
Created attachment 373454 [details] [review]
Properly remove watches when changing server props

vino_server_init_io_channels calls vino_server_deinit_io_channels
at the beginning, however the watches and channels don't have to be
removed respective closed, because it relies on rfbListenSock array,
which can be already modified as a consequence of changing server
properties. Let's call vino_server_deinit_io_channels before changing
server properties in order to prevent the following errors:

rfbCheckFds: accept: Invalid argument
Comment 8 Ondrej Holy 2018-08-24 14:21:38 UTC
Created attachment 373455 [details] [review]
Return empty string instead of NULL to prevent criticals

The code expects that avahi_client_get_host_name_fqdn never return NULL,
but it can happen in some cases. Return empty string instead of NULL to
prevent the following criticals:

GLib-CRITICAL **: 14:29:52.305: g_variant_new_string: assertion 'string != NULL' failed
Comment 9 Ondrej Holy 2018-08-24 14:21:58 UTC
David, can you please take a look at again?
Comment 10 Ondrej Holy 2018-09-05 07:03:20 UTC
I have created the following MR for those patches for easier reviewing:
https://gitlab.gnome.org/GNOME/vino/merge_requests/5
Comment 11 David King 2018-09-11 14:20:55 UTC
Review of attachment 373453 [details] [review]:

Small typo "remebered" in commit message, but otherwise fine.
Comment 12 David King 2018-09-11 14:21:53 UTC
Review of attachment 373454 [details] [review]:

Looks fine.
Comment 13 David King 2018-09-11 14:24:11 UTC
Review of attachment 373455 [details] [review]:

Looks good.
Comment 14 David King 2018-09-11 14:24:41 UTC
Review of attachment 373453 [details] [review]:

Small typo "remebered" in commit message, but otherwise fine.
Comment 15 Ondrej Holy 2018-09-12 07:03:22 UTC
Created attachment 373614 [details] [review]
Prevent monitoring all interfaces after change of other props

Fixed typo.
Comment 16 Ondrej Holy 2018-09-12 07:05:32 UTC
Thanks for the review!

Attachment 373454 [details] pushed as 56ac246 - Properly remove watches when changing server props
Attachment 373455 [details] pushed as 15eb3c5 - Return empty string instead of NULL to prevent criticals
Attachment 373614 [details] pushed as e49456a - Prevent monitoring all interfaces after change of other props