-
Notifications
You must be signed in to change notification settings - Fork 174
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
IBus broken after updating glib2 2.80.1 #2639
Comments
Do you receive the warning message from |
No, I get warning messages from all applications with input entry, such as gnome-shell, nautilus, chromium... |
Can you please paste the warning messages? |
|
Does ibus use On a spec-compliant message bus, each connection has exactly one unique name which starts with The only exception to this is that After fixing CVE-2024-34397, GLib enforces those rules - but if ibus is doing something weird here then that enforcement might need to be relaxed. |
The problem can be reproduced simply by running the following command when IBus is enabled:
If IBus were following the D-Bus specification, the return value would look like By contrast, if the bus daemon on the session bus is asked what unique name owns
|
The reply to Line 789 in 4059b9f
This code appears to originate from before at least 13 years ago, when IBus was ported from libdbus to GDBus. |
According to the D-Bus Specification, `org.freedesktop.DBus.GetNameOwner()` must return a unique name (i.e. one of the form `:1.23`). The only unique name which is allowed to not be in this form is `org.freedesktop.DBus`. Previously, `ibus-daemon` was returning `org.freedesktop.IBus` when asked for the owner of `org.freedesktop.IBus`. That’s not a valid unique name. Change how that’s hardcoded to return `:1.1` instead. That’s the first unique name connected to the bus, which will currently always be the `ibus-daemon` itself (and this name won’t disconnect as long as the bus is running). In the long term, it might be more robust to rework the code so that the mapping from `org.freedesktop.IBus` → a unique name is stored in `dbus->names` (in `dbusimpl.c`) like all the other requested names. However, handling for the `org.freedesktop.IBus` well-known name is hardcoded throughout `dbusimpl.c`, so porting this single bit of it to create a `BusNameService` would probably cause more problems. I don’t believe that changing the return value of `GetNameOwner` will break anything within ibus.git: the only calls to `GetNameOwner` that I can find are either to query `org.freedesktop.IBus.Config`, or to check whether an owner is set at all (rather than the specific value of the owner). Signed-off-by: Philip Withnall <pwithnall@gnome.org> Fixes: ibus#2639
GLib 2.80.2 and 2.78.6 work around this by allowing the owner of a well-known name to be a well-known name, but it's still weird, and it would be better if ibus behaved more like a normal message bus. |
OK, I see. |
However ibus-daemon has already implemented |
Not really. There are two issues in IBus related to this, but as far as I know neither of them are security issues. The first issue is that IBus returns The second issue is that IBus sets Simon’s suggestion of reserving A more systematic solution which adds a mapping between |
If reserving |
I believe that would be valid according to the D-Bus Specification and accepted by GDBus. I can't guarantee that all other D-Bus implementations that might interact with ibus follow the spec. It's possible that there is an implementation that assumes that unique names always fit the pattern used in the reference dbus-daemon (which is basically |
@smcv Thank you for your advice. I agree with you. |
According to the D-Bus Specification, `org.freedesktop.DBus.GetNameOwner()` must return a unique name (i.e. one of the form `:1.23`). The only unique name which is allowed to not be in this form is `org.freedesktop.DBus`. GLib2 2.80.1 has updated g_dbus_is_unique_name() to meet the sepcification. In the long term, it might be more robust to rework the code so that the mapping from `org.freedesktop.IBus` → a unique name is stored in `dbus->names` (in `dbusimpl.c`) like all the other requested names. However, handling for the `org.freedesktop.IBus` well-known name is hardcoded throughout `dbusimpl.c`, so porting this single bit of it to create a `BusNameService` would probably cause more problems. BUG=ibus#2639 BUG=https://gitlab.gnome.org/GNOME/glib/-/issues/3268 BUG=GHSA-f632-c3rh-r2v2
I craated #2643 thx. |
According to the D-Bus specification, `org.freedesktop.DBus.GetNameOwner()` must return a unique name (i.e. one of the form `:1.23`). The only unique name which is allowed to not be in this form is `org.freedesktop.DBus`. The change in GLib 2.80.1 was to validate that the sender of every message is either a unique name (according to `g_dbus_is_unique_name()`), or the special name `org.freedesktop.DBus` to meet the specification. In the long term, it might be more robust to rework the code so that the mapping from `org.freedesktop.IBus` → a unique name is stored in `dbus->names` (in `dbusimpl.c`) like all the other requested names. However, handling for the `org.freedesktop.IBus` well-known name is hardcoded throughout `dbusimpl.c`, so porting this single bit of it to create a `BusNameService` would probably cause more problems. BUG=ibus#2639 BUG=https://gitlab.gnome.org/GNOME/glib/-/issues/3268 BUG=GHSA-f632-c3rh-r2v2
ibus-portal can accept the connection from IBUS_SERVICE_IBUS only but now the IBus unique name is changed to IBUS_NAME_OWNER_NAME as the D-Bus name owner and probably I think the name check is not needed and just delete it. BUG=ibus#2639 Fixes: ibus@759105d
Please fill in the following items if you don't know the root cause.
Which distribution and version?:
Which desktop environment and version?:
Which session type?:
Which application and version?:
IBus version?:
Issue description:
See CVE-2024-34397 https://gitlab.gnome.org/GNOME/glib/-/issues/3268.
Received GetNameOwner reply with invalid owner "org.freedesktop.IBus" for "org.freedesktop.IBus"
Steps to reproduce:
Received GetNameOwner reply with invalid owner "org.freedesktop.IBus" for "org.freedesktop.IBus"
Can you reproduce your problem when you restart ibus-daemon? (yes / no):
Do you see any errors when you run ibus-daemon with the verbose option?
(ibus-ui-gtk3:38001): GLib-GIO-WARNING **: 07:35:37.908: Received GetNameOwner reply with invalid owner "org.freedesktop.IBus" for "org.freedesktop.IBus"
Can you reproduce your problem with a new user account instead of the current your account? (yes / no):
The text was updated successfully, but these errors were encountered: