Hello,

Additional independent source-level evidence related to Debian
#1147303, from Ubuntu/Kubuntu 26.10 with gnome-keyring 51.1-1, GLib
2.90.0-1 and D-Bus 1.16.2-5ubuntu2.

The daemon repeatedly aborted (SIGABRT) after:
  gkd_secret_service_get_pkcs11_session: assertion 'client' failed
  aes_negotiate: assertion 'session' failed
  gkd_secret_service_publish_dispatch: assertion 'client' failed
  g_variant_new: expected GVariant of type 'v' but received type '(null)'

A non-secret source audit of gnome-keyring-51.1.tar.xz (SHA256
dfe7adc5876ef0670e7eba2907799bdbb8875ce58bb4208e1a52169bd16a47ca)
identified a related error-propagation hole in
daemon/dbus/gkd-secret-session.c.

In both aes_negotiate() (line 185-186) and plain_negotiate() (line
252-253), the code calls gkd_secret_service_get_pkcs11_session() and
immediately uses:
    g_return_val_if_fail (session, FALSE);
If session is NULL, the caller service_method_open_session() in
gkd-secret-service.c checks only whether GError *error != NULL, not
the boolean return value of gkd_secret_session_handle_open(). It can
therefore enter the success path with NULL output/result.

RFC change in both negotiation functions:
    session = gkd_secret_service_get_pkcs11_session (self->service,
self->caller);
    if (session == NULL) {
        g_set_error_literal (error_out, G_DBUS_ERROR,
                             G_DBUS_ERROR_FAILED,
                             "Failed to establish a PKCS#11 session.");
        return FALSE;
    }

An isolated source patch against 51.1 changed precisely these two
OpenSession paths (no other use of the session function). The static
source checks passed, but it has NOT been compiled, exercised on a
live D-Bus server, or regression-tested against a keyring. The running
user's keyring and secrets were not modified. The precise method-call
correlation for every historical SIGABRT is still unproven.

This is a related candidate for review, not a claimed fix of the
distinct property-GET path already discussed in this bug. Please route
upstream if useful, alongside the GNOME upstream OpenSession issue
#190. I can provide the full unified diff and sanitized source-only
test details.

Regards,
Alexander Stepanov

Reply via email to